Block 1 - When chat message received
- Type / Role
- @n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
- Config choices
- Version 1.1
This workflow is provided as-is. Please review and test before using in production.
Detailed n8n Workflow Description Main Flow The workflow operates through a three step process that handles incoming chat messages with intelligent tool orchestration: 1. Message Trigger : The n...
@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.memorypostgreschat, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.rerankercohere, @n8n/n8n-nodes-langchain.lmchatanthropic, n8n-nodes-base.postgrestool, @n8n/n8n-nodes-langchain.vectorstoresupabase, n8n-nodes-base.manualtrigger
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Paul.
Original n8n.io sourceThe workflow operates through a three-step process that handles incoming chat messages with intelligent tool orchestration:
Message Trigger: The When chat message received node triggers whenever a user message arrives and passes it directly to the Knowledge Agent for processing.
Agent Orchestration: The Knowledge Agent serves as the central orchestrator, registering a comprehensive toolkit of capabilities:
Anthropic Chat Model with the claude-sonnet-4-20250514 model to craft final responsesPostgres Chat Memory to save and recall conversation context across sessionsThink tool to force internal chain-of-thought processing before taking any actionGeneral knowledge vector store with OpenAI embeddings (1536-dimensional) and Cohere reranking for intelligent content retrievalstructured data Postgres tool for executing queries on relational database tablessearch about any doc in google drive functionality to locate specific file IDsRead File From GDrive sub-workflow for fetching and processing various file formatsMessage a model in Perplexity for accessing up-to-the-minute web information when internal knowledge proves insufficientResponse Generation: After invoking the Think process, the agent intelligently selects appropriate tools based on the query, integrates results from multiple sources, and returns a comprehensive Markdown-formatted answer to the user.
The workflow maintains conversation continuity through Postgres Chat Memory, which automatically logs every user-agent exchange. This ensures long-term context retention without requiring manual intervention, allowing for sophisticated multi-turn conversations that build upon previous interactions.
The semantic search system operates through a sophisticated two-stage process:
Embeddings OpenAI converts textual content into high-dimensional vector representationsReranker Cohere reorders search hits to prioritize the most contextually relevant resultsGeneral knowledge vector store, providing the agent with relevant internal knowledge snippets for enhanced response accuracyThe file reading capability handles multiple formats through a structured sub-workflow:
Read File From GDrive with the selected fileId parameterWhen Executed by Another Workflow node activates the dedicated file processing sub-workflowOperation node confirms the request type is readFileDownload File1 node retrieves the binary file data from Google DriveFileType node branches processing based on MIME type:Extract from PDF â Get PDF Response to extract plain text contentExtract from CSV â Get CSV Response to obtain comma-delimited text dataAnalyse Image with GPT-4o-mini to generate visual descriptionsTranscribe Audio with Whisper for text transcript generationKnowledge Agent, which seamlessly weaves it into the final responseWhen internal knowledge sources prove insufficient, the workflow can access current public information through Message a model in Perplexity, ensuring responses remain accurate and up-to-date with the latest available information.
The workflow architecture incorporates several key design principles that enhance reliability and reusability:
Think step significantly reduces hallucinations and prevents tool misuse by requiring deliberate consideration before actionWith this comprehensive architecture, the assistant delivers powerful capabilities including long-term memory retention, semantic knowledge retrieval, multi-format file processing, and contextually rich responses tailored specifically for users at [your company]. The system balances sophisticated AI capabilities with practical business requirements, creating a robust foundation for enterprise-grade conversational AI deployment.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
Showing the first 24 of 40 workflow blocks. Download the JSON for the full node graph.
| Workflow | Build an All-Source Knowledge Assistant with Claude, RAG, Perplexity, and Drive |
|---|---|
| Complexity | advanced |
| Nodes | 40 |
| Categories | Internal Wiki, AI RAG |
| Author | Paul |
| Published | 27 Jul 2025 |
Use the JSON export at /data/workflows/6542/6542.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
Detailed n8n Workflow Description Main Flow The workflow operates through a three step process that handles incoming chat messages with intelligent tool orchestration: 1. Message Trigger : The n...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.