Skip to content

演示代理和链之间的主要区别#

¥Demonstration of key differences between agents and chains

在本工作流程中,你可以选择将聊天查询发送到 agent 还是 chain。它展示了代理比链式调用更强大的一些方式。

¥In this workflow you can choose whether your chat query goes to an agent or chain. It shows some of the ways that agents are more powerful than chains.

Workflow preview placeholder.

主要功能#

¥Key features

此工作流程使用:

¥This workflow uses:

  • 聊天触发器:启动你的工作流并响应用户聊天互动。该节点提供可自定义的聊天界面。

¥Chat Trigger: start your workflow and respond to user chat interactions. The node provides a customizable chat interface.

  • 切换节点:根据你在查询中指定的,将你的查询定向到代理或链。如果你输入 "agent",它会将其发送给代理。如果你输入 "chain",它会将其发送给链。

¥Switch node: directs your query to either the agent or chain, depending on which you specify in your query. If you say "agent" it sends it to the agent. If you say "chain" it sends it to the chain.

  • 代理:代理节点与工作流的其他组件交互,并决定使用哪个 tools

¥Agent: the Agent node interacts with other components of the workflow and makes decisions about what tools to use.

  • 基础 LLM 链:基本 LLM 链节点支持与连接的 LLM 进行聊天,但不支持 memory 或工具。

¥Basic LLM Chain: the Basic LLM Chain node supports chatting with a connected LLM, but doesn't support memory or tools.

使用示例#

¥Using the example

To load the template into your n8n instance:

  1. Download the workflow JSON file.
  2. Open a new workflow in your n8n instance.
  3. Copy in the JSON, or select Workflow menu Workflow menu icon > Import from file....

The example workflows use Sticky Notes to guide you:

  • Yellow: notes and information.
  • Green: instructions to run the workflow.
  • Orange: you need to change something to make the workflow work.
  • Blue: draws attention to a key feature of the example.