AI Agents, Evergreen

How AI Agents Perform Planning and Task Decomposition

A worried cartoon robot examines an AI agent plan with step 4 missing, under the headline One Missing Step.

An AI agent that only reacts to the latest observation can handle a single lookup or a short, predictable job. It struggles when a goal needs several dependent steps, information gathered before a decision, or recovery when a step fails. That is where planning and task decomposition comes in: the agent turns one goal into ordered subtasks, each with inputs, an expected outcome, and a way to tell whether it is done, then works through those subtasks while revising the plan when reality disagrees. This article explains what that decomposition means, the step-by-step method, the main techniques, how to judge granularity and ordering, and how agents recover when a decomposition goes wrong.

What planning and task decomposition mean in an agent

Planning is the commitment to a multi-step course of action. It is easy to confuse with two neighbouring jobs. Reasoning decides what to do now, given the current observation. Tool use is the doing itself: calling an interface, running a search, or writing a file. Planning sits above both: given the goal, what is the sequence of actions that gets there, and how will the agent know when to change it?

A subtask is the unit planning works with. A useful subtask has an objective stated as what it must produce, inputs it needs, an expected outcome, and a completion criterion. A step such as “research the options” fails that test, because it does not say what counts as enough research. A step such as “return a comparison of three tools on price, integrations, and offline support, with a source for each price” can be checked.

An explicit decomposition buys three things: inspectability, so a human or another component can read the intended sequence; dependency handling, so independent work can run in parallel and dependent work waits; and localised recovery, so a failure maps to one subtask instead of forcing a restart. Anthropic makes a related point in its guidance on building effective agents: agents should gain ground truth from the environment at each step, such as tool call results or code execution, to assess progress. A decomposition gives each of those checks a place to land.

Planning and task decomposition, step by step

A cartoon robot checks items off a clipboard as one large goal block becomes small ordered blocks on a conveyor.

One common upfront-planning workflow follows this order; ADaPT and ReAct depart from it, decomposing or revising during execution. The Plan-and-Solve work describes it in its simplest form: first devise a plan that divides the task into smaller subtasks, then carry out the subtasks according to the plan. It was designed to address missing-step errors in step-by-step reasoning, where a model skips a necessary step without noticing. An explicit plan is a defence against exactly that failure.

First, interpret the goal and surface what it does not say. Most goals are underspecified: a request to recommend a tool says nothing about budget, team size, or required integrations. Those hidden constraints must become explicit requirements, and missing information must be obtained by a subtask or a question to the user, rather than guessed by a later step. Next, break the goal into subtasks stated as outputs, and check completeness: taken together, do they cover the goal, with no output the goal needs that no step produces?

Then order the subtasks and map dependencies. A comparison depends on the steps that gathered the evidence. Subtasks can run concurrently when their prerequisites are satisfied and they do not depend on one another; sharing an already-completed prerequisite does not prevent parallel execution. That is the sectioning pattern Anthropic describes for parallelization. In an upfront plan, each subtask is then assigned its tools and information, its completion criterion, and a fallback decided before execution: if a source is unavailable, what happens instead? Finally, in this workflow, check the decomposition for missing steps before execution starts. That check is recommended; whether it saves cost depends on the task.

Decomposition techniques agents actually use

The first technique is hierarchical, top-down decomposition: a goal is broken into sub-goals, each into smaller tasks, until the remaining tasks are directly executable. Hierarchical task network planning is the classical form: abstract tasks are decomposed by methods into ordered subtasks, and primitive actions have preconditions and effects. A 2026 preprint, HTN-Orchestrate, applies the same structure to multi-agent work, with a planner that maintains subtask hierarchies and dependencies and defers decomposing a task until its prerequisite results are available. Its benchmark claims should be treated as unconfirmed until replicated, but deferring a decomposition decision until the evidence it depends on exists is a useful contrast to planning everything upfront.

The second is sequential refinement, or least-to-most decomposition. The agent reduces a complex problem to simpler subproblems, then solves them in sequence, each solution built on earlier answers. The least-to-most paper presents this as two stages, both done by prompting, with no training. In its experiments it generalised to harder problems than the examples shown, reaching at least 99 percent accuracy on a compositional generalisation benchmark with one model, compared with 16 percent for chain-of-thought prompting. Those figures are benchmark- and model-specific; they show ordered decomposition can help on tasks that split into dependent, checkable steps, not that it always helps.

