This workflow follows the Chainretrievalqa → Retrievervectorstore 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": "n8n_ollama_pgvector",
"nodes": [
{
"parameters": {
"public": true,
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.3,
"position": [
480,
-496
],
"id": "137911ef-4370-486c-86d7-055847c00fe9",
"name": "When chat message received"
},
{
"parameters": {
"mode": "insert",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.vectorStorePGVector",
"typeVersion": 1.3,
"position": [
-16,
-208
],
"id": "3783307b-93ec-4be8-bf5d-88fa0284cdf6",
"name": "Postgres PGVector Store",
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"typeVersion": 1,
"position": [
-144,
96
],
"id": "ef0a7648-5ab6-4f3e-abfc-036f162aa71d",
"name": "Embeddings Google Gemini",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"dataType": "binary",
"textSplittingMode": "custom",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"typeVersion": 1.1,
"position": [
64,
64
],
"id": "f57a83ce-e288-4698-bb74-d3005f407b61",
"name": "Default Data Loader"
},
{
"parameters": {
"chunkOverlap": 200,
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"typeVersion": 1,
"position": [
-16,
208
],
"id": "8bb8a803-399c-4b86-a40f-83d6b5d7d868",
"name": "Recursive Character Text Splitter"
},
{
"parameters": {
"content": "## RAG Ingestion Process\n\uc9c0\uc2dd \ubca0\uc774\uc2a4(Knowledge Base) \uad6c\ucd95",
"height": 672,
"width": 656
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-336,
-336
],
"typeVersion": 1,
"id": "03723cf7-c92f-4e50-9171-05d2e346be1c",
"name": "Sticky Note"
},
{
"parameters": {
"content": "## QnA \ubd07\nWorkflow",
"height": 592,
"width": 768,
"color": 4
},
"type": "n8n-nodes-base.stickyNote",
"position": [
400,
-608
],
"typeVersion": 1,
"id": "cfd0f908-03c4-4b88-96d3-e18c2318b124",
"name": "Sticky Note1"
},
{
"parameters": {
"model": "gemma3:latest",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
"typeVersion": 1,
"position": [
720,
160
],
"id": "b68ff380-887c-454f-b346-6655dcf8b41d",
"name": "Ollama Chat Model",
"credentials": {
"ollamaApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-1024,
-208
],
"id": "3ba1e7ed-6b7f-49c7-8c42-4d171a7df270",
"name": "When clicking \u2018Execute workflow\u2019"
},
{
"parameters": {
"fileSelector": "/data/shared/*.pdf",
"options": {}
},
"type": "n8n-nodes-base.readWriteFile",
"typeVersion": 1,
"position": [
-800,
-240
],
"id": "699b751c-6eb4-4634-808b-ce6741db476b",
"name": "Read/Write Files from Disk"
},
{
"parameters": {
"content": "## PDF \ud30c\uc77c \uc77d\uae30\n\n* **\ubaa8\ub4e0 PDF \ud30c\uc77c \uc77d\uae30**: `/data/shared/*.pdf`\n* **\ud2b9\uc815 \uc774\ub984\uc758 \ubaa8\ub4e0 \ud30c\uc77c**: `/data/shared/report_*.pdf` (\uc608: `report_1.pdf`, `report_final.pdf` \ub4f1)\n* **\ud2b9\uc815 \ubb38\uc790\uc5f4\uc744 \ud3ec\ud568\ud558\ub294 \ubaa8\ub4e0 \ud30c\uc77c**: `/data/shared/*invoice*.pdf` (\uc608: `2025_invoice.pdf`, `invoice_report.pdf` \ub4f1)\n* **\ud558\uc704 \ub514\ub809\ud1a0\ub9ac \ud3ec\ud568**: `/data/shared/**/*.pdf` (\ud558\uc704 \ub514\ub809\ud1a0\ub9ac\uc758 \ubaa8\ub4e0 PDF \ud30c\uc77c\uc744 \ud3ec\ud568)",
"height": 480,
"width": 688
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-1104,
-464
],
"typeVersion": 1,
"id": "5561a47e-daac-4a13-87ef-7eb9526f0c75",
"name": "Sticky Note2"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
"typeVersion": 1.6,
"position": [
704,
-496
],
"id": "d1b231ba-6751-483f-8b71-759df53d816f",
"name": "Question and Answer Chain"
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
"typeVersion": 1,
"position": [
880,
-320
],
"id": "4680f5a7-a3bc-4208-8a45-cc8b29a780f8",
"name": "Vector Store Retriever"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.vectorStorePGVector",
"typeVersion": 1.3,
"position": [
880,
-176
],
"id": "e8dd54cd-7ef0-489e-8bb3-965de262bc97",
"name": "Postgres PGVector Store1",
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
-576,
-224
],
"id": "b110f652-10bb-4c53-a7bd-ec88207e3748",
"name": "Loop Over Items"
},
{
"parameters": {
"model": "bge-m3:latest"
},
"type": "@n8n/n8n-nodes-langchain.embeddingsOllama",
"typeVersion": 1,
"position": [
-528,
112
],
"id": "963dbac3-711f-4bd6-b94b-a93cd47c1ee2",
"name": "Embeddings Ollama",
"credentials": {
"ollamaApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"respondWith": "text",
"options": {}
},
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.4,
"position": [
1536,
-496
],
"id": "8ca18406-31ca-41ac-bc69-47e66e747ad4",
"name": "Respond to Webhook"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
560,
-208
],
"id": "484cdc9c-6689-4c8e-bf44-99cf6c41b5ec",
"name": "Google Gemini Chat Model",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "return [{\n json: {\n text: $input.first().json.response\n }\n}];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1344,
-496
],
"id": "696ef00a-cbd4-4ec6-9470-074dfccb5146",
"name": "Code"
},
{
"parameters": {
"content": "## \ud14d\uc2a4\ud2b8 \ucd9c\ub825\n\n* **`Code` \ub178\ub4dc:** \n- \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ucf54\ub4dc\ub97c \uc2e4\ud589\ud558\uc5ec \ub370\uc774\ud130 \ubcc0\ud658, \ub85c\uc9c1 \ucc98\ub9ac, \uc678\ubd80 API \ud638\ucd9c \uac19\uc740 \ubcf5\uc7a1\ud55c \uc791\uc5c5\uc744 \uc218\ud589\ud568.\n- \uc6cc\ud06c\ud50c\ub85c\uc6b0 \ub0b4\uc5d0\uc11c \ub370\uc774\ud130\uc758 \ud615\uc2dd\uc774\ub098 \ub0b4\uc6a9\uc744 \uc790\uc720\ub86d\uac8c \uc870\uc791\ud558\ub294 \ub370 \uc4f0\uc784.\n\n* **`Respond to Webhook` \ub178\ub4dc:** \n- \uc6cc\ud06c\ud50c\ub85c\uc6b0\ub97c \uc2e4\ud589\uc2dc\ud0a8 \uc6f9\ud6c5 \uc694\uccad\uc5d0 \ub300\ud55c \ucd5c\uc885 \uc751\ub2f5\uc744 \ubc18\ud658\ud568.\n- \uc774 \ub178\ub4dc\uac00 \uc788\uc5b4\uc57c \uc6f9 \ube0c\ub77c\uc6b0\uc800\ub098 \ub2e4\ub978 \uc11c\ube44\uc2a4\uc5d0 \ud14d\uc2a4\ud2b8, JSON, \ub610\ub294 \ud30c\uc77c \uac19\uc740 \uacb0\uacfc\ub97c \ubcf4\ub0bc \uc218 \uc788\uc74c.\n- \uc2e4\uc81c \ud658\uacbd\uc5d0\uc11c\ub294 \ud544\uc218\uc801\uc778 \ub178\ub4dc\uc784.",
"height": 448,
"width": 624
},
"type": "n8n-nodes-base.stickyNote",
"position": [
1264,
-800
],
"typeVersion": 1,
"id": "a170fef0-47e2-4fd5-872a-5bd8b02e5614",
"name": "Sticky Note3"
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "Question and Answer Chain",
"type": "main",
"index": 0
}
]
]
},
"Embeddings Google Gemini": {
"ai_embedding": [
[
{
"node": "Postgres PGVector Store1",
"type": "ai_embedding",
"index": 0
},
{
"node": "Postgres PGVector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Postgres PGVector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Ollama Chat Model": {
"ai_languageModel": [
[]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Read/Write Files from Disk",
"type": "main",
"index": 0
}
]
]
},
"Read/Write Files from Disk": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Vector Store Retriever": {
"ai_retriever": [
[
{
"node": "Question and Answer Chain",
"type": "ai_retriever",
"index": 0
}
]
]
},
"Postgres PGVector Store1": {
"ai_vectorStore": [
[
{
"node": "Vector Store Retriever",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Postgres PGVector Store",
"type": "main",
"index": 0
}
]
]
},
"Postgres PGVector Store": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Question and Answer Chain": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Question and Answer Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "9ac7f66a-7eea-470f-a9fc-a4d0ff81be10",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "L2BSpJ9zLyS4NdGf",
"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.
googlePalmApiollamaApipostgres
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
n8n_ollama_pgvector. Uses chatTrigger, vectorStorePGVector, embeddingsGoogleGemini, documentDefaultDataLoader. Chat trigger; 20 nodes.
Source: https://github.com/postforty/kor-it-langchain-class/blob/e9c6a2803870d3b1b4ffdbceeba359833b5719ed/ch08/n8n/docker-n8n-ollama-pgvector/n8n_ollama_pgvector_loop_code.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.
V2 Supabase RAG AI Agent. Uses memoryPostgresChat, lmChatOllama, lmOllama, toolVectorStore. Chat trigger; 23 nodes.
⚡AI-Powered YouTube Playlist & Video Summarization and Analysis v2. Uses lmChatGoogleGemini, agent, splitOut, chainLlm. Chat trigger; 72 nodes.
This n8n workflow transforms entire YouTube playlists or single videos into interactive knowledge bases you can chat with. Ask questions and get summaries without needing to watch hours of content. 🔗
Search Worflow Docker Complete. Uses documentDefaultDataLoader, textSplitterCharacterTextSplitter, vectorStoreSupabase, embeddingsOllama. Scheduled trigger; 71 nodes.
V3 Local Agentic RAG AI Agent. Uses documentDefaultDataLoader, memoryPostgresChat, chatTrigger, agent. Webhook trigger; 41 nodes.