8
n8n 中文网amn8n.com

上下文混合RAG AI文案

高级

这是一个AI RAG, Multimodal AI领域的自动化工作流,包含 76 个节点。主要使用 If, Set, Code, Wait, Crypto 等节点。 Google Drive到Supabase上下文向量数据库同步用于RAG应用

前置要求
  • Supabase URL 和 API Key
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "XwFvFryyo4goPzpd",
  "meta": {
    "instanceId": "00761fd5aea81495387b0889e15912dcc912b73b7bf62f5ca3898afbd7a79723",
    "templateCredsSetupCompleted": true
  },
  "name": "上下文混合 RAG AI 文案",
  "tags": [
    {
      "id": "YINdrIOThMQjiVkB",
      "name": "RAG",
      "createdAt": "2025-06-18T21:07:48.174Z",
      "updatedAt": "2025-06-18T21:07:48.174Z"
    },
    {
      "id": "j0SNhalFSbPAhdWo",
      "name": "n8n creator",
      "createdAt": "2025-09-02T01:40:23.866Z",
      "updatedAt": "2025-09-02T01:40:23.866Z"
    }
  ],
  "nodes": [
    {
      "id": "c1422e6a-289f-4499-b19b-62df452010b2",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2544,
        -736
      ],
      "parameters": {
        "options": {
          "systemMessage": "Only generate answers based on the results from the connected database. Do no under any circumstance, get answers from anywhere else.\nfor every query check the database to see if you can find an answer. If you can not or are not sure, then say 'Sorry, I don’t know'. Never come up with answers. Only get answers from the database"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "efb0bd4c-0b6d-4b96-8e8d-d1b511174151",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -2784,
        -736
      ],
      "webhookId": "f4516070-1da1-41ad-8320-bd3a31cddf12",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "3c285b17-d4f0-4e8e-809b-38be2a5ede94",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -2544,
        -528
      ],
      "parameters": {
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "8a624394-5019-4a67-a31c-c56fad7b1406",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2704,
        -528
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "QsPyEUltWeliSiFb",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "317048f7-1423-4922-ac19-ad1b79152359",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -3536,
        304
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "KZY6CHPvoIbIxMKd",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "27074acb-2256-4b79-a093-df35755ca0e8",
      "name": "搜索记录管理器",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -2608,
        304
      ],
      "parameters": {
        "limit": 1,
        "filters": {
          "conditions": [
            {
              "keyName": "gd_file_id",
              "keyValue": "={{ $('Loop Over Items').item.json.id }}",
              "condition": "eq"
            }
          ]
        },
        "tableId": "record_managerhs",
        "operation": "getAll"
      },
      "credentials": {
        "supabaseApi": {
          "id": "bi5dJhIwrvuB6YQA",
          "name": "CHRAG"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "cc825e4c-1f68-4688-8e32-5d08b3aab1ac",
      "name": "在记录管理器中创建行",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1808,
        48
      ],
      "parameters": {
        "tableId": "record_managerhs",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "gd_file_id",
              "fieldValue": "={{ $('Loop Over Items').item.json.id }}"
            },
            {
              "fieldId": "hash",
              "fieldValue": "={{ $('Generate Hash').item.json.hash }}"
            }
          ]
        }
      },
      "credentials": {
        "supabaseApi": {
          "id": "bi5dJhIwrvuB6YQA",
          "name": "CHRAG"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "39445058-69b3-4bf1-8236-99a4a55e7d86",
      "name": "Google Calendar MCP",
      "type": "n8n-nodes-base.switch",
      "position": [
        -2416,
        288
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "does not exist",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "231bfd13-5f93-4801-b0f5-9ff2d949c165",
                    "operator": {
                      "type": "object",
                      "operation": "empty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "modified",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b311878c-297f-4d5b-ba2f-f1babb9c9f7b",
                    "operator": {
                      "type": "string",
                      "operation": "notEquals"
                    },
                    "leftValue": "={{ $json.hash }}",
                    "rightValue": "={{ $('Generate Hash').item.json.hash }}"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "exist",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "dc26f05e-859a-40a4-b0e3-49abc55397a5",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Generate Hash').item.json.hash }}",
                    "rightValue": "={{ $json.hash }}"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {},
        "looseTypeValidation": true
      },
      "typeVersion": 3.2
    },
    {
      "id": "10062467-974d-4103-aeb3-bff32d0c6e3f",
      "name": "删除先前向量",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -2016,
        368
      ],
      "parameters": {
        "tableId": "documentshs",
        "operation": "delete",
        "filterType": "string",
        "filterString": "=metadata->>file_id=eq.{{ $('Loop Over Items').item.json.id }}"
      },
      "credentials": {
        "supabaseApi": {
          "id": "GZCrvWKfz1aQNVve",
          "name": "Supabase - RAG"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "e145b247-04d6-40f9-b3ab-7ad034aa0a31",
      "name": "生成哈希",
      "type": "n8n-nodes-base.crypto",
      "position": [
        -2848,
        304
      ],
      "parameters": {
        "type": "SHA256",
        "value": "={{ $json.text }}",
        "dataPropertyName": "hash"
      },
      "typeVersion": 1
    },
    {
      "id": "40aa27bb-4577-4d2d-abc4-0ed103fc0cbd",
      "name": "更新记录管理器",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1600,
        368
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "id",
              "keyValue": "={{ $('Search Record Manager').item.json.id }}",
              "condition": "eq"
            }
          ]
        },
        "tableId": "record_managerhs",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "hash",
              "fieldValue": "={{ $('Generate Hash').item.json.hash }}"
            }
          ]
        },
        "operation": "update"
      },
      "credentials": {
        "supabaseApi": {
          "id": "GZCrvWKfz1aQNVve",
          "name": "Supabase - RAG"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f0c2dcd5-5fe8-4968-a510-0f7d997d3b2f",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1824,
        368
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "56bc70d8-aba3-4534-be6b-05cce089505a",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1248,
        272
      ],
      "parameters": {
        "text": "=# File Name\n{{ $('Loop Over Items').item.json.name}}\n\n# File Content\n{{ $('Set Text').item.json.text.split(/\\s+/).length > 500\n? $('Set Text').item.json.text.split(/\\s+/).slice(0, 500).join(' ') + '...'\n: $('Set Text').item.json.text}}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=Based on the provided file name and file contents, extract out a 1 sentence description of what the document is about and classify the document based on motorsport category. \n\n Only output JSON in the following format \n\n{ \n\"document_summary\": \"document summary\"\n}\n\nIf you are unsure, just output N/A in the field. \n\n"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "c99060a8-fe04-44c8-86ad-76ad9c0f2f6c",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1072,
        432
      ],
      "parameters": {
        "jsonSchemaExample": "{ \n\"documentSummary\": \"document summary\"\n} "
      },
      "typeVersion": 1.3
    },
    {
      "id": "478f6320-0c37-478c-8321-8083e5d903fe",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1264,
        432
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {
          "responseFormat": "json_object"
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "QsPyEUltWeliSiFb",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3e9028df-ff29-4599-9ae9-c08a3811f047",
      "name": "从文件提取",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -3344,
        304
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "df98c1e9-b29c-4558-bbe4-a8925fd5a2f1",
      "name": "设置文本",
      "type": "n8n-nodes-base.set",
      "position": [
        -3104,
        304
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "766bf659-155f-4d60-a033-085b3a752933",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "258005cc-104e-4e31-96f0-a3fae138da93",
      "name": "## 如何实施此 n8n 工作流",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -2224,
        976
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "84ac45bc-27c8-4fce-8e03-be8c9cf18fe8",
      "name": "搜索记录管理器1",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1936,
        976
      ],
      "parameters": {
        "limit": 1,
        "filters": {
          "conditions": [
            {
              "keyName": "gd_file_id",
              "keyValue": "={{ $('Loop Over Items1').item.json.id }}",
              "condition": "eq"
            }
          ]
        },
        "tableId": "record_managerhs",
        "operation": "getAll"
      },
      "credentials": {
        "supabaseApi": {
          "id": "bi5dJhIwrvuB6YQA",
          "name": "CHRAG"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "81fc8e77-f1fb-4914-87b7-489bdcdf3f9d",
      "name": "如果 1",
      "type": "n8n-nodes-base.if",
      "position": [
        -1728,
        976
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "21ca0db4-5ca4-49e8-86c1-9e09c469122d",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{$json}}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9561c9dd-0b82-4cdb-bed0-a3307d206394",
      "name": "删除先前向量1",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1472,
        976
      ],
      "parameters": {
        "tableId": "documentshs",
        "operation": "delete",
        "filterType": "string",
        "filterString": "=metadata->>file_id=eq.{{ $('Loop Over Items1').item.json.id }}"
      },
      "credentials": {
        "supabaseApi": {
          "id": "bi5dJhIwrvuB6YQA",
          "name": "CHRAG"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "31cc03e7-50db-4c6d-b266-136225457218",
      "name": "聚合 1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1280,
        976
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "0c76dd9b-be10-4fdd-8536-ea3eb75a6cba",
      "name": "从记录管理器1删除记录",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1072,
        976
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "id",
              "keyValue": "={{ $('Search Record Manager1').item.json.id }}",
              "condition": "eq"
            }
          ]
        },
        "tableId": "record_managerhs",
        "operation": "delete"
      },
      "credentials": {
        "supabaseApi": {
          "id": "bi5dJhIwrvuB6YQA",
          "name": "CHRAG"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c41851a0-ba52-432d-ae00-752bb630cead",
      "name": "Google Drive2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -848,
        976
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Loop Over Items1').item.json.id }}"
        },
        "options": {},
        "operation": "deleteFile"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "KZY6CHPvoIbIxMKd",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "03516980-317e-483d-9471-6cf9e3148415",
      "name": "监控 GD 回收站",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -2432,
        976
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1gwf7pIH8X5wU-i0YMw-j7qPSA4MnA40L",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1gwf7pIH8X5wU-i0YMw-j7qPSA4MnA40L",
          "cachedResultName": "Trash"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "KZY6CHPvoIbIxMKd",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a791c6a2-1311-40cc-837e-c875425774cc",
      "name": "监控 GD RAG 文件",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -3984,
        304
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1e1Af14X5nlPq6oVEqbHs4h7pQtYktzAM",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1e1Af14X5nlPq6oVEqbHs4h7pQtYktzAM",
          "cachedResultName": "RAG Files"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "KZY6CHPvoIbIxMKd",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3024e04e-86c4-43d6-819d-22f45ef40750",
      "name": "当被其他工作流执行时",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -2016,
        -544
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "query"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "5da16ea7-5c2c-4326-8069-7228ea20041f",
      "name": "查询向量存储",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -2272,
        -512
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "XwFvFryyo4goPzpd",
          "cachedResultName": "Contextual Hybrid RAG AI copy"
        },
        "description": "调用此工具从我们的向量数据库获取知识",
        "workflowInputs": {
          "value": {
            "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('query', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "query",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "467f3d3b-8727-413b-aa8d-7547ac7d8a68",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -3776,
        304
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "7d2d4e71-ce5f-4e08-a5fb-2ca01d17e6a6",
      "name": "设置用于分块的文本",
      "type": "n8n-nodes-base.set",
      "position": [
        -864,
        272
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "5fb33f33-8d7f-467e-ab8b-784c411b63b2",
              "name": "content",
              "type": "string",
              "value": "={{ $('Set Text').item.json.text }}"
            },
            {
              "id": "d0fdcb3c-915f-4e39-93de-ac8244415be5",
              "name": "documentSummary",
              "type": "string",
              "value": "={{ $json.output.document_summary }}"
            },
            {
              "id": "5ffe4726-56f1-4478-9f89-ba862efce940",
              "name": "file_id",
              "type": "string",
              "value": "={{ $('Loop Over Items').item.json.id }}"
            },
            {
              "id": "df951786-5196-4590-9e32-fed42ef35200",
              "name": "fileName",
              "type": "string",
              "value": "={{ $('Loop Over Items').item.json.name }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9a68682b-7a2f-40ca-91a9-e0d935ec7ed3",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4016,
        144
      ],
      "parameters": {
        "width": 160,
        "height": 304,
        "content": "### 监控 GD 文件夹"
      },
      "typeVersion": 1
    },
    {
      "id": "22acc35b-1370-450f-90f2-ff4a2c9f61e4",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3136,
        144
      ],
      "parameters": {
        "width": 160,
        "height": 300,
        "content": "### 设置文本"
      },
      "typeVersion": 1
    },
    {
      "id": "cb0d4e98-3716-4bba-8f33-a1c0ee5224a7",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2896,
        144
      ],
      "parameters": {
        "width": 172,
        "height": 308,
        "content": "### 基于文本生成哈希。如果文本改变,我们将得到不同的哈希"
      },
      "typeVersion": 1
    },
    {
      "id": "6f0493ae-8973-48c8-9338-f62d1b826445",
      "name": "## 为什么选择 4o 模型?👆",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2656,
        144
      ],
      "parameters": {
        "width": 188,
        "height": 308,
        "content": "### 搜索记录管理器,查看数据库中是否有任何文件具有相同的文件 ID。如果有,它将返回哈希值"
      },
      "typeVersion": 1
    },
    {
      "id": "6336a34a-fade-435c-b0a7-5257b48c5579",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2432,
        112
      ],
      "parameters": {
        "width": 180,
        "height": 340,
        "content": "### 比较生成的哈希和(如果存在)记录管理器搜索中的哈希,以确定文件是否存在或是否被修改"
      },
      "typeVersion": 1
    },
    {
      "id": "be85f58e-3cff-42f7-b1ff-d1f22c781961",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        256
      ],
      "parameters": {
        "width": 640,
        "height": 280,
        "content": "### 如果文档被修改,我们删除与该 Google ID 相关的所有向量,并更新记录管理器 ID 和哈希"
      },
      "typeVersion": 1
    },
    {
      "id": "79ee3377-d001-4bd7-8d25-c48e5676aff7",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        176
      ],
      "parameters": {
        "width": 380,
        "height": 220,
        "content": "### 为元数据创建文档摘要"
      },
      "typeVersion": 1
    },
    {
      "id": "2943dad5-ae6b-4fde-a293-eb8e319bc41b",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        176
      ],
      "parameters": {
        "width": 160,
        "height": 224,
        "content": "### 设置要发送到子工作流的文本"
      },
      "typeVersion": 1
    },
    {
      "id": "6109b822-9860-4a85-860b-15dd4494bac7",
      "name": "便签 14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2464,
        864
      ],
      "parameters": {
        "width": 156,
        "height": 280,
        "content": "### 监控 GD 回收站文件夹"
      },
      "typeVersion": 1
    },
    {
      "id": "4522d72b-9a92-4614-a2c8-f6a739d2169d",
      "name": "便签 15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1984,
        864
      ],
      "parameters": {
        "width": 192,
        "height": 264,
        "content": "### 根据相应的 GD 文件 ID 搜索记录管理器"
      },
      "typeVersion": 1
    },
    {
      "id": "c57592c9-e02e-4861-a1e3-189f3b24f7cf",
      "name": "便签16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        864
      ],
      "parameters": {
        "width": 160,
        "height": 264,
        "content": "### 检查此 ID 是否存在记录"
      },
      "typeVersion": 1
    },
    {
      "id": "9af264c1-de52-4fd7-9366-7d573499b02a",
      "name": "便签17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        864
      ],
      "parameters": {
        "width": 580,
        "height": 264,
        "content": "### 从 supabase 删除记录"
      },
      "typeVersion": 1
    },
    {
      "id": "0403746d-e354-4d88-93d4-a05f9faa4aea",
      "name": "便签18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        864
      ],
      "parameters": {
        "width": 150,
        "height": 264,
        "content": "### 从 GD 删除文件"
      },
      "typeVersion": 1
    },
    {
      "id": "d48e00db-570d-41b5-a5db-4435059fe3ec",
      "name": "便签19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2304,
        -624
      ],
      "parameters": {
        "width": 1020,
        "height": 240,
        "content": "## 使用工作流查询搜索 Supabase 数据库工具"
      },
      "typeVersion": 1
    },
    {
      "id": "1af9acb3-e6a8-435d-9d91-cb84c5fd608b",
      "name": "便签20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        192
      ],
      "parameters": {
        "width": 150,
        "height": 248,
        "content": "### 设置数据"
      },
      "typeVersion": 1
    },
    {
      "id": "936e7ead-1a8c-4337-b784-5732ef2784ac",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -6000,
        -16
      ],
      "parameters": {
        "width": 752,
        "height": 800,
        "content": "## 设置 Supabase"
      },
      "typeVersion": 1
    },
    {
      "id": "76cf1951-f712-4d05-ab00-c5201a4bdf15",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -7456,
        -784
      ],
      "parameters": {
        "width": 656,
        "height": 2416,
        "content": "# documentHS"
      },
      "typeVersion": 1
    },
    {
      "id": "ae127c8a-15e8-485a-913b-932e7a3f0f15",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -6784,
        -784
      ],
      "parameters": {
        "width": 592,
        "height": 224,
        "content": "# record_managerHS 代码"
      },
      "typeVersion": 1
    },
    {
      "id": "4e8a1b14-2fd5-4dfc-89f4-73898134d384",
      "name": "边缘函数",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1552,
        -544
      ],
      "parameters": {
        "url": "Your Edge Function URL Here",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={\n    \"query_text\":       \"{{ $('When Executed by Another Workflow').item.json.query }}\",\n    \"query_embedding\":  [{{ $json.data[0].embedding }}],\n    \"match_count\":      5, \n    \"full_text_weight\": 1.0,\n    \"semantic_weight\": 1.0,\n    \"rrf_k\":            50\n  } ",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "T59KJDlDMiYYary2",
          "name": "Supabase CHRAG"
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "cf18ef2b-6044-4526-9f0f-b1ec4d7a547d",
      "name": "调用我的子工作流",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -656,
        336
      ],
      "parameters": {
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "OB2T8YYdXtHcujuT",
          "cachedResultName": "My Sub-workflow"
        },
        "workflowInputs": {
          "value": {
            "content": "={{ $json.content }}",
            "file_id": "={{ $json.file_id }}",
            "fileName": "={{ $json.fileName }}",
            "documentSummary": "={{ $json.documentSummary }}"
          },
          "schema": [
            {
              "id": "content",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "documentSummary",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "documentSummary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "file_id",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "file_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "fileName",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "fileName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "content",
            "documentSummary",
            "file_id",
            "fileName"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "61e693a0-bebc-4f32-8531-67110fc08e38",
      "name": "Supabase 向量存储1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        1440,
        336
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "documentshs",
          "cachedResultName": "documentshs"
        }
      },
      "credentials": {
        "supabaseApi": {
          "id": "GZCrvWKfz1aQNVve",
          "name": "Supabase - RAG"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "7588feea-e4d2-4a67-91a8-2a35d4439293",
      "name": "嵌入 OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1440,
        512
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "QsPyEUltWeliSiFb",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "db23a77d-2805-421d-a3c0-43de5a78e0a5",
      "name": "默认数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1568,
        528
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "file_id",
                "value": "={{ $('Metadata').item.json.file_id }}"
              },
              {
                "name": "motorsport_category",
                "value": "={{ $('Metadata').item.json.motorsportCategory }}"
              },
              {
                "name": "file_name",
                "value": "={{ $('Metadata').item.json.fileName }}"
              },
              {
                "name": "file_summary",
                "value": "={{ $('Metadata').item.json.documentSummary }}"
              }
            ]
          }
        },
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "fa1ce78e-ef3c-45e9-9b89-b6afa3e3a119",
      "name": "递归字符文本分割器",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1536,
        656
      ],
      "parameters": {
        "options": {},
        "chunkSize": 1400
      },
      "typeVersion": 1
    },
    {
      "id": "c4771f8f-dabe-4815-8fe2-d862234cbec7",
      "name": "递归分割器2",
      "type": "n8n-nodes-base.code",
      "position": [
        -80,
        336
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const chunkSize = 1000;\nconst chunkOverlap = 200;\nconst text = $input.item.json.content.replace(/\\n/, '');\n\nconst chunks = [];\nlet remainingText = text;\n\nwhile (remainingText.length > 0) {\n    let splitPoint;\n\n    // Try splitting at paragraph level first\n    splitPoint = remainingText.lastIndexOf(\"\\n\\n\", chunkSize);\n    \n    // If no paragraph split, try splitting at sentence level\n    if (splitPoint === -1) {\n        splitPoint = remainingText.lastIndexOf(\". \", chunkSize);\n    }\n\n    // If no sentence split, try splitting at word level\n    if (splitPoint === -1) {\n        splitPoint = remainingText.lastIndexOf(\" \", chunkSize);\n    }\n\n    // If still no split point, force cut at chunkSize\n    if (splitPoint === -1 || splitPoint < chunkSize * 0.5) {  \n        splitPoint = chunkSize; // Hard split if no good split point\n    }\n\n    // Extract chunk and adjust remaining text with overlap\n    let chunk = remainingText.substring(0, splitPoint).trim();\n    chunks.push(chunk);\n\n    // Move the pointer forward while keeping the overlap\n    remainingText = remainingText.substring(Math.max(0, splitPoint - chunkOverlap)).trim();\n\n    // Break if remaining text is too small to form another chunk\n    if (remainingText.length < chunkSize * 0.2) {\n        chunks.push(remainingText);\n        break;\n    }\n}\n\nreturn { chunks };"
      },
      "typeVersion": 2
    },
    {
      "id": "0969dc28-0e90-47ad-9dde-b4425978a6eb",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        128,
        336
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "chunks"
      },
      "typeVersion": 1
    },
    {
      "id": "b279aabb-d27f-44d4-9290-e0bf9abca567",
      "name": "设置用于嵌入的块",
      "type": "n8n-nodes-base.set",
      "position": [
        912,
        336
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "caed5bb3-bd1e-475f-94ad-db0b73cdedf0",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }} \n"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2f58e5f1-afe1-4e34-8cf1-e02f932a2e99",
      "name": "元数据",
      "type": "n8n-nodes-base.set",
      "position": [
        -288,
        336
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "93527bdc-6f91-4942-b5da-d7d5f1a67f9d",
              "name": "content",
              "type": "string",
              "value": "={{ $json.content }}"
            },
            {
              "id": "15ac4402-e7a1-40fc-a45d-bafd8302358a",
              "name": "documentSummary",
              "type": "string",
              "value": "={{ $json.documentSummary }}"
            },
            {
              "id": "79781e9e-8d64-4ebb-b96a-5d9954e62939",
              "name": "motorsportCategory",
              "type": "string",
              "value": "={{ $json.motorsportCategory }}"
            },
            {
              "id": "ca42a5a1-d11b-4a1e-a9f1-b696d31b4251",
              "name": "file_id",
              "type": "string",
              "value": "={{ $json.file_id }}"
            },
            {
              "id": "97242570-a638-454d-8d5e-62a1eb6c8376",
              "name": "fileName",
              "type": "string",
              "value": "={{ $json.fileName }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "02d36503-b3ad-451b-8f90-9ee50d9e3c53",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        1104,
        336
      ],
      "webhookId": "9ddc5ae1-c2d9-4031-aa38-dafc7cdda091",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "f0e1c571-d615-4942-a9cc-2529aa401cef",
      "name": "添加上下文",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        576,
        336
      ],
      "parameters": {
        "text": "=<document> \n{{ $('Metadata').item.json.content}}\n</document> \n\nHere is the chunk we want to situate within the overall document:\n\n<chunk> \n{{ $('Loop Over Items2').item.json.chunks }}\n</chunk> \n\nPlease:\n- Provide a short and succinct **context** to situate this chunk within the document for improved search retrieval.\n- Return the **original chunk** exactly as provided unless a correction is necessary.\n- If the chunk contains an **incomplete number, percentage, or entity**, correct it using the full document.\n- If part of a **sentence is cut off**, reconstruct the missing words only if necessary for clarity.\n- If the chunk is part of a table, include the complete table entry to maintain data integrity\n- Do not add any additional explanations or formatting beyond the required output.\n\nFill in the following format:\n[succinct context] : [original chunk or corrected version if necessary]\n\nYour response should contain only the text that replaces these placeholders, without including the placeholder labels themselves.",
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "9153a959-d4a9-4392-a072-8db62ecd4008",
      "name": "OpenAI 聊天模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        576,
        544
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "gpt-4.1-nano"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "QsPyEUltWeliSiFb",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "25cb00db-559f-4eb0-baf6-3118fc6c6bf0",
      "name": "循环处理项目2",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        352,
        336
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "756c06ae-1b66-44a0-b4a6-076856cf01b5",
      "name": "聚合2",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        544,
        80
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {}
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1b2f5f20-f2f3-49c4-900a-d63d297b3fc2",
      "name": "便签说明5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        224
      ],
      "parameters": {
        "width": 176,
        "height": 280,
        "content": "### 设置数据"
      },
      "typeVersion": 1
    },
    {
      "id": "a321d862-fcb5-4895-bb44-2f1d038c4614",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        224
      ],
      "parameters": {
        "width": 356,
        "height": 280,
        "content": "### 根据块大小将文档分块成多个块"
      },
      "typeVersion": 1
    },
    {
      "id": "dfb50197-9be2-4189-ab3c-0f11de6b62c1",
      "name": "便签21",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        224
      ],
      "parameters": {
        "width": 264,
        "height": 280,
        "content": "### 为每个块添加上下文"
      },
      "typeVersion": 1
    },
    {
      "id": "48bbb8a8-56de-4e68-acf2-beb25a583145",
      "name": "便签22",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        224
      ],
      "parameters": {
        "width": 420,
        "height": 284,
        "content": "### 设置文本块并添加计时器,以免达到创建限制"
      },
      "typeVersion": 1
    },
    {
      "id": "044811b8-f03e-4954-a6b0-1522030aa109",
      "name": "便签23",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        224
      ],
      "parameters": {
        "width": 472,
        "height": 576,
        "content": "### 更新插入到向量数据库中。"
      },
      "typeVersion": 1
    },
    {
      "id": "57986be6-d5b8-47d8-8e14-f9be28282e59",
      "name": "便签24",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        64
      ],
      "parameters": {
        "color": 3,
        "width": 2192,
        "height": 752,
        "content": "# 这是调用我的子工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "f28c07f0-e1d7-482f-bacc-bd2bc3ba011b",
      "name": "便签说明4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -6000,
        -784
      ],
      "parameters": {
        "width": 752,
        "height": 752,
        "content": "# 工作流摘要"
      },
      "typeVersion": 1
    },
    {
      "id": "7c719413-7945-4e8e-9db2-02c6f3ee49c2",
      "name": "便签26",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3808,
        144
      ],
      "parameters": {
        "width": 150,
        "height": 304,
        "content": "### Loop over each item, as more than 1 file can be placed in the Google Drive"
      },
      "typeVersion": 1
    },
    {
      "id": "f5d30b0f-d7cc-4574-9939-9a53e7b02d12",
      "name": "便签28",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3568,
        144
      ],
      "parameters": {
        "width": 160,
        "height": 304,
        "content": "### Download file"
      },
      "typeVersion": 1
    },
    {
      "id": "f9c3a219-dbf0-470a-a54a-2c5775da45c4",
      "name": "便签29",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3376,
        144
      ],
      "parameters": {
        "width": 160,
        "height": 304,
        "content": "### Extract text from pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "aced0ee1-a1d5-40fd-b866-c2640136802e",
      "name": "便签30",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1840,
        -96
      ],
      "parameters": {
        "width": 176,
        "height": 304,
        "content": "### Create new record in record manager since file is new and doesn't exist in database"
      },
      "typeVersion": 1
    },
    {
      "id": "ae132431-fb89-45b5-9849-96812a46dcfd",
      "name": "便签25",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2592,
        -832
      ],
      "parameters": {
        "width": 336,
        "height": 208,
        "content": "## AI Agent to communicate with the database"
      },
      "typeVersion": 1
    },
    {
      "id": "c8d17104-e110-453d-97ca-e8e79bf589c1",
      "name": "Embedding",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1792,
        -544
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/embeddings",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "input",
              "value": "={{ $json.query }}"
            },
            {
              "name": "model",
              "value": "text-embedding-3-small"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "IZ2NWEGrJPwf73xf",
          "name": "Openai"
        }
      },
      "typeVersion": 4.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "60d22f47-01bc-4326-b282-0d742ef48480",
  "connections": {
    "81fc8e77-f1fb-4914-87b7-489bdcdf3f9d": {
      "main": [
        [
          {
            "node": "9561c9dd-0b82-4cdb-bed0-a3307d206394",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "02d36503-b3ad-451b-8f90-9ee50d9e3c53": {
      "main": [
        [
          {
            "node": "61e693a0-bebc-4f32-8531-67110fc08e38",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "39445058-69b3-4bf1-8236-99a4a55e7d86": {
      "main": [
        [
          {
            "node": "cc825e4c-1f68-4688-8e32-5d08b3aab1ac",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "10062467-974d-4103-aeb3-bff32d0c6e3f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "467f3d3b-8727-413b-aa8d-7547ac7d8a68",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2f58e5f1-afe1-4e34-8cf1-e02f932a2e99": {
      "main": [
        [
          {
            "node": "c4771f8f-dabe-4815-8fe2-d862234cbec7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "df98c1e9-b29c-4558-bbe4-a8925fd5a2f1": {
      "main": [
        [
          {
            "node": "e145b247-04d6-40f9-b3ab-7ad034aa0a31",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f0c2dcd5-5fe8-4968-a510-0f7d997d3b2f": {
      "main": [
        [
          {
            "node": "40aa27bb-4577-4d2d-abc4-0ed103fc0cbd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c8d17104-e110-453d-97ca-e8e79bf589c1": {
      "main": [
        [
          {
            "node": "4e8a1b14-2fd5-4dfc-89f4-73898134d384",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0969dc28-0e90-47ad-9dde-b4425978a6eb": {
      "main": [
        [
          {
            "node": "25cb00db-559f-4eb0-baf6-3118fc6c6bf0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "31cc03e7-50db-4c6d-b266-136225457218": {
      "main": [
        [
          {
            "node": "0c76dd9b-be10-4fdd-8536-ea3eb75a6cba",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f0e1c571-d615-4942-a9cc-2529aa401cef": {
      "main": [
        [
          {
            "node": "b279aabb-d27f-44d4-9290-e0bf9abca567",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "317048f7-1423-4922-ac19-ad1b79152359": {
      "main": [
        [
          {
            "node": "3e9028df-ff29-4599-9ae9-c08a3811f047",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e145b247-04d6-40f9-b3ab-7ad034aa0a31": {
      "main": [
        [
          {
            "node": "27074acb-2256-4b79-a093-df35755ca0e8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c41851a0-ba52-432d-ae00-752bb630cead": {
      "main": [
        [
          {
            "node": "258005cc-104e-4e31-96f0-a3fae138da93",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3c285b17-d4f0-4e8e-809b-38be2a5ede94": {
      "ai_memory": [
        [
          {
            "node": "c1422e6a-289f-4499-b19b-62df452010b2",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "03516980-317e-483d-9471-6cf9e3148415": {
      "main": [
        [
          {
            "node": "258005cc-104e-4e31-96f0-a3fae138da93",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "56bc70d8-aba3-4534-be6b-05cce089505a": {
      "main": [
        [
          {
            "node": "7d2d4e71-ce5f-4e08-a5fb-2ca01d17e6a6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "467f3d3b-8727-413b-aa8d-7547ac7d8a68": {
      "main": [
        [],
        [
          {
            "node": "317048f7-1423-4922-ac19-ad1b79152359",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "258005cc-104e-4e31-96f0-a3fae138da93": {
      "main": [
        [],
        [
          {
            "node": "84ac45bc-27c8-4fce-8e03-be8c9cf18fe8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "25cb00db-559f-4eb0-baf6-3118fc6c6bf0": {
      "main": [
        [
          {
            "node": "756c06ae-1b66-44a0-b4a6-076856cf01b5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "f0e1c571-d615-4942-a9cc-2529aa401cef",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3e9028df-ff29-4599-9ae9-c08a3811f047": {
      "main": [
        [
          {
            "node": "df98c1e9-b29c-4558-bbe4-a8925fd5a2f1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8a624394-5019-4a67-a31c-c56fad7b1406": {
      "ai_languageModel": [
        [
          {
            "node": "c1422e6a-289f-4499-b19b-62df452010b2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "7588feea-e4d2-4a67-91a8-2a35d4439293": {
      "ai_embedding": [
        [
          {
            "node": "61e693a0-bebc-4f32-8531-67110fc08e38",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "478f6320-0c37-478c-8321-8083e5d903fe": {
      "ai_languageModel": [
        [
          {
            "node": "56bc70d8-aba3-4534-be6b-05cce089505a",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "9153a959-d4a9-4392-a072-8db62ecd4008": {
      "ai_languageModel": [
        [
          {
            "node": "f0e1c571-d615-4942-a9cc-2529aa401cef",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "5da16ea7-5c2c-4326-8069-7228ea20041f": {
      "ai_tool": [
        [
          {
            "node": "c1422e6a-289f-4499-b19b-62df452010b2",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "a791c6a2-1311-40cc-837e-c875425774cc": {
      "main": [
        [
          {
            "node": "467f3d3b-8727-413b-aa8d-7547ac7d8a68",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "db23a77d-2805-421d-a3c0-43de5a78e0a5": {
      "ai_document": [
        [
          {
            "node": "61e693a0-bebc-4f32-8531-67110fc08e38",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "c4771f8f-dabe-4815-8fe2-d862234cbec7": {
      "main": [
        [
          {
            "node": "0969dc28-0e90-47ad-9dde-b4425978a6eb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cf18ef2b-6044-4526-9f0f-b1ec4d7a547d": {
      "main": [
        [
          {
            "node": "467f3d3b-8727-413b-aa8d-7547ac7d8a68",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "27074acb-2256-4b79-a093-df35755ca0e8": {
      "main": [
        [
          {
            "node": "39445058-69b3-4bf1-8236-99a4a55e7d86",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7d2d4e71-ce5f-4e08-a5fb-2ca01d17e6a6": {
      "main": [
        [
          {
            "node": "cf18ef2b-6044-4526-9f0f-b1ec4d7a547d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "40aa27bb-4577-4d2d-abc4-0ed103fc0cbd": {
      "main": [
        [
          {
            "node": "56bc70d8-aba3-4534-be6b-05cce089505a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "84ac45bc-27c8-4fce-8e03-be8c9cf18fe8": {
      "main": [
        [
          {
            "node": "81fc8e77-f1fb-4914-87b7-489bdcdf3f9d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "61e693a0-bebc-4f32-8531-67110fc08e38": {
      "main": [
        [
          {
            "node": "25cb00db-559f-4eb0-baf6-3118fc6c6bf0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "10062467-974d-4103-aeb3-bff32d0c6e3f": {
      "main": [
        [
          {
            "node": "f0c2dcd5-5fe8-4968-a510-0f7d997d3b2f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9561c9dd-0b82-4cdb-bed0-a3307d206394": {
      "main": [
        [
          {
            "node": "31cc03e7-50db-4c6d-b266-136225457218",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c99060a8-fe04-44c8-86ad-76ad9c0f2f6c": {
      "ai_outputParser": [
        [
          {
            "node": "56bc70d8-aba3-4534-be6b-05cce089505a",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "efb0bd4c-0b6d-4b96-8e8d-d1b511174151": {
      "main": [
        [
          {
            "node": "c1422e6a-289f-4499-b19b-62df452010b2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b279aabb-d27f-44d4-9290-e0bf9abca567": {
      "main": [
        [
          {
            "node": "02d36503-b3ad-451b-8f90-9ee50d9e3c53",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cc825e4c-1f68-4688-8e32-5d08b3aab1ac": {
      "main": [
        [
          {
            "node": "56bc70d8-aba3-4534-be6b-05cce089505a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fa1ce78e-ef3c-45e9-9b89-b6afa3e3a119": {
      "ai_textSplitter": [
        [
          {
            "node": "db23a77d-2805-421d-a3c0-43de5a78e0a5",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "3024e04e-86c4-43d6-819d-22f45ef40750": {
      "main": [
        [
          {
            "node": "c8d17104-e110-453d-97ca-e8e79bf589c1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0c76dd9b-be10-4fdd-8536-ea3eb75a6cba": {
      "main": [
        [
          {
            "node": "c41851a0-ba52-432d-ae00-752bb630cead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - AI RAG 检索增强, 多模态 AI

需要付费吗?

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

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

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

作者
Michael Taleb

Michael Taleb

@michaeltaleb

n8n developer helping businesses save time and scale by automating complex business processes with n8n and smart integrations.

外部链接
在 n8n.io 查看

分享此工作流

分类

分类: 34