Agent Architecture and Orchestration
Task Decomposition — Patterns
Task decomposition › Patterns
Every piece carries its own context
Problem. A piece extracted from a larger whole usually loses the material that made it answerable — the definitions, the preceding section, the user's actual objective — and the worker fills the gap with plausible invention.
Approach. Make self-sufficiency an explicit property of the division: each piece ships with the goal restatement, the definitions it needs, and a bounded window of surrounding material. Test the rule by having a worker answer a sample piece with nothing else available and checking whether the answer is defensible.
Trade-off. Carried context is paid for once per piece, so a fine division with generous context can cost more than processing the whole thing undivided. There is a real crossover point and it is worth measuring rather than assuming.
Breadth and depth budgets
Problem. Model-produced divisions have no sense of proportion. A goal phrased broadly expands into dozens of pieces, several of which expand again, and the cost is discovered afterwards.
Approach. Fix a maximum number of pieces per level and a maximum nesting depth before dividing, and give the divider a defined behaviour at the limit: produce coarser pieces, not more of them. Refuse divisions that exceed the budget rather than truncating them, so the failure is visible.
Trade-off. A genuinely large goal hits the ceiling and must be handled as a refusal or by a human raising the limit. Coarser pieces at the boundary are also more likely to exceed a context window, moving the failure rather than removing it.
Declared dependency edges
Problem. Pieces that look independent often are not. One needs an identifier the other produces, or two write the same field. Without declarations, a scheduler assumes independence and the resulting bugs are intermittent and ordering-dependent.
Approach. Require each piece to declare what it reads and what it writes. Build the partial order from those declarations, treat any write-write overlap as a division defect to be rejected before execution, and let the scheduler run only what the declarations prove to be concurrent.
Trade-off. Declarations are only as good as the divider's honesty, and over-declaration serialises work that could have run together. It converts a class of race conditions into a class of conservative scheduling, which is the better trade but not a free one.
Rejoin by structure, not by narrative
Problem. Handing a dozen results to a model with the instruction to combine them produces a fluent summary that silently drops specifics, resolves contradictions by picking one, and cannot be checked against its inputs.
Approach. Require each piece to return a typed result, and perform the combination mechanically — concatenating lists, merging records by key, surfacing contradictions as explicit conflicts rather than resolving them. Use a model only for narrative framing over an already-merged structure.
Trade-off. Typed results constrain what a worker can express, and genuinely prose-shaped work resists it. Mechanical merging also surfaces conflicts that a model would have smoothed over, which means someone now has to decide what to do with them.