Notes

Plan-and-Execute Agent

Ask someone to tidy a garage and they will usually stand back, decide on a rough order of attack, and then work through it. A plan-and-execute agent is built the same way: it writes the whole plan first, then carries out the steps, instead of deciding its next move afresh after every observation.

Two phases, two different jobs
The split is the point:

  • A planner — usually a single, expensive model call — turns the goal into an ordered list of subtasks.
  • An executor works through that list, calling tools for each step, and can be a cheaper or more tightly constrained model.
  • A replanner is consulted when a step fails or returns something the plan did not anticipate.

What it buys and what it costs
Compared with ReAct, which interleaves one thought with one action and so rediscovers its direction every turn, planning up front keeps a long task coherent. The agent cannot drift halfway through because the goal fell out of its context window, and the plan is a readable artefact a human can inspect or approve before anything runs. Token cost drops too, since the full reasoning context is not rebuilt at every step. The weakness is rigidity: a plan written before the first tool call is written in partial ignorance, and an agent that marches through it without replanning will keep executing steps that stopped making sense at step two. Implementations in LangGraph therefore model the plan as mutable state, with an explicit replan edge back to the planner.

A plan-and-execute agent separates deciding from doing: a planner turns the goal into an ordered list of subtasks in one reasoning pass, then an executor works through that list, calling tools step by step. It replans only when a step fails or surprises it. The structure keeps long tasks coherent and cheaper than step-by-step reasoning, and makes the plan inspectable before anything runs — at the cost of flexibility when reality diverges.

There are two ways to cook an unfamiliar meal. You can read one line of the recipe, do it, then read the next. Or you can read the whole recipe first, work out the order, and then get going.

A plan-and-execute agent is software that takes the second approach. Given a goal, it writes out the full list of steps before touching anything, then works down the list.

The advantage is that it does not lose the thread on a long job. The risk is that a plan made in advance can be wrong, so a good one stops and rethinks when a step does not go as expected.