ReAct AI Agent 节点(ReAct AI Agent node)#
功能已移除
n8n 在 2025 年 2 月移除了此功能。
ReAct 代理节点实现了 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 代理会对给定任务进行推断,确定所需的操作,然后执行这些操作。它遵循推断与行动的循环,直到完成任务。ReAct 代理可以将复杂任务分解为更小的子任务,对它们进行优先排序,并依次执行。
🌐 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 Agent。
🌐 Refer to AI Agent for more information on the AI Agent node itself.
无记忆
ReAct 代理不支持记忆子节点。这意味着它无法回忆之前的提示或模拟持续进行的对话。
节点参数(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:
- 聊天模型:这些模型具有三部分交互的概念(AI、系统和人类)。它们可以接收系统消息和人类消息(提示)。
- 指导模型:这些模型没有独立的 AI、系统和人类组件的概念。它们接收一段文本,即指导信息。
人类消息模板(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}:包含用户提示。{agent_scratchpad}:需要在下一次迭代中记住的信息。
消息前缀(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 Agents 文档。
🌐 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.