Skip to main content

Agent Mode Reference

Mode

current only support 2 types of agent mode: ReAct and Plan and Execute.

ReAct

ReAct (Reasoning and Acting) is an agent mode that combines Chain-of-Thought reasoning with action planning. The core idea is for the agent to alternate between "thinking" and "acting" while performing a task.

Workflow:

  1. Thought: The agent analyzes the current task and state, plans the next step, or performs reasoning.
  2. Action: Based on the thought process, the agent selects and executes an action (e.g., calling a tool, querying information).
  3. Observation: The agent receives the result or feedback from the action.
  4. Repeat: The agent incorporates the observation into the next thought cycle, repeating the steps until the task is completed.

This mode enables the agent to handle more complex tasks as it can dynamically adjust its plan based on environmental feedback during execution.

Plan and Execute

The Plan and Execute mode divides task processing into two distinct phases:

  1. Planning: The agent first analyzes the entire task and creates a detailed step-by-step plan. This plan is usually an ordered list of actions.
  2. Execution: The agent follows the plan created in the planning phase and executes each step sequentially until all steps are completed. Significant plan adjustments are typically not made during the execution phase.

Characteristics:

  • Structured: The task processing flow is clear: plan first, then execute.
  • Predictable: Once the plan is set, the execution process is relatively fixed.
  • Use Cases: Suitable for tasks with clear objectives and relatively fixed steps. It might be less flexible than ReAct for complex tasks requiring dynamic strategy adjustments based on intermediate results.