Order the phases of the Plan-and-Execute pattern from start to finish
- 1Final answer is assembled from completed sub-task results
- 2Executor handles the first sub-task and returns a result
- 3Planner optionally revises the remaining plan based on new observations
- 4Executor handles subsequent sub-tasks using prior results
- 5Planner LLM call: decompose the task into an ordered list of sub-tasks
- 6Receive the user's high level task
Plan and execute receives the goal, plans the whole task up front into ordered sub-tasks, executes each one, replans only when an observation invalidates the plan, then assembles the final answer.
Imagine planning a road trip before you leave. You sit down with a map and write out every stop in order: gas station, lunch town, the hotel, the beach. That whole list is your plan, made before the car even moves. Then you drive, ticking off each stop one by one. Most of the time you just follow the list. But if you hit a closed road, you pull over and redraw the rest of the route, keeping the stops you have already made. You do not replan the entire trip after every single stop, only when something surprising forces you to. When the last stop is done, you have arrived. A plan and execute agent works the same way: it thinks through the whole journey first, then walks the steps, and only redraws the map when reality breaks the plan.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
State the ordered phases, receive the goal, plan all sub-tasks, execute first, execute the rest, replan only on a plan invalidating observation, assemble the answer, then justify why planning sits once up front and contrast the cost and drift tradeoff against a ReAct loop.
Real products, models, and research that use this idea.
- LangGraph ships a plan-and-execute reference agent where a planner node emits an ordered task list and an executor node walks it, looping back to the planner only on a replan signal.
- BabyAGI popularised the task list then execute shape: a planner generates sub-tasks, an executor runs them, and new observations can rewrite the remaining queue.
- A coding agent built on Claude Opus 4.7 as planner and a cheaper Claude model as executor decomposes a feature request into ordered edits, runs each edit, and only replans when a test failure invalidates the plan.
- Plan-and-Solve prompting splits a hard reasoning task into an explicit plan first, then executes the steps, the prompting-level ancestor of the agentic pattern.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhat signal should trigger a replan, and how do you avoid replanning on every step?
QHow does plan and execute compare to ReAct on cost, drift, and debuggability?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Replanning after every single step. That collapses plan and execute into a step by step ReAct loop and throws away the cost savings of generating the plan once.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.