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.
| Element | Purpose | Example |
|---|---|---|
| Objective | States the single outcome required | List competitors in the region |
| Inputs | Names the data the step depends on | Output of the search step |
| Assigned executor | Chooses model, tool or subagent | Web search tool |
| Success criterion | Defines when the step is complete | At least five named companies |
| Dependencies | Orders the step relative to others | Runs after query planning |
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.
| Strategy | When the plan is made | Strength | Weakness |
|---|---|---|---|
| Plan-and-execute | Fully before execution | Predictable, easy to review | Brittle when facts change |
| Interleaved (ReAct) | One step at a time | Adapts to new observations | Can wander or loop |
| Plan with replanning | Up front, revised on failure | Balances structure and adaptation | Extra model calls |
| Hierarchical | Recursively across agent levels | Scales to large goals | Coordination overhead |
| Fixed workflow | Designed by developers in advance | Highly reliable | No flexibility for novel tasks |
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.
| Situation | Recommended choice | Reason |
|---|---|---|
| Step fits one tool call | Keep as a single subtask | Splitting adds overhead only |
| Step mixes research and writing | Split by activity | Different tools and checks apply |
| Steps are independent | Run as parallel branches | Reduces total latency |
| Step output cannot be verified | Split or add review | Errors would pass silently |
| Plan exceeds about 15 steps | Group into phases | Long flat plans drift |
Task decomposition and related agent concepts
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.