8
n8n 中文网amn8n.com

搜索网页的聊天机器人

中级

这是一个Building Blocks, AI, IT Ops领域的自动化工作流,包含 7 个节点。主要使用 SearchApiTool, Agent, ChatTrigger, LmChatOpenRouter, MemoryBufferWindow 等节点,结合人工智能技术实现智能自动化。 基于SearchAPI和OpenRouter LLM的带引用网络搜索助手

前置要求
  • AI 服务 API Key(如 OpenAI、Anthropic 等)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "onyc3N5GKCxzWfmi",
  "meta": {
    "instanceId": "54299f860163fe60974599588ae4c20ee888191a431346b258503c2db8b536ed",
    "templateCredsSetupCompleted": true
  },
  "name": "搜索网页的聊天机器人",
  "tags": [],
  "nodes": [
    {
      "id": "976aa8a4-d286-478a-8cc9-4577e220174b",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -300,
        80
      ],
      "webhookId": "d48f9e07-3c05-4be8-86ca-5cee4c27b78f",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "44236749-af9f-4843-a1ab-e54008b4c525",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        40,
        300
      ],
      "parameters": {
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "33536ea4-c8fe-4525-a2d2-905180259e8d",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -48,
        80
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.8
    },
    {
      "id": "10436a1a-4993-4fc5-aca7-686db5bf7441",
      "name": "OpenRouter聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -80,
        300
      ],
      "parameters": {
        "model": "deepseek/deepseek-chat:free",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "id": "tDWBerCVn0gOn7YX",
          "name": "OpenRouter account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "73d024bd-aab3-491c-afc4-79194f4ac7fc",
      "name": "SearchAPI",
      "type": "CUSTOM.searchApiTool",
      "position": [
        260,
        300
      ],
      "parameters": {
        "parameters": {
          "parameter": [
            {
              "name": "q",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Value', ``, 'string') }}"
            },
            {}
          ]
        },
        "requestOptions": {},
        "toolDescription": "Call this tool whenever the answer might require fresh, niche, or externally-verifiable information. Make sure to always cite the sources in the final reply. "
      },
      "credentials": {
        "searchApi": {
          "id": "rTFvdffzP7fPVaVr",
          "name": "SearchAPI account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7443e1c1-1b12-453d-89b3-9875ed07749f",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -140
      ],
      "parameters": {
        "color": 5,
        "width": 340,
        "content": "## SearchAPI AI 代理"
      },
      "typeVersion": 1
    },
    {
      "id": "9617510c-6ff3-4f6c-9e4d-8fbd9b129f95",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        400
      ],
      "parameters": {
        "width": 260,
        "height": 120,
        "content": "## 提示"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1f42e7e2-32ca-4ceb-8f1e-1de26f09d525",
  "connections": {
    "SearchAPI": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 构建模块, 人工智能, IT 运维

需要付费吗?

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

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

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

作者
Pedro Santos

Pedro Santos

@dapedu

I'm a software developer with over 4+ years of experience. I work using software to solve clients problems and I believe n8n is a nice way to solve some problems faster!

外部链接
在 n8n.io 查看

分享此工作流