Glossary
Task decomposition
Breaking a large goal into smaller subtasks that an AI agent, or a team of agents, can complete and check one at a time.
Task decomposition is the process of breaking a large goal into smaller subtasks that can each be completed and checked on their own. In AI systems it usually means asking a language model to turn a request such as “compare these five vendors” into concrete steps: gather each vendor’s pricing, extract the features, build a table, write the summary. It is the first step of agent planning, and the quality of the split often decides whether an AI agent finishes a long task or loses its way.
Why decomposition helps
Models handle small, well-defined requests far more reliably than large vague ones. Each subtask fits comfortably in the context window, needs only the material relevant to it, and produces an output that can be verified before the next step builds on it. Errors are caught early instead of compounding. Decomposition also exposes which steps are independent, so they can run in parallel, and which depend on earlier results.
How tasks are decomposed
There are three common ways to produce the subtasks.
Method | How it works | Trade-off |
|---|---|---|
Fixed by the developer | Steps are written in code as a pipeline or prompt chain | Predictable, but cannot adapt to unusual inputs |
Model-generated | The model lists the subtasks at the start of the run | Flexible, but the list can be wrong or incomplete |
Recursive | Each subtask is decomposed again until steps are small enough to act on | Handles large goals, at the cost of more model calls |
The fixed approach is prompt chaining and sits closer to a workflow than an agent, a distinction covered in agents vs workflows. Model-generated decomposition is the usual choice for agents, often prompted with chain-of-thought reasoning so the model explains each step. Recursive decomposition is common in deep research agents, where a broad question splits into sub-questions that split again.
Decomposition across agents
In multi-agent systems the subtasks become assignments. A supervisor agent splits the goal and hands each piece to a specialist subagent, either directly or through an agent handoff, then combines the results. The orchestration layer tracks which subtasks are done, which are waiting on others and which failed. Single agent vs multi-agent covers when the extra coordination pays off; for many tasks one agent working through its own list is simpler and cheaper.
Decomposing questions for retrieval
The same idea applies to search. A question such as “how did our refund policy change after the 2025 pricing update?” needs facts from several documents, and a single search rarely finds them all. Query decomposition splits it into sub-queries that are searched separately and then combined, the core of multi-hop retrieval and much of agentic RAG. It is related to query expansion, which adds alternative phrasings of the same question rather than splitting it.
Getting the granularity right
Subtasks that are too large leave the original problem in place. Subtasks that are too small multiply model calls, cost and coordination, and can lose the thread between steps. A practical test is whether each subtask has a clear input, a clear output and a way to tell if it succeeded. Checking each output before moving on is a simple form of self-correction, and scoring finished runs is part of agent evaluation.
Task decomposition with Exabase
Exabase Workers can decompose a job within a run using the scratchpad-todo-write and scratchpad-todo-read tools, and can record subtasks that should outlast the run with the task tools, which store tasks in the Worker’s Base. The Worker tools reference lists both.
On the retrieval side, Deep Search supports multi-query search, so an agent can send several decomposed sub-queries in one call, as described in searching resources. Memory search can expand a query into several retrieval passes with the expandQueries parameter (1 to 5), which helps when the answer spans several memories. The RAG accuracy page covers how sub-document retrieval fits into that picture.
FAQs
What is task decomposition in AI?
Task decomposition is splitting a large goal into smaller subtasks that a model or agent can complete and check one at a time, usually as the first step of planning.
What is the difference between task decomposition and planning?
Decomposition produces the list of subtasks. Planning also decides their order, executes them and revises the list as results come in. See agent planning.
How many subtasks should a task be split into?
Enough that each subtask has a clear input, output and success check. Splitting further adds cost and coordination without making the steps more reliable.
What is query decomposition?
Query decomposition applies the same idea to retrieval: a complex question is split into sub-queries, each searched separately, and the results are combined to answer the original question.
Does task decomposition need multiple agents?
No. A single agent can decompose a task and work through the list itself. Multiple agents help when subtasks need different tools or can run in parallel.
Related pages: Agent planning, Subagents, Supervisor agent, Query decomposition, Multi-hop retrieval, Prompt chaining, Deep research agents, Multi-agent coordination, Agentic search will replace RAG pipelines, CrewAI vs LangGraph, Hierarchical agents, Agentic workflow.