Trees and Leaves: How Agent Swarms Hold Context Without Drift
Large company work takes the shape of a tree. Planner agents split the goal. Worker agents execute the leaves. Here is why that design scales without losing the plot.
Descriptions of large company work naturally take the shape of trees. A goal sits at the root. That goal subdivides into branches. Branches subdivide again until you reach basic units of work: the leaves.
That is not a metaphor I borrowed for a slide. It is how operating work already looks when you write it down honestly: close the books, triage support, refresh a campaign calendar, ship a product change. The root is the outcome. The leaves are the steps someone, or something, has to finish.
When I design agent systems for that work, the swarm has two roles, both organized around the same tree:
- Planner agents, powered by the strongest models available for the job, split a goal into pieces and delegate them.
- Worker agents, generally powered by faster and less expensive models, execute those pieces.
The design is a superset of more rigid orchestration. Rather than imposing a fixed topology on the problem, the swarm's shape grows to cover the problem's contours. Compute and context scale in proportion to the task's complexity.
That is why the same pattern travels across reporting, support triage, marketing activation, data cleanup, and software delivery. The work type changes. The tree does not.
What the tree does for memory
When a single agent takes on a complete task, it has to walk the entire tree itself. It descends to each leaf while holding its ancestors, its current position, and the wider goal in context the whole time.
That is why long-running single agents drift. They can either focus on the work in front of them and lose sight of the bigger picture, or hold the big picture and do a worse job on the piece.
In a swarm, a planner never implements, so its context never fills with low-level detail. A worker never plans, so it can spend all its context on one narrow piece of work.
That separation is the same idea behind context compression: each hop receives only what it needs. The planner keeps the map. The worker keeps the leaf. Neither tries to be the whole company in one window.
How the decomposition looks
Picture a root goal: "Produce this week's operating report." A planner breaks it into branches: pull the source metrics, reconcile exceptions, draft the narrative, prepare the publish packet. Each branch can spawn more planners if the slice is still too large, or hand a leaf to a worker: fetch one KPI slice, classify one exception class, draft one section.
The swarm grows only as deep as the problem requires. A narrow job stays shallow. A messy cross-system job grows more branches. You are not locked into a five-box pipeline that pretends every workflow is the same shape.
Governance still sits at the irreversible line
A tree that scales work is not a blank check for unsupervised action. Irreversible keys stay with humans: approve and send, publish, write to a system of record, merge, deploy, money moves.
Planners can prepare the packet. Workers can assemble the draft. The human still crosses the line. That is how you automate the company and keep the keys.
How to start
Pick one recurring workflow with clear pain. Draw the tree once on a whiteboard. Name the root outcome, the branches, and the leaves. Decide which nodes are planner work and which are worker work. Define the artifact each handoff must emit. Put a human gate on every irreversible step.
If you want help designing that swarm for your stack, explore AI Agents & Automation or start a conversation.
Common questions
What is a planner agent vs a worker agent?
A planner splits a goal into pieces and delegates. A worker executes one narrow piece. Planners should not implement. Workers should not re-plan the whole job.
Why do long-running single agents drift?
One agent has to hold the root goal, every ancestor, and the leaf work in the same context. It either loses the big picture or does a worse job on the piece in front of it.
Does a swarm replace human approval?
No. Agents do the work up to the irreversible line. People still approve send, publish, system-of-record writes, merge, deploy, and money moves.
Where should a company start?
Name one workflow, draw the tree once, assign planner and worker roles, define the handoff each stage must emit, and put a human gate on every irreversible step.