Lesson 3 / 25
Planning: Reactive or Plan-and-Execute
Compare deciding step by step with writing a plan first, and know when each fits.
Two ways to decide
A reactive agent picks the next step after each observation: flexible when the path is uncertain. A plan-and-execute agent writes a short plan first, then carries it out and revises when something fails: easier to review and to show the user, and cheaper because most steps need little extra reasoning. Many real agents mix both.
A plan as data
Keeping the plan as structured data lets code track progress and lets a human approve it before anything runs.
{
"goal": "Reconcile last month's expenses",
"steps": [
{ "id": 1, "do": "fetch_expenses(month=\"2026-09\")", "status": "done" },
{ "id": 2, "do": "match_receipts()", "status": "doing" },
{ "id": 3, "do": "flag_mismatches()", "status": "todo" },
{ "id": 4, "do": "write_report()", "status": "todo" }
]
}Let people edit the plan
Showing the plan before running it lets a user fix a wrong assumption in seconds, which is much cheaper than discovering it after ten tool calls. Re-plan when a step fails instead of pushing on.
Quick check: What is a benefit of plan-and-execute?
- It always uses more tokens
- It needs no model
- It removes all errors
- The plan can be reviewed before it runs
Answer
The plan can be reviewed before it runs — An explicit plan is visible and can be approved or corrected up front.