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": "RAG Agent Part-2 ( Retrieval -> Augmented -> Generation )",
"nodes": [
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.4,
"position": [
-240,
-16
],
"id": "0d476574-3a73-413d-9cf6-ff329c94516b",
"name": "When chat message received"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3.1,
"position": [
-32,
-16
],
"id": "1b85045e-1d5a-4d87-a679-470c347e8067",
"name": "AI Agent"
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.4,
"position": [
-64,
224
],
"id": "a3f1f486-2e6e-40b4-b53e-ed9f3ab1b75a",
"name": "Simple Memory"
},
{
"parameters": {
"description": "Data includes a resume, project-related information, and frequently asked interview questions."
},
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"typeVersion": 1.1,
"position": [
128,
192
],
"id": "8e6bd89b-8f55-4cdd-9550-cc163a9c4f79",
"name": "Answer questions with a vector store"
},
{
"parameters": {
"model": {
"__rl": true,
"value": "gpt-4o-mini",
"mode": "list",
"cachedResultName": "gpt-4o-mini"
},
"builtInTools": {},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.3,
"position": [
352,
400
],
"id": "e121a7cd-da3e-4b3a-932c-89e7983002e3",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"pineconeIndex": {
"__rl": true,
"value": "resume-projects-docs",
"mode": "list",
"cachedResultName": "resume-projects-docs"
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"typeVersion": 1.3,
"position": [
-16,
400
],
"id": "b06a8b86-4b04-4b0e-bc65-d5e894047e7e",
"name": "Pinecone Vector Store",
"credentials": {
"pineconeApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"typeVersion": 1.2,
"position": [
-16,
544
],
"id": "2ba08714-5004-4a71-94b5-8f018c2f7dd2",
"name": "Embeddings OpenAI",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"builtInTools": {},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.3,
"position": [
-240,
224
],
"id": "5e4f309e-d110-4830-86cd-826583ed38aa",
"name": "OpenAI Chat Model1",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"content": "Learning (RAG Flow): \n\nUser Query: The process begins when a user submits a query.\n\nQuery Embedding: The query is sent to an Embedding API, which converts it into an embedding.\n\nSemantic Search: A semantic search is performed by comparing the query embedding with the embeddings stored in the vector store (e.g., ChromaDb, Faiss, Pinecone).\n\nRetrieve Ranked Results: The system retrieves ranked results based on similarity, with the number of results determined by the \"top K\" setting.\n\nContext for LLM: These ranked document chunks become the context provided to the Large Language Model (LLM).\n\nGenerate Answer: The LLM processes the context and query to generate a final answer for the user.\n",
"height": 480,
"width": 480,
"color": 5
},
"type": "n8n-nodes-base.stickyNote",
"position": [
544,
0
],
"typeVersion": 1,
"id": "3343c27a-778e-4b8d-bb64-e6fa857e3925",
"name": "Sticky Note"
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Answer questions with a vector store": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Answer questions with a vector store",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Pinecone Vector Store": {
"ai_vectorStore": [
[
{
"node": "Answer questions with a vector store",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1",
"binaryMode": "separate",
"availableInMCP": false
},
"staticData": null,
"triggerCount": 0,
"meta": {
"templateCredsSetupCompleted": true
}
}
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.
openAiApipineconeApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
RAG Agent Part-2 ( Retrieval -> Augmented -> Generation ). Uses chatTrigger, agent, memoryBufferWindow, toolVectorStore. Chat trigger; 9 nodes.
Source: https://github.com/DuttPanchal04/n8n-ai-automation-portfolio/blob/main/rag-agent-part-2-retrieval-augmented-generation/rag-agent-part-2-retrieval-augmented-generation-workflow.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.
Empower your workflows with an intelligent AI chat assistant that retrieves real-time context from Google Sheets and a Pinecone knowledge base using Retrieval-Augmented Generation (RAG). 🤖📂 This workf
This workflow transforms your n8n instance into a fully automated AI sales assistant for WooCommerce stores. It detects customer intent from chat, searches products, answers FAQs, generates Stripe pay
Airbnb Guest Assistant. Uses lmChatOpenAi, googleDrive, documentDefaultDataLoader, textSplitterCharacterTextSplitter. Chat trigger; 26 nodes.
OpenAI Personal Shopper with RAG and WooCommerce. Uses chatTrigger, memoryBufferWindow, toolCalculator, lmChatOpenAi. Chat trigger; 25 nodes.
OpenAI Personal Shopper with RAG and WooCommerce. Uses chatTrigger, memoryBufferWindow, toolCalculator, lmChatOpenAi. Chat trigger; 25 nodes.