This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Local PDF RAG - 2 Chat (Corrected)",
"nodes": [
{
"parameters": {
"options": {}
},
"id": "50bba127-a6ac-4540-a036-9727d38a7f2e",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.2,
"position": [
-560,
0
]
},
{
"parameters": {
"options": {}
},
"id": "be1abafc-b359-4656-915a-c60cd71cd545",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 2,
"position": [
-240,
0
]
},
{
"parameters": {
"model": "qwen3:4b",
"options": {}
},
"id": "c834bd1d-0ff1-46a5-b3fa-6de856ae97ef",
"name": "Ollama Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
"typeVersion": 1,
"position": [
-240,
240
],
"credentials": {
"ollamaApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"mode": "retrieve-as-tool",
"toolName": "pdf_knowledge_base",
"toolDescription": "Search the uploaded PDF documents and use the retrieved passages to answer the user's question. If the requested information is not present in the uploaded PDFs, say that you could not find it in the uploaded documents.",
"memoryKey": {
"__rl": true,
"mode": "list",
"value": "local_pdf_rag"
}
},
"id": "5713bba8-3495-4ee5-a5a2-1637588d7977",
"name": "PDF Knowledge Base",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"typeVersion": 1.3,
"position": [
40,
0
]
},
{
"parameters": {
"model": "nomic-embed-text",
"options": {}
},
"id": "b95cd9fa-0a37-4106-a0a0-77c9098abe7c",
"name": "Ollama Embeddings",
"type": "@n8n/n8n-nodes-langchain.embeddingsOllama",
"typeVersion": 1,
"position": [
40,
300
],
"credentials": {
"ollamaApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Ollama Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"PDF Knowledge Base": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Ollama Embeddings": {
"ai_embedding": [
[
{
"node": "PDF Knowledge Base",
"type": "ai_embedding",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "4346abc9-aeea-4ab4-8b73-5b5c21d07a62",
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
ollamaApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Local PDF RAG - 2 Chat (Corrected). Uses chatTrigger, agent, lmChatOllama, vectorStoreInMemory. Chat trigger; 5 nodes.
Source: https://gitlab.com/syedali1621/n8n-ollama-rag-workflows/-/blob/main/Local_PDF_RAG_2_Chat_CORRECTED.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Poc-Rag-Llm. Uses lmChatOllama, embeddingsOllama, chatTrigger, agent. Chat trigger; 12 nodes.
Demo: RAG in n8n. Uses formTrigger, documentDefaultDataLoader, vectorStoreInMemory, agent. Event-driven trigger; 13 nodes.
Provides one workflow to maintain the knowledge base and another one to query the knowledge base. Uploaded documents are saved into the Qdrant vector store. When a query is made, the most relevant doc
[Vorlage] Agent — RAG (Qdrant Wissensbasis). Uses chatTrigger, agent, lmChatOllama, vectorStoreQdrant. Chat trigger; 6 nodes.
RAG Agent Integration Hub mit Knowledge Management. Uses memoryPostgresChat, lmChatOllama, lmOllama, toolVectorStore. Chat trigger; 27 nodes.