Planner-executor separates deciding the steps from actually doing them.
ConceptWhat it is
The planner-executor pattern splits an agent into a planning component that decomposes a goal into an ordered list of steps, and an executor component that carries out each step, possibly calling tools or sub-agents.
It exists to make agent behavior more predictable and auditable than fully improvisational loops, since the plan can be reviewed, validated, or edited before any action is taken.
How it worksThe mechanics
The planner receives the goal and produces a structured plan, often a numbered list of sub-tasks; the executor then works through the plan step by step, invoking tools or models as needed, and can report back to the planner to revise the remaining plan if a step fails or new information emerges.
At a glanceSee it
The auditability payoff the base loop skips — a validation gate lets a plan be checked, edited, or rejected before any tool fires.
A taxonomy of planning commitment — the same planner-executor skeleton spans from plan-once-execute-all to interleaved replanning to hierarchical decomposition, each trading adaptivity against cost.
When to use itWhere it fits
- Tasks benefiting from an inspectable, editable plan before execution begins.
- Long-horizon tasks where upfront decomposition reduces wasted or wrong actions.
- Workflows needing a human review checkpoint on the plan before it runs.
- Situations where separating planning cost from execution cost aids budgeting.
When NOT to use itLimits & anti-patterns
- Highly dynamic tasks where the right next step depends heavily on unpredictable intermediate results, favoring a ReAct-style loop instead.
- Very short tasks, where a full planning phase is unnecessary overhead.
- Environments where re-planning after every failure becomes as expensive as not planning at all.
Trade-offsAdvantages & costs
Advantages
- Plans are inspectable and editable before any action is taken.
- Clearer separation of concerns aids debugging and testing.
- Reduces wasted actions compared to purely reactive looping.
- Enables human review gates on the plan itself.
Trade-offs & costs
- Upfront plans can become stale if reality diverges from assumptions.
- Requires re-planning logic to handle failures gracefully.
- Adds an extra planning call and latency before execution starts.
- Rigid plans can underperform in highly uncertain environments.
ExampleIn the real world
A data-migration tool uses a planner-executor agent that first drafts a step-by-step plan to move tables between databases, presents it for engineer approval, then executes each step and reports progress back.
ToolsHow to implement it
- LangGraphimplements the plan-then-execute pattern as an explicit graph.
- BabyAGI-style loopsearly open-source pattern for planner-executor task queues.
- Task queues like Celeryexecute plan steps reliably with retries.
- OpenAI Assistants APIsupports multi-step planning with tool execution.
Cost & effortWhat it takes
Adds one planning call upfront plus execution calls per step; total cost is comparable to ReAct but more front-loaded. Moderate engineering effort to build re-planning and failure recovery.