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.
| Component | Input | Output | Responsibility |
|---|---|---|---|
| Planner | Goal, context, available tools | Ordered list of steps | Task decomposition and sequencing |
| Executor | One step and prior results | Step result or tool output | Carrying out actions reliably |
| Replanner | Original plan and results so far | Revised plan or final answer | Detecting deviation and adjusting course |
| State store | Plan, results, errors | Persistent record | Checkpointing, audit and recovery |
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.
| Variant | Plan form | Replanning | Best fit |
|---|---|---|---|
| Static plan | Linear checklist | None or only on failure | Predictable, well-defined procedures |
| Plan with replanning | Linear checklist | After each step or each phase | Tasks with uncertain intermediate results |
| ReWOO style | Plan with variable placeholders | Rarely | Cost-sensitive tool pipelines |
| Task graph | Directed acyclic graph | When a node fails | Steps that can run in parallel |
| Hierarchical | Top-level plan with subplans | At each level | Large tasks split across subagents |
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.
| Aspect | Plan-and-execute | ReAct |
|---|---|---|
| Reasoning timing | Up front, then at replanning points | Before every action |
| Adaptability | Moderate, depends on replanning frequency | High, adjusts at each step |
| Cost on long tasks | Lower, executor can be a small model | Higher, large model at each step |
| Goal drift risk | Lower, plan anchors the task | Higher on long trajectories |
| Human review | Easy, plan can be approved first | Harder, decisions appear step by step |
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.
| Situation | Recommended design | Reason |
|---|---|---|
| Multi-step research or report generation | Plan-and-execute with replanning | Structure keeps coverage complete |
| Short interactive tasks of one to three actions | ReAct or a single tool call | Planning overhead outweighs benefit |
| Highly dynamic environments such as web browsing | ReAct, or frequent replanning | Plans go stale quickly |
| Regulated workflows needing sign-off | Plan-and-execute with plan approval | Plan is a reviewable artifact |
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.