Plan-and-execute agent

On this page 7

A plan-and-execute agent is an AI agent architecture that separates planning from execution: a planner model first writes an explicit, ordered list of steps for the whole task, and an executor then carries out those steps one by one with tools, while a replanning step updates the remaining plan when results diverge from expectations. Among AI agents, it is the main alternative to interleaved designs such as ReAct prompting.

The pattern targets long, multi-step tasks where deciding each action in isolation tends to wander or loop. By committing to a plan up front, the agent gains predictability, lower cost per step and a reviewable structure, at the price of reacting more slowly to surprises during execution.

How a plan-and-execute agent works

A plan-and-execute agent runs in three repeating phases: plan, execute and replan. The planner receives the goal and context and returns a structured plan, often as a numbered list or JSON; the executor handles the current step, typically through tool calling; and the replanner compares the outcome with the goal before deciding what happens next.

The key design choice is that the planner reasons about the whole task, while the executor reasons only about one step. This lets teams use a stronger, more expensive model for planning and a smaller, faster model for routine execution. The plan itself becomes part of the agent state, so it can be logged, checkpointed and shown to a human.

The table below describes each component and its responsibility.

ComponentInputOutputResponsibility
PlannerGoal, context, available toolsOrdered list of stepsTask decomposition and sequencing
ExecutorOne step and prior resultsStep result or tool outputCarrying out actions reliably
ReplannerOriginal plan and results so farRevised plan or final answerDetecting deviation and adjusting course
State storePlan, results, errorsPersistent recordCheckpointing, audit and recovery
Components of a plan-and-execute agent

Variants of the plan-and-execute pattern

Plan-and-execute agents differ mainly in how plans are represented and how often the agent replans. Simple variants produce a linear checklist; advanced variants produce a dependency graph that allows independent steps to run in parallel.

Research systems illustrate the range. Plan-and-Solve prompting asks the model to plan before reasoning in a single call. ReWOO writes the full plan with placeholders for tool outputs, which removes repeated model calls between steps. LLMCompiler turns the plan into a task graph and dispatches steps with parallel tool calling. Hierarchical variants hand each step to a subagent, which brings the pattern close to the orchestrator-worker pattern.

VariantPlan formReplanningBest fit
Static planLinear checklistNone or only on failurePredictable, well-defined procedures
Plan with replanningLinear checklistAfter each step or each phaseTasks with uncertain intermediate results
ReWOO stylePlan with variable placeholdersRarelyCost-sensitive tool pipelines
Task graphDirected acyclic graphWhen a node failsSteps that can run in parallel
HierarchicalTop-level plan with subplansAt each levelLarge tasks split across subagents
Common plan-and-execute variants

Plan-and-execute compared with ReAct

The difference between a plan-and-execute agent and a ReAct agent lies in when reasoning happens. ReAct interleaves a thought, an action and an observation at every step inside a single agent loop, while plan-and-execute reasons once about the whole path and then mostly acts.

ReAct adapts quickly to unexpected observations, but it can drift from the goal or repeat actions on long tasks, and it calls the large model at every step. Plan-and-execute keeps the agent on track and reduces calls to the expensive model, yet a flawed initial plan propagates errors until replanning catches them.

AspectPlan-and-executeReAct
Reasoning timingUp front, then at replanning pointsBefore every action
AdaptabilityModerate, depends on replanning frequencyHigh, adjusts at each step
Cost on long tasksLower, executor can be a small modelHigher, large model at each step
Goal drift riskLower, plan anchors the taskHigher on long trajectories
Human reviewEasy, plan can be approved firstHarder, decisions appear step by step
Plan-and-execute and ReAct side by side

Designing and running a plan-and-execute agent

A reliable plan-and-execute agent depends on well-scoped steps, clear success criteria and deliberate replanning triggers. Each step should name one outcome that the executor can verify, such as a file written or a query answered, rather than a vague activity.

  • Constrain the plan format with a schema so the executor can parse steps and dependencies without guessing.
  • Give the planner the tool list and their limits, so it does not plan actions that no tool can perform.
  • Replan on evidence, for example after a tool error, an empty result or a step that changes the known facts.
  • Cap plan length and replanning rounds to prevent runaway cost on tasks that cannot be completed.
  • Insert human approval before steps with side effects, which fits human-in-the-loop and agent permissions policies.

The following decision table helps choose between plan-and-execute and other agent designs.

SituationRecommended designReason
Multi-step research or report generationPlan-and-execute with replanningStructure keeps coverage complete
Short interactive tasks of one to three actionsReAct or a single tool callPlanning overhead outweighs benefit
Highly dynamic environments such as web browsingReAct, or frequent replanningPlans go stale quickly
Regulated workflows needing sign-offPlan-and-execute with plan approvalPlan is a reviewable artifact
When to use a plan-and-execute agent

Limitations and failure modes

The main limitation of a plan-and-execute agent is that plan quality bounds task quality: a planner that misunderstands the goal or the environment produces a confident but wrong sequence. Several other failure modes recur in practice.

  • Stale plans occur when the executor discovers new facts but the replanner is not triggered.
  • Over-decomposition splits simple work into many steps, which adds latency and cost.
  • Lost context between planner and executor causes steps to be executed without the intent behind them.
  • Silent step failures pass empty or partial results forward unless each step is checked against its success criterion.
  • Evaluation gaps hide problems, so agent evaluation should score both the plan and the final outcome, using recorded agent trajectories.

In simple terms

A plan-and-execute agent works like a person who writes a to-do list before starting a project. First it thinks about the whole job and writes down the steps. Then it works through the list, one item at a time.

If something unexpected happens, such as a missing file, it stops and rewrites the rest of the list. The main benefit is focus: the agent is less likely to get lost on long tasks, and a person can read the plan before any real action happens.

A practical example

A finance team uses an internal agent to prepare a monthly vendor spending report. Given the request, the planner writes six steps: query the accounting database for last month’s invoices, group them by vendor, compare totals with the prior month, flag changes above 20 percent, draft commentary and produce a spreadsheet.

A small, fast model executes the database query and grouping steps through tools. When the comparison step finds that one vendor changed its identifier, the replanner inserts a step to merge the two records before continuing. A controller reviews the plan and the flagged items before the report is distributed. The report that once took an analyst most of a day is now ready for review in about fifteen minutes, and every run leaves a plan and step log for audit.