8
n8n 中文网amn8n.com

使用OpenAI和Notion创建可嵌入网站的知识库聊天机器人

中级

这是一个Support Chatbot, AI RAG领域的自动化工作流,包含 9 个节点。主要使用 NotionTool, Agent, ChatTrigger, LmChatOpenAi, MemoryBufferWindow 等节点。 使用OpenAI和Notion创建可嵌入网站的知识库聊天机器人

前置要求
  • Notion API Key
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "cba9e349b601c19a1409b9fd06680aff0a77829be13c8aad9a858d4cea7ff290",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "889783dd-88c8-4344-ab75-26ff93abbc03",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        528
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "de6ea262-83f6-4411-bd3a-a594f52e4967",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        528
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0dfc989d-7dd2-4b9c-b0d9-245e28a90c68",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        528
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "55c51c3f-8c2e-41e5-a956-c5f5f936b21b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -112
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e8b9d000-d0ac-4574-9db8-7f286dcf5b58",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -336,
        368
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "6d3f259c-2d95-4d52-b270-c7f0bfb41a69",
      "name": "开始聊天对话",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -384,
        144
      ],
      "webhookId": "cf1de04f-3e38-426c-89f0-3bdb110a5dcf",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "93e69333-6752-4dc7-85e7-76e2a3140a9e",
      "name": "智能 AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -128,
        144
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "683ce86c-ee1c-4809-a775-d949a3795354",
      "name": "记住聊天历史",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -16,
        368
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "c0c049f9-81f4-47a4-ad8f-e6a9f1049a99",
      "name": "设置和获取 Notion 数据库",
      "type": "n8n-nodes-base.notionTool",
      "position": [
        320,
        368
      ],
      "parameters": {},
      "typeVersion": 2.2
    }
  ],
  "pinData": {},
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Smart AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Remember Chat History": {
      "ai_memory": [
        [
          {
            "node": "Smart AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Start Chat Conversation": {
      "main": [
        [
          {
            "node": "Smart AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set & Get Notion Database": {
      "ai_tool": [
        [
          {
            "node": "Smart AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 客服机器人, AI RAG 检索增强

需要付费吗?

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

工作流信息
难度等级
中级
节点数量9
分类2
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Gegenfeld

Gegenfeld

@gegenfeld

We at Gegenfeld are an EdTech platform dedicated to delivering high-quality on-demand courses and interactive training sessions for professional development at all skill levels. With our commitment to "Accelerate your future," we empower professionals to enhance their expertise through engaging, industry-focused learning experiences. On n8n, we share some of the workflows used in our interactive training to provide deeper insights and practical applications.

外部链接
在 n8n.io 查看

分享此工作流