This workflow corresponds to n8n.io template #2705 — we link there as the canonical source.
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": "EJ 7 - RAG (web)",
"nodes": [
{
"parameters": {},
"id": "e34add3a-18e1-4258-88ff-129222fca8d5",
"name": "When clicking \u2018Test workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
840,
260
],
"typeVersion": 1
},
{
"parameters": {
"url": "https://es.wikipedia.org/wiki/Inteligencia_artificial",
"options": {}
},
"id": "4f57f67a-fd80-4ceb-9c1b-87031aaca2e9",
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"position": [
1120,
260
],
"typeVersion": 4.2
},
{
"parameters": {
"mode": "insert",
"pineconeIndex": {
"__rl": true,
"value": "n8n-demo",
"mode": "list",
"cachedResultName": "n8n-demo"
},
"options": {}
},
"id": "7f8fc188-965a-4edf-a3f8-33f6d9bac00a",
"name": "Pinecone Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"position": [
1480,
260
],
"typeVersion": 1,
"credentials": {
"pineconeApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"id": "82e83ecf-db36-419a-b552-334110ff5407",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
1580,
460
],
"typeVersion": 1
},
{
"parameters": {
"options": {}
},
"id": "4dfe5136-c88f-4045-a3dd-129ccae28d99",
"name": "Recursive Character Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
1600,
640
],
"typeVersion": 1
},
{
"parameters": {
"options": {}
},
"id": "dc445747-89d7-413e-853d-e85a69a4c044",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
1180,
1260
],
"typeVersion": 1.1
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.chatInput }}",
"options": {
"systemMessage": "Sos un asistente \u00fatil y preciso. Respond\u00e9 preguntas sobre inteligencia artificial usando \u00fanicamente la informaci\u00f3n proporcionada en los documentos recuperados.\nEsa informaci\u00f3n proviene de la p\u00e1gina de Wikipedia en espa\u00f1ol sobre inteligencia artificial, y est\u00e1 guardada en una base vectorial.\nNo inventes datos. Si la respuesta no est\u00e1 en los documentos proporcionados, respond\u00e9:\n\u201cLo siento, no tengo informaci\u00f3n suficiente para responder esa pregunta con los datos disponibles.\u201d"
}
},
"id": "3e03501a-cac3-47d5-bf42-f4e136057161",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1520,
1260
],
"typeVersion": 1.7
},
{
"parameters": {
"options": {}
},
"id": "85eeda6d-3a50-4a1a-b6a1-7c5002e96fcc",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1440,
1440
],
"typeVersion": 1.1,
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"id": "84ddfa4b-3342-421b-80e6-561234fd4658",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1600,
1440
],
"typeVersion": 1.3
},
{
"parameters": {
"name": "Wikipedia_InteligenciaArtificial",
"description": "Sos un asistente \u00fatil y preciso. Us\u00e1 esta herramienta para obtener informaci\u00f3n sobre inteligencia artificial.\nLa base de datos contiene fragmentos de texto extra\u00eddos de la p\u00e1gina de Wikipedia en espa\u00f1ol sobre inteligencia artificial.\nRespond\u00e9 \u00fanicamente con la informaci\u00f3n recuperada de esa fuente."
},
"id": "a348a3ff-0dfd-4e4c-9467-8857d4793c60",
"name": "Vector Store Tool",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"position": [
1780,
1440
],
"typeVersion": 1
},
{
"parameters": {
"options": {}
},
"id": "b0be7ceb-ae7a-46ba-b9f2-b8cdf7f86d95",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2040,
1620
],
"typeVersion": 1.1,
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"content": "## Indexar contenido en la base de datos vectorial\n\nEsta parte del flujo de trabajo se encarga de extraer contenido, generar embeddings y enviarlos a la base de datos vectorial Pinecone.\n\nSolicita las especificaciones OpenAPI desde GitHub mediante una solicitud HTTP. Luego, divide el archivo en fragmentos, genera embeddings para cada fragmento usando OpenAI y los guarda en la base de datos vectorial de Pinecone.\n",
"height": 200,
"width": 640
},
"id": "e3ad6c32-3f58-4189-a902-1b8793b08710",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
920,
0
],
"typeVersion": 1
},
{
"parameters": {
"content": "## Consulta y generaci\u00f3n de respuestas\n\nEsta parte del flujo de trabajo se encarga de la interfaz de chat, de realizar consultas a la base de datos vectorial y de generar respuestas relevantes.\n\nUtiliza OpenAI GPT 4o-mini para generar las respuestas.\n",
"width": 580
},
"id": "742e4ccf-2175-4d7a-b0dd-f02c5b99b91d",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
620,
1500
],
"typeVersion": 1
},
{
"parameters": {
"options": {}
},
"id": "7a2609be-6ae2-43e9-9d7d-44f40fb97ece",
"name": "Generate User Query Embedding",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1640,
1740
],
"typeVersion": 1.2,
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"pineconeIndex": {
"__rl": true,
"value": "n8n-demo",
"mode": "list",
"cachedResultName": "n8n-demo"
},
"options": {}
},
"id": "f38407b9-3737-4105-93c2-5c097145fc48",
"name": "Pinecone Vector Store (Querying)",
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"position": [
1680,
1600
],
"typeVersion": 1,
"credentials": {
"pineconeApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"id": "9df4ad2d-d979-4ef8-84d4-d00668a61837",
"name": "Generate Embeddings",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1400,
460
],
"typeVersion": 1.2,
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"content": "## Flujo de trabajo RAG en n8n\n\nEste es un ejemplo de c\u00f3mo usar t\u00e9cnicas RAG para crear un chatbot con n8n. Se trata de un chatbot de documentaci\u00f3n de API que puede responder preguntas sobre la API de GitHub. Utiliza OpenAI para generar embeddings, el modelo LLM gpt-4o-mini para generar respuestas, y Pinecone como base de datos vectorial.\n\nAntes de usar esta plantilla\n- Crear cuentas en OpenAI y Pinecone\n- Obtener las claves API de OpenAI y Pinecone\n- Configurar las credenciales en n8n para ambos servicios\n\nAsegurarse de tener un \u00edndice en Pinecone llamado \"n8n-demo\" o ajustar el flujo de trabajo en consecuencia.",
"height": 360,
"width": 620
},
"id": "9f4a108a-21c5-4045-b8bf-8061756a7063",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
140,
0
],
"typeVersion": 1
}
],
"connections": {
"HTTP Request": {
"main": [
[
{
"node": "Pinecone Vector Store",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Vector Store Tool": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Vector Store Tool",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Generate Embeddings": {
"ai_embedding": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Generate User Query Embedding": {
"ai_embedding": [
[
{
"node": "Pinecone Vector Store (Querying)",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Pinecone Vector Store (Querying)": {
"ai_vectorStore": [
[
{
"node": "Vector Store Tool",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"When clicking \u2018Test workflow\u2019": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "bfd0dcc2-f2c0-4dec-81ef-2b8722e5dc6b",
"meta": {
"templateId": "2705",
"templateCredsSetupCompleted": true
},
"id": "552Ocm3JJn0wn2vy",
"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.
openAiApipineconeApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
EJ 7 - RAG (web). Uses httpRequest, vectorStorePinecone, documentDefaultDataLoader, textSplitterRecursiveCharacterTextSplitter. Event-driven trigger; 17 nodes.
Source: https://github.com/cynthiavillagra/n8n-ejemplos/blob/774c1bc505b22c6bec28a1fdf4133e1a534650eb/EJ_7___RAG__web_.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.
Alfred (funcional). Uses gmailTool, googleCalendarTool, gmail, embeddingsOpenAi. Event-driven trigger; 83 nodes.
This intelligent chatbot leverages cutting-edge financial APIs and AI-driven analysis to deliver comprehensive stock research reports. Get instant access to professional-grade investment analysis that
This advanced n8n workflow automates the full lead enrichment, qualification, and personalized outreach process tailored specifically for the B2B real estate sector. Integrating top platforms like Api
This n8n template automatically classifies incoming emails (Sales, Support, Internal, Finance, Promotions) and routes them to a dedicated OpenAI LLM Agent for processing. Depending on the category, th
Automate Outreach Prospect automates finding, enriching, and messaging potential partners (like restaurants, malls, and bars) using Apify Google Maps scraping, Perplexity enrichment, OpenAI LLMs, Goog