Guide To Planning AI Agents
Guide To Planning AI Agents
Agentic AI
Planning
Pattern
Dipanjan (DJ)
Planning Agents
The ReAct framework combines Reasoning and Acting within a single loop.
Here, the language model alternates between Reasoning Traces and Actions in
the environment.
Process:
The model first reasons about the task, creating a “thought” or hypothesis about
what should be done next.
It then takes an action in the environment based on its reasoning.
After performing the action, the model observes the outcome in the environment,
which it incorporates into its next reasoning step.
This cycle of reasoning, acting, and observing continues iteratively, allowing
the model to learn and adapt based on real-time feedback from the
environment.
Significance: By integrating reasoning and acting, ReAct allows the model to
break down complex, multi-step tasks into manageable steps, adjust based on
outcomes, and work towards solutions that require both planning and
interaction.
Planner:
The Planner is responsible for creating an entire plan at the beginning. It determines the
sequence of actions or steps needed to solve the task.
For each action step, the Planner specifies:
Tool: The specific tool or function required for the step.
Arguments (args): The input values or variables needed for the tool.
The plan is defined using variable substitution, where the output of one tool (e.g., #E1) can be
used as an argument in another tool (e.g., #E2), creating dependencies across steps.
Importantly, this planning process occurs in a single LLM call, making it more efficient by
reducing token consumption than iterative, observation-based reasoning.
Worker:
The Worker is responsible for executing the actions per the plan the Planner generated.
The Worker takes the arguments provided for each step, invokes the specified tool, and
returns the result.
This execution can be looped until the task is solved, ensuring each tool action is completed
in the correct order as outlined in the plan.
The Worker functions independently of the LLM, meaning it simply follows the Planner’s
instructions without additional calls to the LLM at each step.
Solver:
The Solver is the final component that interprets the results of the tools used by the
Worker.
Based on the observations gathered from tool executions, the Solver generates the
final answer to the user’s query or task.
This part may involve a final LLM call to synthesize the information into a coherent
response.