Foundations
Pattern 03 of 26
Planning and Decomposition
Agents that skip planning usually fail twice
An agent without a plan is just pattern-matching its way forward, one tool call at a time. Planning means breaking a complex goal into an ordered set of subtasks, working out what depends on what, and building that structure before anything actually runs. The plan does not need to be perfect. It needs to exist. Agents that skip this fail quietly on tasks with three or more moving parts, and the failure is hard to diagnose because no single step looks wrong.
Why it matters
Planning is what makes agents usable on real work. It is also where the hardest UX problems live. A wrong plan that runs autonomously for ten minutes before you realize it is wrong is an expensive mistake, and the cost is not just compute. It is trust. Getting planning right is what lets you give an agent actual responsibility.
Deep Dive
A planning agent does something specific before any tool gets called: it decomposes the goal. What are the subtasks? Which ones block which others? What does the agent need to know before it can attempt step three? Without this upfront decomposition, the agent is navigating from moment to moment with no map. The difference between an agent that handles simple tasks and one that handles genuinely complex ones is almost always here. Simple tasks do not need a plan. Real work does.
Tree of Thoughts, published at NeurIPS 2023, extended the basic planning idea by letting the model explore multiple reasoning paths at once, backing out of branches that were not working rather than committing to one path. HuggingGPT from Microsoft Research showed something related: a large model acting as a planner over a set of specialized models, decomposing tasks and delegating to whichever model was appropriate for each subtask. The Plan-and-Execute pattern separates the planning step from execution entirely. One model, usually the larger and more capable one, creates the plan. A second model executes each step. That division has real cost benefits and makes the planning logic easier to inspect and fix.
Plans go wrong. The question is whether the agent notices. A planner that generates a correct plan for the stated task but cannot update it when reality diverges is not useful in production. The best implementations build in replanning: after each completed step, the agent checks whether the original plan still makes sense given what it just learned. Sometimes step two returned something unexpected and step three no longer applies. An agent that catches this and adjusts is substantially more reliable than one that does not, though replanning is more expensive. The cost is worth it once the tasks are real enough to matter.