II · Planning & Control FlowMature★★

Goal Decomposition

also known as Hierarchical Task Network, Goal Setting & Monitoring, Task Tree

Decompose a goal into sub-goals recursively until each leaf is directly actionable.

This pattern helps complete certain larger patterns —

  • specialisesPlan-and-Execute★★Plan all the steps once with a strong model, then execute each step with a cheaper model under the plan.

Context

A team gives an agent a goal that is too large to act on in a single step — renew all cloud contracts before the next quarter, prepare a release across half a dozen repositories, plan a multi-week research investigation. The work decomposes naturally into sub-goals, and those sub-goals decompose further, until eventually each leaf is something the agent can actually do (send an email, run a query, edit one file).

Problem

Without explicit decomposition the agent attacks the whole goal at once and produces shallow work — a three-paragraph summary instead of a finished negotiation, a partial plan instead of a release. Stuck branches deep in the work disappear into the final summary because there is no place to track them. The team is forced to choose between writing the breakdown by hand every time, which negates the agent's autonomy, or trusting a single-shot answer they cannot verify.

Forces

  • Decomposition depth: too shallow loses scaffolding; too deep loses the forest.
  • Sub-goal independence affects parallelisation.
  • Goal-monitoring at each level adds overhead.

Example

A team building a procurement assistant gives it a single brief: 'renew our cloud contracts before Q4'. Asked in one shot, the agent produces a three-paragraph summary and stalls. They wrap the agent in a goal-decomposition tree: the root splits into inventory-current-contracts, gather-renewal-quotes, and negotiate-and-sign, each of which decomposes again until each leaf is a concrete email or spreadsheet update. Progress now shows up at every level, and the negotiate branch surfaces as 'stuck' for two weeks instead of vanishing into the summary.

Diagram

Solution

Therefore:

Build a tree of goals. The root is the user's goal. Each non-leaf goal decomposes into sub-goals. Leaves are directly actionable steps. Monitor progress at each level; surface stuck branches. Distinct from least-to-most (which is sequential) by allowing parallel sibling goals.

What this pattern forbids. Action is taken only at leaf goals; non-leaf goals must decompose further before action.

And the patterns that stand alongside it, or against it —

  • complementsLeast-to-Most PromptingDecompose a hard problem into an ordered list of easier subproblems, then solve them sequentially with each answer feeding the next.
  • complementsHierarchical Agents★★Organise agents in a tree where higher-level agents decompose tasks for lower-level agents, recursively.
  • complementsPre-Flight Spec AuthoringBefore any code is generated, author a multi-pillar spec and have the agent critique it for ambiguity and edge cases, so that the loop executes against a reviewed target rather than a fresh prompt.
  • complementsHybrid HTN + Generative AgentHierarchical Task Network decomposition provides the procedural backbone; the generative LLM is invoked only at leaf nodes for the parts of the task that are genuinely open-ended.
  • complementsBDI Agent★★Agent maintains explicit Beliefs about the world, Desires (goals), and Intentions (committed plans), and reasons by reconciling the three.
  • complementsBehavior Tree Back Chaining·Construct an agent's behavior tree starting from the desired goal condition and recursively adding child nodes whose post-conditions satisfy each parent's pre-conditions.
  • complementsQuery-Decomposition Agent★★An agent whose explicit job is to split an incoming user query into smaller independent sub-queries that can be answered sequentially or in parallel, then merge results.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.

References

Provenance