8
n8n 中文网amn8n.com

高级聊天机器人+RAG代理

高级

这是一个Support, AI领域的自动化工作流,包含 34 个节点。主要使用 Set, Webhook, GoogleDrive, HttpRequest, ManualTrigger 等节点,结合人工智能技术实现智能自动化。 基于OpenAI、Google Sheets、Glide和Supabase的AI驱动RAG问答聊天机器人

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
  • Qdrant 服务器连接信息
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "cqUkesdTBt1eb0Ny",
  "meta": {
    "instanceId": "5beb610c1ddaf0be11e46fd8edaf0e265560c93f1638f8638d6a8a7adf44f57e"
  },
  "name": "高级聊天机器人+RAG代理",
  "tags": [],
  "nodes": [
    {
      "id": "b1f01c72-c1bf-4729-9016-431c06270e92",
      "name": "n8n_order",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        240
      ],
      "webhookId": "9ff7a394-5b4b-4790-a96b-c41c4ba27fa5",
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "063583e6-bb88-4c88-801b-fdd57e2b92a6",
      "name": "Google日历",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        2020,
        220
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "57e406c7-5b52-49c1-a4c6-bee15d97bdcd",
      "name": "OpenAI聊天模型3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1600,
        420
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "7b6f9c79-95aa-42ee-a0f6-4b1eeec7192c",
      "name": "音乐会开始日期",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1640,
        220
      ],
      "parameters": {},
      "typeVersion": 1.6
    },
    {
      "id": "b4556eea-381d-4ac2-8930-248043ed02e3",
      "name": "n8n_appointment",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1380,
        220
      ],
      "webhookId": "f5edfe92-649b-40da-ab35-f818ccb55ad4",
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "9f443fc4-e71a-4152-b304-c4a8cbf8abea",
      "name": "检索Qdrant向量存储",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        3260,
        420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c9e4d71a-80db-45c9-8cb6-7d645c081de7",
      "name": "OpenAI2 嵌入",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        3220,
        600
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "d70f8ef2-e252-4dca-acf5-cec60f80db7c",
      "name": "RAG",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        3420,
        220
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d9884de0-7389-4cd8-9657-80fffa95fe34",
      "name": "OpenAI 聊天模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3220,
        220
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "41441ea8-f3c0-4b36-8a47-f12e3a624866",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3580,
        440
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "51a0a38b-ab01-47b8-9665-0cbc2be623f6",
      "name": "检索代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3300,
        0
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "6dc391c8-54bb-4223-b0fb-aa99ba9becb6",
      "name": "n8n_rag",
      "type": "n8n-nodes-base.webhook",
      "position": [
        2880,
        0
      ],
      "webhookId": "edb1e894-1210-4902-a34f-a014bbdad8d8",
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "4461b2ea-9391-4d16-8e8a-9b5bd077f899",
      "name": "跟踪响应",
      "type": "n8n-nodes-base.set",
      "position": [
        700,
        240
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "16918647-88af-4a67-8798-e1a24c142d82",
      "name": "日历响应",
      "type": "n8n-nodes-base.set",
      "position": [
        2220,
        220
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "758d752c-06ab-473c-8ebc-ccac5792207d",
      "name": "Webhook跟踪响应",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1040,
        240
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "53c2db23-0b29-40a8-9c6c-66582785f363",
      "name": "API URL跟踪",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        360,
        240
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "19d9fdf0-ee81-4a2b-9f23-f160ffc9ace9",
      "name": "Webhook日历响应",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2420,
        220
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "1404754e-362c-45a8-a48d-5bdd81903ed5",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1860,
        420
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "50445cd1-d8e3-4132-b81c-29c61ab4c4e4",
      "name": "Webhook RAG响应",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3940,
        0
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "e4aa410b-6c69-4a4f-a774-0d8dc18fa7d3",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4400,
        -240
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "5849e29d-80bb-4b4b-b01c-5df0e125710d",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1920,
        120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0393e143-7e02-4e25-bd1a-96ade644ee52",
      "name": "Qdrant 向量存储",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        -620,
        240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1a16e82c-1072-4a68-8e32-2ebb93afa211",
      "name": "创建集合",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -860,
        -80
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "2d995c22-3ac9-4714-a7b8-0f9d58b44385",
      "name": "刷新集合",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1300,
        240
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "9830b153-1ec5-431a-b2a1-9434934eac79",
      "name": "获取文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1080,
        240
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "f7b07a4d-19d6-4e92-9ad8-030bf4371227",
      "name": "下载文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -860,
        240
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "c7aab9a9-6972-4510-8534-cad58d2532df",
      "name": "OpenAI 嵌入",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -640,
        440
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "992e7ef4-c08a-4c54-b2df-5489dcc91dcb",
      "name": "默认数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -460,
        440
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "60b75454-0608-4f86-a9ed-ff55f0046615",
      "name": "令牌分割器",
      "type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
      "position": [
        -440,
        580
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a7e705e9-9896-46cd-9a69-41aa2e0b9c66",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        -240
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "6d004528-4049-41f8-be6d-5a694780f352",
      "name": "便签说明4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        180
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "d80d575d-8dc9-43e7-b14d-4a9d00a1330b",
      "name": "便签说明5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2820,
        -180
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "c82ee641-46fa-4534-b9ff-246caf46d60e",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        40
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "091602c1-6c19-4dbd-885a-ba393068f6af",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1300,
        40
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "87411f47-2164-4d91-9416-833740264b6f",
  "connections": {
    "RAG": {
      "ai_tool": [
        [
          {
            "node": "Retrive Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "n8n_rag": {
      "main": [
        [
          {
            "node": "Retrive Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n_order": {
      "main": [
        [
          {
            "node": "API URL Tracking",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get folder": {
      "main": [
        [
          {
            "node": "Download Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrive Agent": {
      "main": [
        [
          {
            "node": "Webhook RAG response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Files": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Token Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar": {
      "main": [
        [
          {
            "node": "Calendar response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n_appointment": {
      "main": [
        [
          {
            "node": "Concert start date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "API URL Tracking": {
      "main": [
        [
          {
            "node": "Tracking response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calendar response": {
      "main": [
        [
          {
            "node": "Webhook calendar response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Tracking response": {
      "main": [
        [
          {
            "node": "Webhook tracking response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Concert start date": {
      "main": [
        [
          {
            "node": "Google Calendar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Retrive Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "RAG",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Retrive Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Concert start date",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Refresh collection": {
      "main": [
        [
          {
            "node": "Get folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Concert start date",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Retrive Qdrant Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "RAG",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Create collection",
            "type": "main",
            "index": 0
          },
          {
            "node": "Refresh collection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 客户支持, 人工智能

需要付费吗?

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

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

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

作者
Sam Yassine

Sam Yassine

@samyassine

AI Automation Expert | n8n Wizard | Workflow Simplifier I turn complex processes into powerful automations using n8n. Whether you're scaling your business or saving hours of manual work, I've got plug-and-play templates that bring AI and automation together—fast, smart, and easy. Let’s make your systems work for you.

外部链接
在 n8n.io 查看

分享此工作流