ReAct AI Agent 节点#
¥ReAct AI Agent node
Feature removed
n8n 已于 2025 年 2 月移除此功能。
¥n8n removed this functionality in February 2025.
ReAct Agent 节点实现了 ReAct 逻辑。ReAct(推断与行动)结合了思维导图提示和行动计划生成的推断能力。
¥The ReAct Agent node implements ReAct logic. ReAct (reasoning and acting) brings together the reasoning powers of chain-of-thought prompting and action plan generation.
ReAct Agent 会对给定的任务进行推断,确定必要的操作,然后执行这些操作。它遵循推断和行动的循环,直到完成任务。ReAct Agent 可以将复杂的任务分解成更小的子任务,确定它们的优先级,并按顺序执行。
¥The ReAct Agent reasons about a given task, determines the necessary actions, and then executes them. It follows the cycle of reasoning and acting until it completes the task. The ReAct agent can break down complex tasks into smaller sub-tasks, prioritise them, and execute them one after the other.
有关 AI Agent 节点本身的更多信息,请参阅 AI 代理。
¥Refer to AI Agent for more information on the AI Agent node itself.
No memory
ReAct Agent 不支持内存子节点。这意味着它无法回忆之前的提示或模拟正在进行的对话。
¥The ReAct agent doesn't support memory sub-nodes. This means it can't recall previous prompts or simulate an ongoing conversation.
节点参数#
¥Node parameters
使用以下参数配置 ReAct Agent。
¥Configure the ReAct Agent using the following parameters.
提示#
¥Prompt
Select how you want the node to construct the prompt (also known as the user's query or input from the chat).
Choose from:
- Take from previous node automatically: If you select this option, the node expects an input from a previous node called
chatInput. - Define below: If you select this option, provide either static text or an expression for dynamic content to serve as the prompt in the Prompt (User Message) field.
要求特定输出格式#
¥Require Specific Output Format
This parameter controls whether you want the node to require a specific output format. When turned on, n8n prompts you to connect one of these output parsers to the node:
节点选项#
¥Node options
使用选项创建一条消息,以便在对话开始时发送给客服人员。消息类型取决于你使用的模型:
¥Use the options to create a message to send to the agent at the start of the conversation. The message type depends on the model you're using:
- 聊天模型:这些模型包含人工智能、系统和人这三个组件交互的概念。它们可以接收系统消息和人工消息(提示)。
¥Chat models: These models have the concept of three components interacting (AI, system, and human). They can receive system messages and human messages (prompts).
- 指令模型:这些模型不包含人工智能、系统和人这三个独立组件的概念。它们接收一段文本,即指令消息。
¥Instruct models: These models don't have the concept of separate AI, system, and human components. They receive one body of text, the instruct message.
人类消息模板#
¥Human Message Template
使用此选项可扩展用户提示。这是代理将信息从一个迭代传递到下一个迭代的方法。
¥Use this option to extend the user prompt. This is a way for the agent to pass information from one iteration to the next.
可用的 LangChain 表达式:
¥Available LangChain expressions:
{input}:包含用户提示。
¥{input}: Contains the user prompt.
{agent_scratchpad}:下次迭代需要记住的信息。
¥{agent_scratchpad}: Information to remember for the next iteration.
消息前缀#
¥Prefix Message
输入用于在对话开始时为工具列表添加前缀的文本。你无需添加工具列表。LangChain 会自动添加工具列表。
¥Enter text to prefix the tools list at the start of the conversation. You don't need to add the list of tools. LangChain automatically adds the tools list.
聊天模型后缀消息#
¥Suffix Message for Chat Model
当客服人员使用聊天模式时,在对话开始时,在工具列表后添加要追加的文本。你无需添加工具列表。LangChain 会自动添加工具列表。
¥Add text to append after the tools list at the start of the conversation when the agent uses a chat model. You don't need to add the list of tools. LangChain automatically adds the tools list.
常规模型后缀消息#
¥Suffix Message for Regular Model
当客服人员使用常规/指令模式时,在对话开始时,在工具列表后添加要追加的文本。你无需添加工具列表。LangChain 会自动添加工具列表。
¥Add text to append after the tools list at the start of the conversation when the agent uses a regular/instruct model. You don't need to add the list of tools. LangChain automatically adds the tools list.
返回中间步骤#
¥Return Intermediate Steps
Select whether to include intermediate steps the agent took in the final output (turned on) or not (turned off).
This could be useful for further refining the agent's behavior based on the steps it took.
相关资源#
¥Related resources
有关更多信息,请参阅 LangChain 的 ReAct 代理 文档。
¥Refer to LangChain's ReAct Agents documentation for more information.
模板和示例#
¥Templates and examples
请参阅主 AI 代理节点的 模板和示例 部分。
¥Refer to the main AI Agent node's Templates and examples section.
常见问题#
¥Common issues
有关常见问题或建议的解决方案,请参阅 常见问题。
¥For common questions or issues and suggested solutions, refer to Common issues.