8
n8n 中文网amn8n.com

基于OpenAI GPT-4.1-Mini和Supabase数据库知识库的AI聊天机器人

中级

这是一个Internal Wiki, AI Chatbot领域的自动化工作流,包含 9 个节点。主要使用 SupabaseTool, Agent, ChatTrigger, LmChatOpenAi, MemoryBufferWindow 等节点。 基于OpenAI GPT-4.1-Mini和Supabase数据库知识库的AI聊天机器人

前置要求
  • Supabase URL 和 API Key
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "cba9e349b601c19a1409b9fd06680aff0a77829be13c8aad9a858d4cea7ff290",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "f9bc9b12-0cbd-4be4-8408-ce69ee0dfc37",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        736
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a0cc3e0b-3f9d-4706-b37d-85ad3be5d22a",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        736
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "67525380-20cc-4c60-b9eb-6642839e689c",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        736
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "bf56dce1-994a-4ed2-9b98-a1ae5d653c03",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        96
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f97b26e5-704c-48b1-9555-ac4269e663a1",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        96,
        576
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "53eabcc1-995e-4c43-8431-cc7b008006e1",
      "name": "开始聊天对话",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        48,
        352
      ],
      "webhookId": "cf1de04f-3e38-426c-89f0-3bdb110a5dcf",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "4c6e4420-ba39-421a-a946-4722e0be7fe3",
      "name": "智能AI助手",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        304,
        352
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "9e5fdb8d-5b4f-4681-86c1-2bf0c966c3b5",
      "name": "记住聊天历史",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        416,
        576
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "39af080d-d85f-48b9-831b-d0ead3079fdc",
      "name": "Supabase Database",
      "type": "n8n-nodes-base.supabaseTool",
      "position": [
        752,
        576
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Smart AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Database": {
      "ai_tool": [
        [
          {
            "node": "Smart AI Agent",
            "type": "ai_tool",
            "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
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 内部知识库, AI 聊天机器人

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 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 查看

分享此工作流