Plan-then-execute: think first, then do
Lesson 2 of 4 in Single-Agent Patterns: ReAct, Plan-Then-Execute, Reflection.
ReAct decides the next step only after seeing the last observation. Plan-then-execute inverts that: a planning pass produces the whole itinerary up front — a numbered list or a small dependency graph of steps — and an execution phase works through it, step by step. When a step fails or its assumptions turn out false, control returns to the planner: replan, don’t improvise.
The split buys you three things ReAct structurally cannot offer:
- A reviewable artifact before side effects. The plan is text. A human or an approval gate can read “step 4: DELETE FROM users WHERE…” before anything runs — with ReAct there is no moment when the future is written down.
- Cost control. You know the step count before you spend the budget, and you can split roles: an expensive model plans once, a cheaper model (or plain code) executes each bounded step with only the context that step needs — instead of the ever-growing transcript ReAct re-sends.
- Parallelism. Steps with no dependency between them can fan out concurrently. ReAct is serial by construction.
Plan-then-execute with a replan loop
- Task arrives
- Planner drafts full plan
A numbered list or DAG of steps — produced by the strongest model, since errors here are the most expensive kind.
- Plan approved?
Optional but powerful: a human or policy check reads the plan before any side effects. This review moment is the pattern’s signature advantage.
- Execute next step
A cheaper model or plain code, given only what this step needs — not the whole transcript.
- Step succeeded and assumptions still hold?
- Steps remaining?
- Replan from current state
Feed the planner what actually happened. Skipping this — marching on through a dead plan — is the pattern’s classic failure.
- Done
Interactive sorting exercise: ReAct or plan-then-execute? Sort each task by which pattern fits it better.
Key terms: plan-then-execute, replanning, approval gate, stopping condition, workflow
Interactive checkpoint quiz (2 questions) — open this page in a browser to take it.