Task decomposition

Also known as: goal decomposition

On this page 7

Task decomposition, also called goal decomposition, is the process of breaking a complex objective into smaller, well-defined subtasks whose combined results achieve the original goal. In AI agents, a field of artificial intelligence, task decomposition is the planning step that turns a broad request into a sequence or graph of executable steps that a language model, a tool or a subagent can handle reliably.

Decomposition matters because language models perform best on bounded problems with clear success criteria. A request such as preparing a market analysis is too large for one model call, while finding three sources, extracting figures and drafting a summary are each tractable on their own.

How task decomposition works in an agent

Task decomposition works by having a planner, usually the language model itself, analyze the goal and produce a structured plan of subtasks with their dependencies. Each subtask states what must be done, which input it needs and how its result will be checked. The agent then executes the subtasks in the agent loop and combines their outputs.

The resulting structure can be a linear sequence, a tree in which each subtask splits further, or a directed acyclic graph in which independent subtasks run in parallel. The choice of structure determines how much parallelism is possible and how errors propagate. The table lists the elements a good subtask definition contains.

ElementPurposeExample
ObjectiveStates the single outcome requiredList competitors in the region
InputsNames the data the step depends onOutput of the search step
Assigned executorChooses model, tool or subagentWeb search tool
Success criterionDefines when the step is completeAt least five named companies
DependenciesOrders the step relative to othersRuns after query planning
Elements of a well-formed subtask

Static and dynamic decomposition strategies

Agents decompose tasks either once at the start or continuously during execution, and the strategy shapes both cost and robustness. In static decomposition, used by plan-and-execute agents, the full plan is written before any action is taken. In dynamic decomposition, used by ReAct-style agents, the model decides only the next step after observing the result of the previous one.

Many production systems combine the two: they draft an initial plan, then replan when an observation contradicts an assumption. Hierarchical systems add another layer, in which an orchestrator splits the goal and delegates each branch to a subagent that decomposes its own branch further. The table compares the main strategies.

StrategyWhen the plan is madeStrengthWeakness
Plan-and-executeFully before executionPredictable, easy to reviewBrittle when facts change
Interleaved (ReAct)One step at a timeAdapts to new observationsCan wander or loop
Plan with replanningUp front, revised on failureBalances structure and adaptationExtra model calls
HierarchicalRecursively across agent levelsScales to large goalsCoordination overhead
Fixed workflowDesigned by developers in advanceHighly reliableNo flexibility for novel tasks
Decomposition strategies compared

Choosing the right granularity

The correct granularity is the coarsest level at which each subtask can still be completed and verified in one focused step. Subtasks that are too large reproduce the original difficulty, while subtasks that are too small multiply model calls, latency and the number of hand-offs where context can be lost.

A practical test is whether a subtask has an objective completion check, such as a test passing, a file existing or a value falling within range. When no such check exists, the step usually needs further splitting or a human-in-the-loop review. The decision table below reflects common practice.

SituationRecommended choiceReason
Step fits one tool callKeep as a single subtaskSplitting adds overhead only
Step mixes research and writingSplit by activityDifferent tools and checks apply
Steps are independentRun as parallel branchesReduces total latency
Step output cannot be verifiedSplit or add reviewErrors would pass silently
Plan exceeds about 15 stepsGroup into phasesLong flat plans drift
Granularity decisions

Task decomposition is one part of agent planning, not a synonym for it. Planning also covers selecting tools, estimating cost and deciding when to stop, while decomposition specifically produces the subtask structure. It also differs from agent orchestration, which handles the runtime coordination of whoever executes those subtasks.

In the orchestrator-worker pattern, decomposition is the orchestrator’s main job: the quality of its split determines whether workers receive self-contained instructions or ambiguous fragments. Subagents benefit most when each receives a subtask with its own context, because this keeps the main context window small and focused.

Decomposition also shapes agent evaluation. When each subtask has its own success criterion, a failed run can be traced to the exact step that broke, which makes agent trajectories far easier to debug than a single opaque model response.

Limitations and failure modes

Decomposition introduces its own risks, and experienced practitioners plan for them explicitly. The most serious is error compounding: if each of ten sequential steps succeeds 95 percent of the time, the whole chain succeeds only about 60 percent of the time.

  • Missing steps: the planner omits a prerequisite, so later subtasks fail; validating plans against a checklist helps.
  • Context loss at hand-offs: a subagent lacks constraints known to the planner; pass goals and constraints explicitly.
  • Over-decomposition: trivial goals become many calls, raising cost without improving quality.
  • Stale plans: the agent follows an outdated plan after new evidence appears; trigger replanning on failed checks.
  • Unverifiable integration: subtasks succeed individually but the combined result is inconsistent; add a final synthesis check.

Put simply

Task decomposition is what people do when they face a big job: they write a to-do list. Planning a wedding is overwhelming, but booking a venue, sending invitations and choosing a menu are each manageable.

An AI agent does the same. It turns one big request into a list of small jobs, does them in a sensible order and then puts the results together. The better the list, the better the final result.

In practice

A coding agent receives a request to add CSV export to a reporting page in an existing web application. Instead of writing code immediately, it decomposes the goal into six subtasks: locate the report data function, inspect existing export code, write a CSV serializer, add an endpoint, add a button to the page, and write tests. Each subtask has a check, such as the new unit tests passing.

The serializer and the button are independent, so the agent handles them in parallel branches. When the endpoint test fails because of a missing permission check, the agent replans only that branch instead of restarting. The change is completed in one session with all 12 tests passing, and a developer reviews a small, well-organized set of edits rather than a single large and opaque change.