Agents & Tools · intermediate
Plan-and-Execute (planner-executor)
Plan-and-execute splits agent loops into a planning step (produce the full step list up front) and an execution step (run each step). Cheaper than per-step ReAct and easier to inspect.
Explanation
ReAct interleaves thought and action at every step — flexible but expensive (one LLM call per step) and hard to audit. Plan-and-execute asks a powerful "planner" model to produce the whole plan first, then a cheaper executor model runs each step and only re-plans if something fails.
The trade-off: less adaptive than full ReAct, but more predictable, often cheaper, and the plan is a debuggable artifact you can show to users or log to your trace store.
Used in many production agents (notably Devin's alleged architecture and many internal coding agents at frontier labs).
Examples
- A research agent: Sonnet produces a 7-step plan; Haiku executes each step; if step 4 fails, Sonnet re-plans from there.
- A data-cleaning agent that plans the full pipeline up front, then runs deterministic Python for each step.
When to use plan-and-execute
Tasks where the high-level structure is predictable but individual steps need autonomy.
Frequently asked
What is Plan-and-Execute?
Plan-and-execute splits agent loops into a planning step (produce the full step list up front) and an execution step (run each step). Cheaper than per-step ReAct and easier to inspect.
What is an example of plan-and-execute?
A research agent: Sonnet produces a 7-step plan; Haiku executes each step; if step 4 fails, Sonnet re-plans from there.
How is Plan-and-Execute related to Agent?
Plan-and-Execute and Agent are both agents & tools concepts. An AI agent is an LLM-driven system that decides which actions to take, executes them via tools, observes the results, and iterates until a goal is met.
When should I use plan-and-execute?
Tasks where the high-level structure is predictable but individual steps need autonomy.
Is Plan-and-Execute considered intermediate?
Plan-and-Execute is generally considered intermediate-level material in the AI and LLM space.