Skip to content

人工智能中的链是什么?(What's a chain in AI?)#

Chains 将人工智能的不同组件整合在一起,以创建一个统一的系统。它们在组件之间设置调用序列。这些组件可以包括模型和内存(但请注意,在 n8n chains 中无法使用内存)。

n8n 中的链(Chains in n8n)#

n8n 提供了三个链节点:

🌐 n8n provides three chain nodes:

  • 基础 LLM 链:用于与 LLM 进行交互,无需任何额外组件。
  • 问答链:可以使用检索器连接到 向量存储,或使用 Workflow Retriever 节点连接到 n8n 工作流。如果您想创建一个支持针对特定文档提问的工作流,请使用此功能。
  • 摘要链:接收输入并返回摘要。

在 n8n 和其他工具(例如 LangChain)中的链之间有一个重要的区别:链节点不支持记忆。这意味着它们无法记住之前的用户查询。如果你使用 LangChain 编写 AI 应用,你可以赋予你的应用记忆功能。在 n8n 中,如果你希望你的工作流程支持记忆功能,需要使用 agent。如果你希望用户能够与应用进行自然的持续对话,这是必不可少的。

🌐 There's an important difference between chains in n8n and in other tools such as LangChain: none of the chain nodes support memory. This means they can't remember previous user queries. If you use LangChain to code an AI application, you can give your application memory. In n8n, if you need your workflow to support memory, use an agent. This is essential if you want users to be able to have a natural ongoing conversation with your app.