人工智能中的链是什么?#
¥What's a chain in AI?
链 将不同的 AI 组件组合在一起,以创建一个统一的系统。它们在组件之间建立一系列调用。这些组件可以包括模型和 memory(但请注意,n8n 链不能使用内存)。
¥Chains bring together different components of AI to create a cohesive system. They set up a sequence of calls between the components. These components can include models and memory (though note that in n8n chains can't use memory).
n8n 中的链#
¥Chains in n8n
n8n 提供了三个链节点:
¥n8n provides three chain nodes:
- 基础 LLM 链:无需任何额外组件即可与 LLM 交互。
¥Basic LLM Chain: use to interact with an LLM, without any additional components.
- Question and Answer 链:可以使用检索器连接到 矢量商店,或使用“工作流检索器”节点连接到 n8n 工作流。如果你希望创建一个支持询问特定文档相关问题的工作流,请使用此选项。
¥Question and Answer Chain: can connect to a vector store using a retriever, or to an n8n workflow using the Workflow Retriever node. Use this if you want to create a workflow that supports asking questions about specific documents.
- 摘要链:接收输入并返回摘要。
¥Summarization Chain: takes an input and returns a summary.
n8n 中的链与其他工具(例如 LangChain)中的链存在一个重要的区别:链节点均不支持内存。这意味着他们无法记住之前的用户查询。如果你使用 LangChain 编写 AI 应用,则可以为应用分配内存。在 n8n 中,如果你的工作流需要支持内存,请使用代理。如果你希望用户能够与你的应用进行自然流畅的对话,此功能至关重要。
¥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.