06.01 · Concept
Plan, then execute
Split a task into a plan step and an execution loop, and say when that helps.
Plan-then-execute separates an agent’s high-level reasoning from its tool-using work loop. The model first drafts an ordered route through the task, then an executor performs each action, observes results, and decides whether to continue, revise, or stop. It is useful for dependent, branching work, not obvious single-step tasks.
What this lesson answers
- when should an agent plan before executing
- how to structure a plan execute agent loop
- why can planning make agents worse
Notes
Plan-then-execute means asking the model to first decide what steps are needed, then running those steps one at a time in an execution loop. Instead of giving the model one big prompt like “solve this whole problem,” you separate strategic thinking from tactical action. The plan is the model’s current map of the task; the executor is the part that performs each step, calls tools, observes results, and continues or revises as needed.
A good mental model is a senior engineer writing a short implementation plan before touching production code.
Common questions
- What is the plan-then-execute pattern for agents?
- It is an agent structure where the model first creates a short ordered plan, then a separate execution loop carries out each step. The executor calls tools, reads results, and feeds observations back into the process. The plan gives direction, while execution handles the messy details that appear once tools and real data are involved.
- When is planning worth adding to an agent?
- Planning is worth adding when the task has dependent steps, tool calls, branching choices, or progress that must survive across context. It helps when the agent needs a visible route through the work. It is usually not worth it for direct lookups, simple rewrites, single conversions, or any task where the next action is already clear.
- Does planning make an agent more reliable?
- Planning can make behaviour easier to inspect and steer, but it does not guarantee better results. A poor plan can drive the agent in the wrong direction, and excessive planning adds latency and complexity. The useful design is a compact plan plus feedback from execution, with the option to replan when observations contradict the original route.
Short definition: what is Plan, then execute?