The third represents the plan as a task graph: subtasks are nodes, dependency edges say which results a node needs, independent nodes can run in parallel, and execution follows dependency order. A secondary explainer of this pattern warns of two risks: a model-generated graph can contain a cycle, where two tasks each wait for the other, and merging many parallel results can overflow the available context. Both argue for validating the graph before execution. The fourth expresses the plan as code. In the CodeAct framework, executable Python code is the agent’s action space, integrated with an interpreter, so code actions can be executed and revised when new observations arrive. Code carries control flow and data dependencies directly, and the interpreter gives immediate external feedback. Across 17 language models, CodeAct reached up to 20 percent higher success rates than the alternatives tested, on specific benchmarks.

The fifth decomposes inside the reasoning loop. In the ReAct pattern, the model generates reasoning traces and task-specific actions in an interleaved manner, so the plan is created, maintained, and adjusted as observations arrive. Reasoning traces help the model track and update its plan and handle exceptions, while actions gather information that grounds the next round of reasoning. ReAct outperformed imitation and reinforcement learning methods by 34 percentage points on one interactive benchmark and 10 on another, using only one or two in-context examples. Interleaving supports adaptation as observations arrive, and auditing may be harder when the implementation does not expose a persistent plan.

These techniques combine. An agent may decompose upfront, run an interleaved loop inside each subtask, and replan when a subtask fails. An orchestrator-workers design, described by Anthropic, adds another shape: a central model dynamically breaks down tasks, delegates them to worker models, and synthesises results, with subtasks determined by the orchestrator based on the specific input rather than fixed in advance. The choice depends on how much of the plan can be known before execution and how much must be discovered by acting.

Choosing subtask granularity and ordering

Granularity is an important judgement in whether a decomposition works. A subtask that is too coarse hides sub-steps: “analyse the data” can conceal five operations, and a plan listing it as one node can appear complete while its hidden work was never done. A subtask that is too fine can add cost and fragility, depending on implementation, through possible extra calls and context to carry. Anthropic’s guidance points the same way from the cost side: agentic systems trade latency and cost for better performance, so complexity should be added only when it demonstrably improves outcomes.

A good subtask has one purpose, clear inputs and outputs, and a checkable done condition. If two reviewers could reasonably disagree about whether it is finished, that may mean it is under-specified. Ordering follows dependencies: a subtask runs after the steps that produce its inputs. Granularity should follow risk. Reversible actions, such as a search, can stay coarse and be retried cheaply. Costly or hard-to-reverse actions deserve finer decomposition, explicit checks, and a fallback. The ADaPT work gives this an adaptive form for its setting: decompose a task further only when the executor cannot execute it, recursively. That executor-failure trigger is ADaPT’s rule, not a universal stopping rule. Its analysis found the average maximum decomposition depth used rose as task complexity rose. A practical heuristic is to decompose until each subtask is executable and checkable, weighing verification cost, risk, and auditability; further decomposition can still help auditability.

A worked decomposition: one goal, two granularities

Consider a realistic goal, constructed here as an illustrative example rather than a documented real case: recommend one project-management tool for a 12-person remote team, with a budget ceiling, three required integrations, and a need for offline access on mobile. Coarsely decomposed, the plan has four subtasks: gather requirements, shortlist tools, compare the shortlist, and recommend one tool. It looks complete, and it hides the work that decides success. Gathering requirements hides confirming the budget and integration list. Comparing the shortlist hides verifying each price, testing whether each integration exists, and checking offline support separately from a marketing claim. A coarse representation does not expose those checks to the plan reviewer and may conceal omissions, although a coarse subtask can still check internal operations during execution.

Refined, the comparison expands into subtasks that verify price from vendor pages, verify each integration from vendor documentation, and check offline mobile support, recording what works offline and what does not. Each has an input, an expected output, a dependency, and a fallback: if a price cannot be verified, mark it unverified rather than estimating it; if an integration cannot be verified, mark it unknown rather than inferring it exists. The JSON below shows the refined plan as an illustrative representation, in the shape a planner-executor design might use. It is not code for a specific framework, and field names differ between frameworks.

