ai agents hierarchical planning
Hierarchical planning splits an agent's work into two distinct levels of reasoning: a high-level planner decomposes a goal into a sequence of sub-goals, and separate execution steps, often handled by a different call or a different agent entirely, carry out each sub-goal's concrete actions. This is a deliberate departure from the flat ReAct loop covered under agent, where a single model reasons and acts one step at a time with no separate layer distinguishing "what are the major phases of this task" from "what's the next concrete action right now" — hierarchical planning adds that missing layer back in explicitly.
The problem hierarchical planning solves is that a flat agent loop's context grows with every single action, and a long task eventually drowns in its own history. An agent doing everything in one continuous ReAct loop carries every tool call and every observation from the entire task in its context the whole time, so a task requiring fifty actions means the model is reasoning about its next step with forty-nine prior steps cluttering the same context window; splitting the task into sub-goals means each sub-goal's execution starts with a comparatively clean context — just that sub-goal's own actions, not the entire task's history — which keeps the model's attention focused on the step actually in front of it rather than diluted across everything that came before.
Letting the plan change mid-execution, rather than locking it in upfront, is what separates a genuinely hierarchical planner from a glorified to-do list. A naive version writes the full sub-goal list once and executes it rigidly regardless of what each step actually finds; a better version treats the plan itself as revisable — if executing sub-goal 2 reveals the original sub-goal 3 no longer makes sense, or a new sub-goal is clearly needed, the planner updates the remaining plan rather than blindly continuing to execute a list that's now based on stale assumptions. This replanning step is exactly the mechanism that lets hierarchical planning handle tasks where the right next phase genuinely depends on what an earlier phase turned up.
The trade-off hierarchical planning makes is coordination overhead in exchange for focus, and that trade only pays off past a certain task complexity. Splitting a simple three-step task into a separate planning phase and separate execution phases adds real overhead — an extra reasoning step just to produce the plan, plus whatever coordination is needed to hand sub-goals off and reassemble their results — overhead that a flat agent loop skips entirely by just doing the three steps directly. Hierarchical planning earns that overhead back specifically on long, multi-phase tasks where a flat loop's growing, unfocused context would otherwise become the actual bottleneck.
Hierarchical planning is the direct answer to a flat agent loop's scaling problem: a single continuous loop works well for short tasks and degrades as task length grows, while splitting the work into planner and executor layers trades some upfront coordination cost for keeping each individual execution step focused on a manageable slice of the overall goal — a trade that becomes worth making exactly when a task is complex enough that a flat loop's context would otherwise become unmanageable.