8
n8n 中文网amn8n.com

使用Kimi-K2、Gemini嵌入和Qdrant构建文档RAG系统

高级

这是一个Document Extraction, AI RAG领域的自动化工作流,包含 35 个节点。主要使用 Set, SplitOut, Qdrant, HttpRequest, ManualTrigger 等节点。 使用Kimi-K2、Gemini嵌入和Qdrant构建文档RAG系统

前置要求
  • Qdrant 服务器连接信息
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ee0f84f3-c30c-4bdc-983a-fc2569b7d726",
      "name": "Kimi-K2 via Featherless.ai",
      "type": "n8n-nodes-featherless.featherless",
      "position": [
        624,
        0
      ],
      "parameters": {
        "model": "moonshotai/Kimi-K2-Instruct",
        "message": "=<document> \n{{\n$('Extract from File').first().json.text\n  .slice(\n    $itemIndex - 10  < 0 ? 0 : $itemIndex - 10,\n    $itemIndex + 5 > $('Extract from File').first().json.text.length - 1\n      ? $('Extract from File').first().json.text.length - 1\n      : $itemIndex + 5\n  )\n  .join('\\n')\n}} \n</document>\nHere is the chunk we want to situate within the whole document \n<chunk> \n{{ $json.text }}\n</chunk> \nPlease give a short succinct context, title and keywords to situate this chunk within the overall document for the purposes of improving search retrieval of the chunk. Answer only with the succinct context, title, keywords and nothing else.\nBe exhaustive with the keywords.",
        "temperature": 0.6,
        "system_prompt": "You are a helpful assistant.\nOutput using the following format\n```\nContext: ...\nTitle: ...\nKeywords: ...\n```",
        "additionalFields": {
          "max_tokens": "={{ 16384 - $parameter.system_prompt.length - $parameter.message.length }}"
        }
      },
      "credentials": {
        "featherlessApi": {
          "id": "68aDaxu2AYoxjKjG",
          "name": "Featherless account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a3827c3e-1d58-466e-b017-e37c93bc5906",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -480,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7bc49947-f4f4-44a5-9959-dedafe061a42",
      "name": "从文件提取",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        16,
        0
      ],
      "parameters": {
        "options": {
          "joinPages": false
        },
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "923063f7-d260-4940-a377-d48aaa97b36d",
      "name": "获取响应",
      "type": "n8n-nodes-base.set",
      "position": [
        848,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "19d13eb1-482a-4836-a529-f083422e6d64",
              "name": "summary",
              "type": "string",
              "value": "={{ $json.response\n    .match(/Context\\:[\\s]?([^\\n]+)/ig)?.[0]\n    .replace(/Context\\:[\\s]?/i, \"\")\n    .trim()\n}}\n{{ $json.response\n    .match(/Keywords\\:[\\s]?([^\\n]+)/ig)?.[0]\n    .replace(/Keywords\\:[\\s]?/i, \"\")\n    .trim()\n}}"
            },
            {
              "id": "541355a0-21f1-4cda-aa06-d3e0ec342e17",
              "name": "title",
              "type": "string",
              "value": "={{ $json.response\n    .match(/Title\\:[\\s]?([^\\n]+)/ig)?.[0]\n    .replace(/Title\\:[\\s]?/i, \"\")\n    .trim()\n}}"
            },
            {
              "id": "a7dfdd2e-75e0-4e16-be4a-08bdd183c313",
              "name": "chunk",
              "type": "string",
              "value": "={{ $('Split Pages').item.json.text }}"
            },
            {
              "id": "3b858044-8845-486b-a8ec-2b0f387124cd",
              "name": "pageNumber",
              "type": "string",
              "value": "={{ $itemIndex + 1 }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c764ac52-9398-4590-8faf-04d2e46d4af1",
      "name": "下载大型文档",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -176,
        0
      ],
      "parameters": {
        "url": "https://www.highwaycodeuk.co.uk/uploads/3/2/9/2/3292309/the_official_highway_code_-_10-04-2025_2.pdf",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "09111780-2d13-4a12-81a0-91a4d716fc91",
      "name": "分割页面",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        208,
        0
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "95ecabfb-c682-4862-b864-84825163a09b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -288
      ],
      "parameters": {
        "color": 7,
        "width": 688,
        "height": 512,
        "content": "## 1. 最适合大型文档"
      },
      "typeVersion": 1
    },
    {
      "id": "f3c8536e-a0f6-413e-8ca7-9bd909aea9be",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -288
      ],
      "parameters": {
        "color": 7,
        "width": 688,
        "height": 512,
        "content": "## 2. 使用Kimi-K2 via [Featherless.ai](https://featherless.ai/register?referrer=HJUUTA6M)获取无限令牌!"
      },
      "typeVersion": 1
    },
    {
      "id": "268e1a4f-80d6-4abd-9633-096b62db0599",
      "name": "使用Gemini Embeddings 001的检索向量",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1664,
        0
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-embedding-001:embedContent",
        "method": "POST",
        "options": {
          "batching": {
            "batch": {}
          }
        },
        "jsonBody": "={{\n{\n  \"model\": \"models/gemini-embedding-001\",\n  \"content\": {\n    \"parts\": [{ text: $json.summary }]\n  },\n  \"task_type\": \"RETRIEVAL_DOCUMENT\",\n  \"title\": $json.title,\n  \"output_dimensionality\": 768\n}\n}}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "googlePalmApi"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "dSxo6ns5wn658r8N",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.2
    },
    {
      "id": "58c81a7c-3f50-413a-b8a3-e38cb6415773",
      "name": "将文档添加到Qdrant向量存储",
      "type": "n8n-nodes-qdrant.qdrant",
      "position": [
        1856,
        96
      ],
      "parameters": {
        "points": "={{\n[{\n  \"id\": $('Get Response').item.json.pageNumber.toNumber(),\n  \"payload\": {\n    \"content\": $('Get Response').item.json.chunk,\n     \"metadata\": {\n      \"summary\": $('Get Response').item.json.summary,\n      \"pageNumber\": $('Get Response').item.json.pageNumber.toNumber(),\n      \"url\": $('Download Large Document').params.url\n    }\n  },\n  \"vector\": {\n    \"default\": $json.embedding.values\n  }\n}].toJsonString()\n}}",
        "resource": "point",
        "operation": "upsertPoints",
        "collectionName": {
          "__rl": true,
          "mode": "list",
          "value": "highwaycode",
          "cachedResultName": "highwaycode"
        },
        "requestOptions": {}
      },
      "credentials": {
        "qdrantRestApi": {
          "id": "Px8bPm0Qb8kjI7AA",
          "name": "localhost"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f26f69c8-2449-4449-9aa7-2f598a2b8753",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1296,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "080df5be-ad23-4dd4-b93e-2474a2cb2452",
      "name": "块引用",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1472,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "bdae9c94-5cd0-48d7-b065-0065f11ef33a",
      "name": "创建集合",
      "type": "n8n-nodes-qdrant.qdrant",
      "position": [
        1296,
        576
      ],
      "parameters": {
        "vectors": "{\n  \"default\": {\n    \"distance\": \"Cosine\",\n    \"size\": 768\n  }\n}",
        "operation": "createCollection",
        "shardNumber": {},
        "sparseVectors": "{\n  \"minicoil\": {\n    \"modifier\": \"idf\"\n  }\n}",
        "collectionName": "highwaycode",
        "requestOptions": {},
        "replicationFactor": {},
        "writeConsistencyFactor": {}
      },
      "credentials": {
        "qdrantRestApi": {
          "id": "Px8bPm0Qb8kjI7AA",
          "name": "localhost"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6e917de3-776f-44b7-ad8c-7df1fe5a4cc0",
      "name": "创建摘要索引",
      "type": "n8n-nodes-qdrant.qdrant",
      "position": [
        1520,
        576
      ],
      "parameters": {
        "resource": "payload",
        "fieldName": "metadata.summary",
        "operation": "createPayloadIndex",
        "fieldSchema": "{\n  \"type\": \"text\",\n  \"tokenizer\": \"word\",\n  \"min_token_len\": 2,\n  \"max_token_len\": 10,\n  \"lowercase\": true\n}",
        "collectionName": {
          "__rl": true,
          "mode": "list",
          "value": "highwaycode",
          "cachedResultName": "highwaycode"
        },
        "requestOptions": {}
      },
      "credentials": {
        "qdrantRestApi": {
          "id": "Px8bPm0Qb8kjI7AA",
          "name": "localhost"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f4d9893d-c781-466b-bd6e-bee783ec81e9",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        3072,
        -624
      ],
      "webhookId": "d85c70e3-b94c-4fc8-931b-fadb4528b199",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "940320a6-ddef-4629-ae9d-874ab71647c8",
      "name": "子工作流触发器",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        2288,
        -64
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "query"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "8882bbef-c8bb-496c-a60e-3e310f5ffb65",
      "name": "Google Gemini 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        3264,
        -512
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "dSxo6ns5wn658r8N",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c8e4954c-e375-4c7c-85d4-1e670e889ecf",
      "name": "公路法规手册1",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        3504,
        -512
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        },
        "description": "调用此工具查询公路法规手册。公路法规是包含英国所有道路使用者(包括行人、骑自行车者和驾驶员)的规则、法规和建议的综合指南",
        "workflowInputs": {
          "value": {
            "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('query', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b111f132-2da9-496b-a68e-177750bd4a26",
      "name": "公路法规手册",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        3344,
        480
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        },
        "description": "调用此工具查询公路法规手册。公路法规是包含英国所有道路使用者(包括行人、骑自行车者和驾驶员)的规则、法规和建议的综合指南",
        "workflowInputs": {
          "value": {
            "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('query', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d2a96906-d11c-415c-9025-2c313f4aee2c",
      "name": "公路法规MCP服务器",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        3072,
        304
      ],
      "webhookId": "639dd058-cfa6-4c67-84d2-aee52caf0e6b",
      "parameters": {
        "path": "639dd058-cfa6-4c67-84d2-aee52caf0e6b"
      },
      "typeVersion": 2
    },
    {
      "id": "e0338eec-5bfe-44ad-877a-9a46b5230c37",
      "name": "公路法规专家",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3280,
        -672
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are an expert advisor of the UK Highway Code.\nWhen answering a user's query, ensure you provide citation of the page, rule or relevant legislation of your answer.\nIf the answer cannot be found in the UK highway code, then inform the user as such."
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f1deda9b-3e28-42f8-98a0-66369d82a7d0",
      "name": "使用Gemini-Embeddings-001的检索向量",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2496,
        -64
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-embedding-001:embedContent",
        "method": "POST",
        "options": {
          "batching": {
            "batch": {}
          }
        },
        "jsonBody": "={{\n{\n  \"model\": \"models/gemini-embedding-001\",\n  \"content\": {\n    \"parts\": [{ text: $('Subworkflow Trigger').item.json.query }]\n  },\n  \"task_type\": \"RETRIEVAL_DOCUMENT\",\n  \"output_dimensionality\": 768\n}\n}}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "googlePalmApi"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "dSxo6ns5wn658r8N",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.2
    },
    {
      "id": "734f6d78-f6c4-4160-8997-d884a7660f30",
      "name": "测试问题",
      "type": "n8n-nodes-base.set",
      "position": [
        3072,
        -128
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={{\n{\n  \"question\": [\n    `You've just passed your first practical driving or riding test. What will you have to do if you get six penalty points on your licence in the next two years?\n1) Retake only your theory test\n2) Retake your theory and practical tests\n3) Retake only your practical test\n4) Reapply for your full licence immediately`,\n`What part of the car does the law require you to keep in good condition?\n1) The gearbox\n2) The transmission\n3) The door locks\n4) The seat belts`,\n`What's the main benefit of driving a four-wheel-drive vehicle?\n1) Improved grip on the road\n2) Lower fuel consumption\n3) Shorter stopping distances\n4) Improved passenger comfort`,\n`What colour are the reflective studs between a motorway and a slip road?\n1) Amber\n2) White\n3) Green\n4) Red`,\n`What should you do when you're passing loose sheep on the road?\n1) Briefly sound your horn\n2) Go very slowly\n3) Pass quickly but quietly\n4) Herd them to the side of the road`,\n`You're in a built-up area at night and the road is well lit. Why should you use dipped headlights?\n1) So that you can see further along the road\n2) So that you can go at a much faster speed\n3) So that you can switch to main beam quickly\n4) So that you can be easily seen by others`,\n`What should you do if the vehicle starts reversing off the driveway?\n1) Move to the opposite side of the road\n2) Drive through as you have priority\n3) Sound your horn and be prepared to stop\n4) Speed up and drive through quickly`,\n`How should you use anti-lock brakes when you need to stop in an emergency?\n1) Keep pumping the footbrake to prevent skidding\n2) Brake normally but grip the steering wheel tightly\n3) Brake promptly and firmly until you've stopped\n4) Apply the parking brake to reduce the stopping distance`,\n`Why should you allow extra room while overtaking a motorcyclist on a windy day?\n1) The rider may turn off suddenly to get out of the wind\n2) The rider may be blown in front of you\n3) The rider may stop suddenly\n4) The rider may be travelling faster than normal`\n  ]\n}\n}}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "400cf31e-1657-4833-bd4f-823998afd761",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        3248,
        -128
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "question"
      },
      "typeVersion": 1
    },
    {
      "id": "a9325e7f-da8c-4577-be50-939fd4ca4d08",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -288
      ],
      "parameters": {
        "color": 7,
        "width": 912,
        "height": 624,
        "content": "## 3. 使用Gemini-Embeddings-001进行文档检索嵌入"
      },
      "typeVersion": 1
    },
    {
      "id": "dedb0860-4f3f-4a2b-b1a5-c9eeaad4999b",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        368
      ],
      "parameters": {
        "color": 7,
        "width": 608,
        "height": 384,
        "content": "## 3.1 安装Qdrant社区节点"
      },
      "typeVersion": 1
    },
    {
      "id": "5eb12796-3353-48c8-9ea6-6bd5616e463d",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2192,
        -288
      ],
      "parameters": {
        "color": 7,
        "width": 720,
        "height": 432,
        "content": "## 4. 创建文档检索子工作流工具"
      },
      "typeVersion": 1
    },
    {
      "id": "1c7b7364-2866-4da1-9bb2-baefbe0a215b",
      "name": "从Qdrant向量存储查询文档",
      "type": "n8n-nodes-qdrant.qdrant",
      "position": [
        2704,
        -64
      ],
      "parameters": {
        "limit": 20,
        "query": "={{ $json.embedding.values.toJsonString() }}",
        "using": "default",
        "resource": "search",
        "operation": "queryPoints",
        "collectionName": {
          "__rl": true,
          "mode": "list",
          "value": "highwaycode",
          "cachedResultName": "highwaycode"
        },
        "requestOptions": {}
      },
      "credentials": {
        "qdrantRestApi": {
          "id": "Px8bPm0Qb8kjI7AA",
          "name": "localhost"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c50a153d-ccbd-403e-ac97-a44ed1d080c1",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2976,
        -832
      ],
      "parameters": {
        "color": 7,
        "width": 752,
        "height": 512,
        "content": "## 示例用法:公路法规问答代理"
      },
      "typeVersion": 1
    },
    {
      "id": "a1d62ebf-4882-430d-987b-29f1e7cffba4",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2976,
        -288
      ],
      "parameters": {
        "color": 7,
        "width": 896,
        "height": 432,
        "content": "## 示例用法:自动化英国驾驶理论考试答题器"
      },
      "typeVersion": 1
    },
    {
      "id": "68eaf415-0ceb-4a4e-9ab7-8540f7ca1822",
      "name": "调用公路法规手册工具",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        3440,
        -80
      ],
      "parameters": {
        "mode": "each",
        "options": {
          "waitForSubWorkflow": true
        },
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        },
        "workflowInputs": {
          "value": {
            "query": "={{ $json.question.split('\\n').first() }}"
          },
          "schema": [
            {
              "id": "query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "70e62b09-219d-436d-83a9-4fbb08a4ac33",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2976,
        176
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 464,
        "content": "## 示例用法:公路法规MCP服务器"
      },
      "typeVersion": 1
    },
    {
      "id": "860bdf7d-dcf5-45e9-b6ac-9df36a3c4b77",
      "name": "Kimi-K2 via Featherless ai",
      "type": "n8n-nodes-featherless.featherless",
      "position": [
        3632,
        -80
      ],
      "parameters": {
        "model": "moonshotai/Kimi-K2-Instruct",
        "message": "=## Question\n{{ $('Split Out').item.json.question }}\n\n## References\n{{\n$json.result.points\n  .filter(point => point.score > 0.75)\n  .map(point => point.payload.toJsonString()).join('\\n')\n}}",
        "temperature": 0.6,
        "system_prompt": "=You are taking a UK driving theory test which contains multiple choice questions. Select the correct or most appropriate answer and output your answer as a number indicating the choice from the available choices. Refer to the highway code manual as required.\nDo not explain your reasoning and return only the number indicating the selected choice.",
        "additionalFields": {
          "max_tokens": "={{ 16384 - $parameter.system_prompt.length - $parameter.message.length }}"
        }
      },
      "credentials": {
        "featherlessApi": {
          "id": "68aDaxu2AYoxjKjG",
          "name": "Featherless account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0878af92-e970-42f2-a6bc-a77bf68269aa",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -688
      ],
      "parameters": {
        "width": 528,
        "height": 1296,
        "content": "## 使用[Featherless.AI](https://featherless.ai/?referrer=HJUUTA6M)和Gemini-Embeddings-001实现更低成本的上下文检索RAG"
      },
      "typeVersion": 1
    },
    {
      "id": "8659639e-2a8f-49a2-8c67-23aa3552912b",
      "name": "### 替换 Airtable 连接",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        624
      ],
      "parameters": {
        "width": 528,
        "height": 304,
        "content": "![](https://cdn.subworkflow.ai/n8n-templates/banner_595x311.png#full-width)"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Chunk Ref": {
      "main": [
        [
          {
            "node": "Retrieval Vectors with Gemini Embeddings 001",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Call Highway Code Manual Tool",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Pages": {
      "main": [
        [
          {
            "node": "Kimi-K2 via Featherless.ai",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Response": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Test Questions": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Chunk Ref",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Collection": {
      "main": [
        [
          {
            "node": "Create Summary Index",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Split Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Highway Code Manual": {
      "ai_tool": [
        [
          {
            "node": "Highway Code MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Subworkflow Trigger": {
      "main": [
        [
          {
            "node": "Retrieval Vectors with Gemini-Embeddings-001",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Highway Code Manual1": {
      "ai_tool": [
        [
          {
            "node": "Highway Code Expert",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Download Large Document": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Highway Code Expert",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Kimi-K2 via Featherless.ai": {
      "main": [
        [
          {
            "node": "Get Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Highway Code Expert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Highway Code Manual Tool": {
      "main": [
        [
          {
            "node": "Kimi-K2 via Featherless ai",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Docs To Qdrant Vector Store": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Download Large Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieval Vectors with Gemini Embeddings 001": {
      "main": [
        [
          {
            "node": "Add Docs To Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieval Vectors with Gemini-Embeddings-001": {
      "main": [
        [
          {
            "node": "Query Docs from Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 文档提取, AI RAG 检索增强

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量35
分类2
节点类型17
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Jimleuk

Jimleuk

@jimleuk

Freelance AI Automation Engineer based in London, UK. Since 2024, my n8n templates have documented my journey into applied AI and have helped hundreds of businesses and organisations get up to speed with AI automation. Today, I continue to explore use-cases as AI evolves and occasionally upload templates which I find novel and interesting. Subscribe to the RSS Feed: https://cdn.subworkflow.ai/n8n-templates/rss.xml

外部链接
在 n8n.io 查看

分享此工作流