规划和执行代理节点#
¥Plan and Execute Agent node
“计划和执行代理”类似于 ReAct 代理,但侧重于计划。它首先创建一个解决给定任务的高级计划,然后逐步执行该计划。此代理最适用于需要结构化方法和周密计划的任务。
¥The Plan and Execute Agent is like the ReAct agent but with a focus on planning. It first creates a high-level plan to solve the given task and then executes the plan step by step. This agent is most useful for tasks that require a structured approach and careful planning.
有关 AI Agent 节点本身的更多信息,请参阅 AI 代理。
¥Refer to AI Agent for more information on the AI Agent node itself.
节点参数#
¥Node parameters
使用以下参数配置 Plan and Execute Agent。
¥Configure the Plan and Execute 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
使用以下选项优化计划和执行代理节点的行为:
¥Refine the Plan and Execute Agent node's behavior using these options:
人类消息模板#
¥Human Message Template
输入 n8n 将在每个步骤执行期间发送给代理的消息。
¥Enter a message that n8n will send to the agent during each step execution.
可用的 LangChain 表达式:
¥Available LangChain expressions:
{previous_steps}:包含代理已完成的先前步骤的信息。
¥{previous_steps}: Contains information about the previous steps the agent's already completed.
{current_step}:包含当前步骤的信息。
¥{current_step}: Contains information about the current step.
{agent_scratchpad}:下次迭代需要记住的信息。
¥{agent_scratchpad}: Information to remember for the next iteration.
模板和示例#
¥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.