具有增强检索、过滤器和记忆功能的智能 RAG 代理 - 由 ascuncia 开发
高级
这是一个AI RAG, Multimodal AI领域的自动化工作流,包含 32 个节点。主要使用 Set, Wait, Merge, Supabase, FormTrigger 等节点。 具备增强检索和模块化工作流的智能 RAG 代理
前置要求
- •Supabase URL 和 API Key
- •Google Gemini API Key
- •PostgreSQL 数据库连接信息
使用的节点 (32)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "cN01cF1imXdMQfro",
"meta": {
"instanceId": "adebbe2592e5612173c7a1dda20af6cbd944e35e3d0414c25474c49218afc346",
"templateCredsSetupCompleted": true
},
"name": "具有增强检索、过滤器和记忆功能的智能 RAG 代理 - 由 ascuncia 开发",
"tags": [],
"nodes": [
{
"id": "6052b910-009b-4db5-a956-096758e7cc07",
"name": "默认数据加载器",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
320,
704
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "=doc_id",
"value": "={{ $('Set File Data').item.json.doc_id }}"
},
{
"name": "doc_title",
"value": "={{ $('Set File Data').item.json.doc_title }}"
},
{
"name": "doc_type",
"value": "={{ $('Set File Data').item.json.doc_type }}"
},
{
"name": "source",
"value": "={{ $('Set File Data').item.json.source }}"
},
{
"name": "processed",
"value": "false"
}
]
}
},
"jsonData": "={{ $('Extract from File').item.json.text }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "c777cf9b-4048-4889-98e1-da1c38aaeb50",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1040,
448
],
"parameters": {
"color": 5,
"width": 1751,
"height": 672,
"content": "## 文件摄取流水线"
},
"typeVersion": 1
},
{
"id": "cb389645-8257-4542-9255-ada92122865f",
"name": "递归字符文本分割器",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
400,
912
],
"parameters": {
"options": {},
"chunkSize": 1500,
"chunkOverlap": 150
},
"typeVersion": 1
},
{
"id": "a034b27b-f602-43b4-a588-c284610a0b90",
"name": "删除旧文档行",
"type": "n8n-nodes-base.supabase",
"position": [
-256,
768
],
"parameters": {
"tableId": "documents",
"operation": "delete",
"filterType": "string",
"filterString": "=metadata->>doc_id=eq.{{ $('On form submission').item.json.File[0].filename }}"
},
"credentials": {
"supabaseApi": {
"id": "CJBJzRJNUpKL96fh",
"name": "Supabase - RAG-DB"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "95aeede8-3cd7-489b-ae0e-f197af68fdde",
"name": "当收到聊天消息时",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-736,
-32
],
"webhookId": "f3071b55-8fd9-4aea-ba97-8aeaaa6cf953",
"parameters": {
"public": true,
"options": {}
},
"typeVersion": 1.1
},
{
"id": "2a479838-750b-4a07-b58b-629040fef5f3",
"name": "插入到Supabase向量存储",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
224,
480
],
"parameters": {
"mode": "insert",
"options": {
"queryName": "match_documents"
},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
}
},
"credentials": {
"supabaseApi": {
"id": "CJBJzRJNUpKL96fh",
"name": "Supabase - RAG-DB"
}
},
"typeVersion": 1
},
{
"id": "d3adc752-00a4-4e06-9d8b-93975b6248c2",
"name": "嵌入 Google Gemini1",
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"position": [
192,
704
],
"parameters": {},
"credentials": {
"googlePalmApi": {
"id": "qiYf0c3QAERXYWhH",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "9b02b9e2-1883-4c81-bf70-0d07aafd8c4d",
"name": "表单提交时",
"type": "n8n-nodes-base.formTrigger",
"position": [
-928,
672
],
"webhookId": "6c4668b3-6d00-4902-ace7-a9155048779a",
"parameters": {
"options": {},
"formTitle": "Archivo",
"formFields": {
"values": [
{
"fieldType": "file",
"fieldLabel": "File",
"multipleFiles": false,
"requiredField": true,
"acceptFileTypes": ".pdf"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "1545a027-fa95-4344-84eb-54da0b454285",
"name": "从文件提取",
"type": "n8n-nodes-base.extractFromFile",
"position": [
-704,
672
],
"parameters": {
"options": {},
"operation": "pdf",
"binaryPropertyName": "File"
},
"typeVersion": 1
},
{
"id": "495722e8-2746-40ec-8793-667ab334bd89",
"name": "遍历项目",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-512,
1360
],
"parameters": {
"options": {},
"batchSize": 5
},
"typeVersion": 3
},
{
"id": "202868eb-6fab-4d39-a3c6-cdc0601abf86",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1040,
1136
],
"parameters": {
"width": 1751,
"height": 672,
"content": "## 增强流水线"
},
"typeVersion": 1
},
{
"id": "177b1443-2e70-40e0-9a5b-2885e0a95f85",
"name": "获取多行",
"type": "n8n-nodes-base.supabase",
"position": [
-736,
1360
],
"parameters": {
"limit": 150,
"tableId": "documents",
"operation": "getAll",
"filterType": "string",
"filterString": "metadata->>processed=not.eq.true"
},
"credentials": {
"supabaseApi": {
"id": "CJBJzRJNUpKL96fh",
"name": "Supabase - RAG-DB"
}
},
"typeVersion": 1
},
{
"id": "6cb4273c-9f85-46bf-aae6-5d1a7b33321a",
"name": "更新一行",
"type": "n8n-nodes-base.supabase",
"position": [
320,
1360
],
"parameters": {
"filters": {
"conditions": [
{
"keyName": "=id",
"keyValue": "={{ $('Edit Fields').item.json.row_id }}",
"condition": "eq"
}
]
},
"tableId": "documents",
"fieldsUi": {
"fieldValues": [
{
"fieldId": "metadata",
"fieldValue": "={{ JSON.stringify(\n (() => {\n const prev = $item(0).$node[\"Get many rows\"].json.metadata || {};\n let enriched = {};\n try {\n const raw = $('Metadata Obtention').item.json.content?.parts?.[0]?.text || \"{}\";\n enriched = JSON.parse(raw);\n } catch(_) {}\n return {\n ...prev,\n ...enriched,\n processed: true,\n enricher_version: \"v2-generic-2025-08\",\n enriched_at: new Date().toISOString(),\n };\n })()\n) }}\n"
}
]
},
"matchType": "allFilters",
"operation": "update"
},
"credentials": {
"supabaseApi": {
"id": "CJBJzRJNUpKL96fh",
"name": "Supabase - RAG-DB"
}
},
"typeVersion": 1
},
{
"id": "8f6c4eef-8e8a-4149-8547-d5154fc68348",
"name": "合并",
"type": "n8n-nodes-base.merge",
"position": [
-32,
688
],
"parameters": {
"mode": "chooseBranch"
},
"typeVersion": 3.2
},
{
"id": "ec4628dc-0b9b-416a-b9d8-bf5999828382",
"name": "等待",
"type": "n8n-nodes-base.wait",
"position": [
512,
1360
],
"webhookId": "f99c8e49-43ad-4b63-b788-2c91981647e7",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "05d41aff-ac21-4f17-a807-485a8c6a58ba",
"name": "设置文件数据",
"type": "n8n-nodes-base.set",
"position": [
-480,
672
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "10646eae-ae46-4327-a4dc-9987c2d76173",
"name": "doc_id",
"type": "string",
"value": "={{ $('On form submission').item.json.File.filename }}"
},
{
"id": "d75d991a-98ce-4070-943d-22e555a074c5",
"name": "doc_title",
"type": "string",
"value": "={{ $json.info.Title || $json.data.filename }}"
},
{
"id": "d7cff574-0e40-4d67-9c88-dacb8e97c45e",
"name": "doc_type",
"type": "string",
"value": "={{ \"guide\" }}"
},
{
"id": "82b5bfb4-f33d-4268-b9d4-8dd3c2f0f097",
"name": "source",
"type": "string",
"value": "={{ \"uploaded_pdf\" }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "74925cc0-31fb-4ff5-9dea-9af6b155ad63",
"name": "元数据获取",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"onError": "continueErrorOutput",
"position": [
-32,
1360
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemma-3-12b-it",
"cachedResultName": "models/gemma-3-12b-it"
},
"options": {
"temperature": 0.1,
"maxOutputTokens": 512
},
"messages": {
"values": [
{
"content": "=You are a metadata enricher for arbitrary business documents (guides, manuals, best practices, policies, FAQs, playbooks).\n\nTASK\nAnalyze the provided TEXT CHUNK and return a SINGLE-LINE, MINIFIED JSON object (no backticks, no prose). Use ONLY what is explicitly present or safely implied by the chunk. If a field does not apply, use null or [] accordingly.\n\nINPUTS\n- chunk_text: {{ $json.content }}\n- file metadata (for disambiguation only; DO NOT copy values if not present in the chunk):\n - doc_title: {{ $json.metadata.doc_title }}\n - doc_type: {{ $json.metadata.doc_type }}\n\nOUTPUT SCHEMA (exact keys; keep values short and consistent):\n{\n \"topics\": [\"keyword1\",\"keyword2\"], // up to 8\n \"feature\": \"short_tag\", // e.g., \"workspaces\", \"databases\", \"onboarding\", \"security\"\n \"use_case\": \"short_tag\", // e.g., \"workspace_structure\", \"communication\", \"setup\", \"policy\"\n \"audience\": \"beginner|intermediate|advanced|null\",\n \"section\": \"section_or_heading_if_any\",\n \"entities\": [\"product|role|team|concept\"], // proper names or domain terms\n \"key_recommendations\": [\"bullet1\",\"bullet2\"], // up to 5 concise, actionable bullets\n \"risks_or_pitfalls\": [\"risk1\",\"risk2\"], // up to 5; [] if none\n \"examples_present\": true, // whether the chunk includes an example\n \"language\": \"auto_detected_iso_639_1\", // e.g., \"en\", \"es\", \"pt\", \"it\"; infer from chunk_text\n \"chunk_summary\": \"1-2 sentence neutral summary\" // plain, factual, grounded in the chunk\n}\n\nGUIDELINES\n- Prefer concrete nouns/verbs over vague words.\n- Do not invent entities or recommendations; keep them grounded in the text.\n- If multiple candidates exist, choose the most central one (or null).\n- Deduplicate arrays; keep strings on a single line; no trailing punctuation in bullets.\n\nRETURN ONLY THE MINIFIED JSON, ONE LINE.\n"
}
]
}
},
"credentials": {
"googlePalmApi": {
"id": "qiYf0c3QAERXYWhH",
"name": "Google Gemini(PaLM) Api account"
}
},
"retryOnFail": true,
"typeVersion": 1,
"waitBetweenTries": 5000
},
{
"id": "507d8646-ef0b-442a-a887-496dcec2dbd2",
"name": "由 Github 模型提供支持",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-960,
1360
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"minutesInterval": 25
}
]
}
},
"typeVersion": 1.2
},
{
"id": "a61859c2-872f-4510-a43f-c8490a76b938",
"name": "编辑字段",
"type": "n8n-nodes-base.set",
"position": [
-256,
1360
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ea722112-aad6-419d-b187-f40044bf3b8a",
"name": "row_id",
"type": "number",
"value": "={{$json.id}}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "63388b99-9d84-41cf-b8c6-94186db049b2",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1040,
-384
],
"parameters": {
"color": 4,
"width": 1744,
"height": 800,
"content": "## RAG 聊天代理"
},
"typeVersion": 1
},
{
"id": "1689c6a8-ba5f-493b-b31b-718bf7ce2ada",
"name": "查询构建器",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"position": [
-512,
-32
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemma-3n-e2b-it",
"cachedResultName": "models/gemma-3n-e2b-it"
},
"options": {
"temperature": 0.1,
"maxOutputTokens": 128
},
"messages": {
"values": [
{
"content": "=You are a query builder for a document retrieval system (RAG). \nYour task: analyze the user’s question and output ONE SINGLE-LINE, MINIFIED JSON. No prose.\n\nOUTPUT SCHEMA (always valid JSON, one line):\n{\n \"keywords\": [\"k1\",\"k2\",\"k3\"], // up to 6 short terms from the question\n \"filters\": { // OPTIONAL filters; include only if clearly implied, domain specific - do not include\n }\n}\n\nRULES\n- Keep keywords concise; avoid stop-words or full sentences.\n- Only add filters if the intent is clear from the question.\n- If the user just greets or provides no query, return {\"keywords\":[]} with no filters.\n\n\nOUTPUT\n- Output ONLY valid JSON, minified, one single line.\n- Do NOT add ```json, code fences, or any text before/after.\n- Do NOT include newlines.\n\nINPUT\n{{ $json.chatInput }}\n\nNOTE\n- Domain-specific logic (e.g., mapping to product features, principles, policies) can be added here in future.\n"
}
]
}
},
"credentials": {
"googlePalmApi": {
"id": "qiYf0c3QAERXYWhH",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "dee30e44-bd9b-421f-b9d0-5365ca8813bf",
"name": "RAG Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-96,
-240
],
"parameters": {
"text": "={{ $('When chat message received').item.json.chatInput }}",
"options": {
"systemMessage": "=You are a friendly but objective RAG assistant. You may only answer using passages returned by the tool \"Supabase Vector Store\". \nIf in this turn you did not call the tool at least once, reply:\n\"I don't have enough evidence in the indexed documents to answer this.\"\n\nLANGUAGE\n- Always answer in the user's language. Detect automatically from the user message.\n\nRECOVERY QUERY\n- Use the JSON line produced by \"Query Builder\". If it contains multiple keywords or filters, pass them to the retrieval tool.\n- If the query is ambiguous, still retrieve with general keywords and let the reranker select the best contexts.\n\nANSWER RULES\n\"\n- Prefer 2–4 distinct passages. If only 1 is available, say evidence is limited. Always form a concrete answer with the passages, not lost sentences.\n- Do NOT import outside knowledge. If relevant passages are weak or missing, say so and suggest a clearer question.\n- If the user's message is just a greeting (e.g., \"hi\"), do NOT call tools. Respond with a short greeting and invite a question.\n\nOUTPUT STYLE\n- Concise, friendly but objective.\n- Add a section below with References, with the format\n \"Source: <doc_title> — <section>. Use a title for the section and bullets.\n- No hallucinations; everything must be grounded in retrieved text.\n\nFAILSAFE\n- If retrieval returns authors/topics unrelated to the user's intent, ignore them and state that no relevant evidence was found.\n"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "14f8779d-043a-4b3b-8f96-ff6a0f5c1026",
"name": "重新排序器",
"type": "@n8n/n8n-nodes-langchain.rerankerCohere",
"position": [
240,
192
],
"parameters": {
"topN": 8
},
"credentials": {
"cohereApi": {
"id": "nqvzqvHfJbmT7AS2",
"name": "CohereApi account"
}
},
"typeVersion": 1
},
{
"id": "024e08cb-30a6-4a1d-804c-f715b77ab220",
"name": "Google Gemini 2.0 Flash",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-160,
-16
],
"parameters": {
"options": {
"temperature": 0.2
},
"modelName": "models/gemini-2.0-flash"
},
"credentials": {
"googlePalmApi": {
"id": "qiYf0c3QAERXYWhH",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "af9307db-b459-4ce2-8dd6-c4207edfdc16",
"name": "Postgres 聊天记忆",
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"position": [
-32,
-16
],
"parameters": {},
"credentials": {
"postgres": {
"id": "DjwLcr6VNmIxcuo8",
"name": "Postgres account"
}
},
"typeVersion": 1.3
},
{
"id": "ddc2ba09-f1bf-40e3-a48a-1cb08962279d",
"name": "嵌入 Google Gemini",
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"position": [
112,
192
],
"parameters": {},
"credentials": {
"googlePalmApi": {
"id": "qiYf0c3QAERXYWhH",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "3fa897aa-3299-4198-9ed1-05808311e6dc",
"name": "Supabase 向量存储",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
112,
-16
],
"parameters": {
"mode": "retrieve-as-tool",
"topK": 48,
"options": {
"metadata": {
"metadataValues": [
{
"name": "doc_type",
"value": "={{ (() => { try { return (JSON.parse(($('Query Builder').item.json.content?.parts?.[0]?.text || '{}')).filters?.doc_type) } catch(e){ return undefined } })() }}"
},
{
"name": "feature",
"value": "={{ (() => { try { return (JSON.parse(($('Query Builder').item.json.content?.parts?.[0]?.text || '{}')).filters?.feature) } catch(e){ return undefined } })() }}"
},
{
"name": "use_case",
"value": "={{ (() => { try { return (JSON.parse(($('Query Builder').item.json.content?.parts?.[0]?.text || '{}')).filters?.use_case) } catch(e){ return undefined } })() }}"
},
{
"name": "topics",
"value": "={{ (() => { try { const t = JSON.parse(($('Query Builder').item.json.content?.parts?.[0]?.text || '{}')).filters?.topics; return Array.isArray(t) && t.length ? t : undefined } catch(e){ return undefined } })() }}"
},
{
"name": "entities",
"value": "={{ (() => { try { const t = JSON.parse(($('Query Builder').item.json.content?.parts?.[0]?.text || '{}')).filters?.entities; return Array.isArray(t) && t.length ? t : undefined } catch(e){ return undefined } })() }}"
}
]
}
},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
},
"useReranker": true,
"toolDescription": "=Semantic retrieval tool. Queries the \"documents\" table and returns passages with metadata.\n\nUsage by the agent:\n- Always use the JSON line produced by the Query Builder to form keywords and (optional) metadata filters.\n- If scope is \"multi_document\", allow results from multiple documents; otherwise bias to a single document if clearly implied.\nOutput: fragments with metadata.doc_title, section (if any), feature, use_case, topics, chunk_summary.\n"
},
"credentials": {
"supabaseApi": {
"id": "CJBJzRJNUpKL96fh",
"name": "Supabase - RAG-DB"
}
},
"typeVersion": 1.3
},
{
"id": "84305b9d-2042-4f61-8d87-0208675d2d58",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1424,
480
],
"parameters": {
"width": 272,
"height": 256,
"content": "## 🟩 文件摄取流水线"
},
"typeVersion": 1
},
{
"id": "2eb9bc0a-08dc-468e-88d4-fafb76dddbbb",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1408,
1152
],
"parameters": {
"width": 272,
"height": 256,
"content": "## 🟨 增强流水线(异步)"
},
"typeVersion": 1
},
{
"id": "a8e76143-cb9f-412e-96c3-e9f5cfbf4e17",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1408,
-384
],
"parameters": {
"width": 272,
"height": 288,
"content": "## 🟦 RAG 代理流水线"
},
"typeVersion": 1
},
{
"id": "315431cf-6b7f-43e9-ac3a-a3b2bd1280d7",
"cid": "Ikx1Y2FzIFBleXJpbiI",
"name": "便签26",
"type": "n8n-nodes-base.stickyNote",
"notes": "© 2025 Lucas Peyrin",
"creator": "Lucas Peyrin",
"position": [
-2672,
-48
],
"parameters": {
"color": 2,
"width": 832,
"height": 1568,
"content": "## 🧩 准备数据库(SQL)"
},
"typeVersion": 1
},
{
"id": "d9415450-8f09-4120-aacb-af623509c0aa",
"name": "## 1. 创建新的自定义 OpenAI 凭据",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2640,
512
],
"parameters": {
"color": 7,
"width": 768,
"height": 896,
"content": "-- 🧹 (可选)清理之前的表格以进行全新设置"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "5e6d500c-a7c9-4618-8eb1-9687146b726f",
"connections": {
"Wait": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "main",
"index": 0
}
]
]
},
"Reranker": {
"ai_reranker": [
[
{
"node": "Supabase Vector Store",
"type": "ai_reranker",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Metadata Obtention",
"type": "main",
"index": 0
}
]
]
},
"Update a row": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Get many rows": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Query Builder": {
"main": [
[
{
"node": "RAG Agent",
"type": "main",
"index": 0
}
]
]
},
"Set File Data": {
"main": [
[
{
"node": "Delete Old Doc Rows",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Get many rows",
"type": "main",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "Set File Data",
"type": "main",
"index": 0
}
]
]
},
"Metadata Obtention": {
"main": [
[
{
"node": "Update a row",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Extract from File",
"type": "main",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "ai_document",
"index": 0
}
]
]
},
"Delete Old Doc Rows": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Postgres Chat Memory": {
"ai_memory": [
[
{
"node": "RAG Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Supabase Vector Store": {
"ai_tool": [
[
{
"node": "RAG Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Google Gemini 2.0 Flash": {
"ai_languageModel": [
[
{
"node": "RAG Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Embeddings Google Gemini": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Embeddings Google Gemini1": {
"ai_embedding": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "ai_embedding",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Query Builder",
"type": "main",
"index": 0
}
]
]
},
"Insert into Supabase Vectorstore": {
"main": [
[]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - AI RAG 检索增强, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
创建自更新的RAG聊天机器人(Google Drive、Gemini和Supabase)
使用Google Drive、Gemini和Supabase创建自更新的RAG聊天机器人
Set
Code
Merge
+19
45 节点Anirudh Aeran
内容创作
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
使用 Google Drive 的 RAG 聊天机器人
使用OpenAI、Google Drive和Supabase构建RAG知识聊天机器人
Set
Supabase
Google Drive
+12
20 节点Babish Shrestha
杂项
上下文混合RAG AI文案
Google Drive到Supabase上下文向量数据库同步用于RAG应用
If
Set
Code
+25
76 节点Michael Taleb
AI RAG 检索增强
AIAutomationPro终极RAG聊天机器人v1 n8n市场模板
多语言Telegram RAG聊天机器人,集成监督AI和自动化Google Drive流程
If
Set
Wait
+29
128 节点Daniel Ng
客服机器人
🤖 使用 RAG、Gemini 和 Supabase 创建文档专家机器人
🤖 使用 RAG、Gemini 和 Supabase 创建文档专家机器人
Set
Html
Filter
+18
54 节点Lucas Peyrin
内部知识库
工作流信息
难度等级
高级
节点数量32
分类2
节点类型19
作者
Alejandro Scuncia
@ascunciaSupport & Services Leader exploring GenAI and automation. Currently leading a global support team while building and learning through real-world AI workflows — from smarter knowledge agents to complex integrations. Here to explore, share, and connect with the n8n community.
外部链接
在 n8n.io 查看 →
分享此工作流