{
  "goal": "Recommend one project-management tool for a 12-person remote team",
  "steps": [
    {
      "id": "s1",
      "action": "confirm_requirements",
      "inputs": {"team_size": 12, "budget_ceiling": "to be confirmed", "required_integrations": ["to be confirmed"], "offline_requirement": "mobile offline access"},
      "expected_outcome": "Confirmed budget, integration list, and offline requirement",
      "fallback": "If a requirement cannot be confirmed, record it as unconfirmed and do not proceed"
    },
    {
      "id": "s2",
      "action": "shortlist_tools",
      "inputs": {"requirements": "s1.output"},
      "depends_on": ["s1"],
      "expected_outcome": "Three candidate tools that plausibly meet the requirements",
      "fallback": "If fewer than three candidates are found, widen the search and record why"
    },
    {
      "id": "s3",
      "action": "verify_prices",
      "inputs": {"candidates": "s2.output"},
      "depends_on": ["s2"],
      "expected_outcome": "A price for each candidate with a vendor source",
      "fallback": "If a price cannot be verified, mark it unverified rather than estimating it"
    },
    {
      "id": "s4",
      "action": "verify_integrations_and_offline",
      "inputs": {"candidates": "s2.output"},
      "depends_on": ["s2"],
      "expected_outcome": "Verified integration and offline status for each candidate",
      "fallback": "If a status cannot be verified, mark it unknown rather than inferring it"
    },
    {
      "id": "s5",
      "action": "recommend",
      "inputs": {"prices": "s3.output", "verification": "s4.output"},
      "depends_on": ["s3", "s4"],
      "expected_outcome": "One recommendation with verified facts and any failed requirement recorded",
      "fallback": "If no candidate meets every requirement, recommend the closest fit and state which requirement fails"
    }
  ]
}

Refinement adds explicit dependencies, so the recommendation cannot run before prices and verification exist, and fallbacks decided in advance. It stays readable because refinement happened inside one subtask, not by rewriting the whole plan.

When decomposition goes wrong and how agents recover

A cartoon robot replaces a cracked block in a chain of plan steps, with a loop arrow showing replanning after a failure.

Decomposition fails in recognisable ways: a missing step, wrong ordering where a subtask runs before its inputs exist and fills the gap with a guess, and under-specification where a subtask with no completion criterion can end at any point and still look finished. Each is a defect in the plan, and a pre-execution check may catch it before execution; whether catching it there saves cost depends on the task and on the cost of the check itself. When a defective subtask executes, its error can compound along affected dependency paths, and may remain undetected without suitable validation or environmental feedback. Anthropic warns that autonomy brings higher costs and the potential for compounding errors, and recommends testing in sandboxed environments with guardrails. Per-subtask verification is one important defence of that kind, alongside tool feedback and later validation.

Plans also go stale as new information arrives: a price changes, a source disappears, a requirement is revised. Replanning should be triggered, not improvised. Useful triggers are a failed subtask, an observation contradicting a plan assumption, and new information changing which subtasks are needed. ADaPT embodies the triggered form: when the executor reports it cannot execute a subtask, the planner decomposes that subtask further, recursively, rather than replanning the whole task. Where possible, revision should stay local: revise the affected subtasks and their dependents, keep the subtasks that succeeded, and record what changed and why.

How much decomposition your task needs

Four factors decide how much decomposition a task warrants. Task horizon: longer sequences with more dependencies repay planning, while a short predictable job may need none. Environment dynamism: stable environments reward upfront decomposition, volatile ones reward interleaved planning and fast replanning. Cost of a wrong action: reversible actions can be tried and revised, irreversible ones deserve verified plans. Auditability: settings where a human must approve or review the plan push toward an explicit, persisted artifact rather than a plan that exists only inside a reasoning trace.

Three mistakes recur: over-planning a volatile task, so the plan goes stale faster than it can be revised; under-planning a long deterministic workflow, letting a reactive loop wander through what could have been a checklist; and a plan with no replanning trigger, leaving the agent retrying the same failing subtask or drifting off-plan. A short checklist before building helps: can the goal be stated as required outputs; does every required output have a producing subtask; does every subtask have a checkable done condition and a fallback; and is there a defined trigger for revising the plan? If any answer is no, treat the decomposition as a draft to revisit and record whether the gap is genuine or a deliberate choice. Planning and task decomposition is valuable when the decomposition is explicit enough to check, ordered enough to execute, and revisable enough to survive contact with the task it describes.