Skip to content
All notes

12 min read

How Manager and Worker AI Agents Work Together

A deep dive into the manager/worker pattern in multi-agent AI systems: how a manager agent decomposes a goal, delegates subtasks to worker agents, coordinates sequential vs parallel execution, handles failures, and integrates results.

#Why a single agent hits a wall

A single AI agent runs a simple loop: read context, decide, act, observe, repeat. That works well for tasks with a clear, narrow scope — answer a question, write a function, summarize a document. It stops working well the moment a task needs more than one skill, more tool calls than fit comfortably in one context window, or more raw material than one agent can hold in its head at once without losing track of the actual goal.

Take something as ordinary as "research three competitors and turn the findings into a comparison report." A single agent doing everything in one continuous run will spend most of its context on raw search results and half-read pages before it ever gets to the writing and reviewing part. Give it every tool it might need — web search, a document reader, a spreadsheet tool, a writing tool, a fact-checker — and its tool list gets so long that it starts reaching for the wrong tool at the wrong moment. Multi-agent systems exist to route around exactly this problem: instead of one generalist doing everything inside a single, ever-growing context, the work is split across several specialists, each with a narrower job, its own clean context window, and its own small tool budget.

#The core pattern: one manager, many workers

The pattern that shows up again and again — in customer-support systems, coding assistants, and research tools — is the manager/worker pattern, also called orchestrator/subagent or supervisor/specialist. It has three moving parts:

  • A manager agent that receives the actual goal from the user, breaks it into subtasks, decides which worker should handle each one, and is ultimately responsible for the final answer.
  • Worker agents, each scoped to a narrower job — a "search agent," a "code agent," a "writer agent" — with their own instructions, their own tools, and their own private context.
  • A coordination layer: the message-passing and status-tracking machinery that lets the manager hand off work and collect results without the two sides needing to share memory directly.

The manager doesn't do the actual work. It decomposes, delegates, and integrates. That division matters because it keeps every agent's context clean: the manager's context fills up with task status and short summaries, never raw search results or full file contents, so it can keep managing a long-running job without ever running out of room. Meanwhile each worker's context fills up only with what its one subtask actually needs.

#Anatomy of a manager agent

A manager's system prompt usually contains three things a worker's prompt doesn't need: a description of which workers exist and when to use each one, a policy for how much detail to ask a worker to return, and a rule for what to do when a worker fails or comes back with something unusable.

Concretely, a manager's loop looks like this:

  1. Read the user's actual goal.
  2. Decide whether it can be handled directly, or needs to be split into subtasks.
  3. If it needs splitting, write a self-contained task spec for each subtask — clear enough that a worker with zero conversation history could pick it up cold and know exactly what's expected.
  4. Dispatch the task specs, either one at a time (sequential) or all at once (parallel).
  5. Read back each worker's result — its final structured answer, not its raw transcript or scratch reasoning.
  6. Decide whether the result is good enough, needs a follow-up task, or needs to be reassigned with a corrected brief.
  7. Once every subtask is resolved, synthesize the final answer for the user.

Notice what the manager never sees: a worker's intermediate tool calls, its false starts, its internal back-and-forth. That's deliberate — the manager's context stays small and focused on orchestration, never execution detail.

#Anatomy of a worker agent

A worker agent is, from its own point of view, just a normal single agent. It receives a task, gets access to whatever tools that task needs, and runs its loop until it's done. It typically has no idea it's part of a larger system unless the manager tells it so directly. In fact, keeping workers "unaware" of the bigger picture is often a deliberate design choice: a worker that only knows "extract every pricing detail from this document" produces a tighter, more reliable result than one that's also carrying the entire multi-week project brief around in its context, half-distracted by goals that aren't its own.

The one extra discipline a worker needs, that a plain standalone agent doesn't, is knowing how to report back cleanly. A worker that returns three paragraphs of narrated reasoning is much harder for a manager to use than one that returns a short, structured result: what was done, what was found, what's uncertain, and what it simply couldn't complete.

#How agents actually talk to each other

This is the part that's easy to over-imagine and is actually fairly mechanical in practice. There's no shared consciousness between a manager and its workers — there's message passing, and it usually takes one of three shapes:

  • Function or tool call. The manager treats "call the research worker" exactly like it would treat "call the weather API": the worker is wrapped as a tool with a defined input schema and a defined output schema. This is the most common pattern today, because it reuses the exact same tool-calling machinery agents already have for everything else.
  • Shared task queue. The manager writes tasks to a queue; workers pull tasks off it, process them, and write results back to a results store. This decouples timing — workers don't need to be running at the exact moment the manager creates a task — and it scales naturally to many workers, but it needs infrastructure (a queue, a results store, retry logic) that a plain tool call doesn't require.
  • Shared blackboard or state. All agents read and write to one shared piece of state — a document, a database record, a whiteboard object — and infer what to do next from what's already there, rather than from a direct instruction addressed to them personally. This shape is less common for pure task delegation and more common for collaborative editing, where several agents converge on one shared artifact over time.

Most production multi-agent systems in use today lean on the first pattern for simple, synchronous delegation, and the second for anything that needs to survive a crash, run at scale, or tolerate a worker being temporarily offline.

#What the handoff actually looks like

Drawing the diagram

Every exchange in that diagram is, underneath, a JSON-RPC-style message over stdio, HTTP, or an event bus. The manager never talks to the underlying tools directly for work it has delegated — it only ever sees the structured result each worker chooses to hand back.

#The task lifecycle, step by step

Zoom into a single subtask, and there's a lifecycle every well-built system follows, whichever coordination shape it uses underneath:

Drawing the diagram

  1. Decompose. The manager turns a broad goal into subtasks that are independently completable — no subtask should silently require the outcome of a sibling it isn't explicitly waiting on.
  2. Specify. Each subtask gets a self-contained brief: goal, constraints, expected output shape, and any inputs the worker actually needs — not "go find out about X," but "read this URL and extract these four fields, in this format."
  3. Assign. The manager picks a worker. Sometimes there's exactly one worker type per skill; sometimes the manager chooses from a pool based on current load or specialization.
  4. Execute. The worker runs its own loop, using its own tools, entirely opaque to the manager until it finishes.
  5. Report. The worker returns a structured result, ideally validated against a schema so the manager doesn't have to parse free text to find what it needs.
  6. Verify. The manager, or a dedicated verifier agent, checks the result against the original brief. This is the step most systems skip early on and regret later — without it, one confidently wrong worker output can quietly poison the final answer.
  7. Integrate or retry. Good enough → fold it into the running answer. Not good enough → reassign with a corrected brief, or escalate to the user rather than guess.

#Four ways to coordinate workers

Sequential. Worker B needs Worker A's output before it can start. This is the simplest shape to reason about and debug, but the slowest — total time is the sum of every step. It's the right default when subtasks genuinely depend on each other, like "outline, then draft, then edit."

Parallel. Independent subtasks fan out at once, and the manager waits for all of them — or the first few that matter — before continuing. Wall-clock time drops sharply, but cost goes up, since every parallel worker burns its own tokens and tool calls at the same time, and it needs a merge step, because the manager now has several results to reconcile instead of one clean sequence.

Hierarchical. For genuinely large jobs, a manager can delegate not to a worker but to another manager, which decomposes further on its own. A top-level "build a market report" manager might delegate "cover the EU market" and "cover the APAC market" each to a regional sub-manager, which in turn delegates individual company research down to workers. This scales well but adds latency at every layer, and makes debugging harder — a bad result three layers down has to bubble back up through two managers before anyone notices it happened.

Blackboard / shared memory. Instead of the manager routing every piece of information by hand, agents read and write to a shared space and react to what changes in it. This fits open-ended, collaborative tasks — several agents converging on one shared document over time — better than it fits discrete task delegation, and it needs careful conflict handling, since two agents can write to the same place at once.

#When not to reach for multiple agents

Coordination isn't free. It costs tokens for every handoff, adds latency at every boundary, and adds real engineering complexity — schemas, retries, verification steps — that a single well-scoped agent simply doesn't need. Skip the multi-agent pattern when the task comfortably fits in one context window, needs exactly one skill from start to finish, or when a human is going to check the output either way, making a second agent's cross-check redundant. The real signal that a job needs splitting isn't "it's hard" — plenty of hard tasks are still one-skill tasks. The signal is that the job needs more than one distinct skill, more raw material than fits in one window, or clearly benefits from running independent sub-parts at the same time instead of one after another.

#What can go wrong, and how it's handled

Multi-agent systems fail in ways single agents simply don't, mostly because there are more places for information to get lost or distorted in transit between agents:

  • Lossy handoffs. A worker's nuanced finding gets flattened into a single line in its report, and the manager makes a decision based on that flattened line — missing the nuance that would have changed it. The fix is stricter output schemas: force the worker to report uncertainty and caveats as structured fields, not as prose the manager might skim past.
  • Silent failure. A worker times out, hits a tool error, or gets a low-confidence result, but still returns something shaped like "done," because that's the shape the manager expects to see. The fix is making failure a first-class return value, not an exception the manager has to notice by its absence.
  • Duplicated work. Two parallel workers independently investigate the same sub-question because the manager's decomposition wasn't as independent as it looked on paper. The fix is a tighter decomposition step up front and, in larger systems, a shared "already covered" ledger both workers can check against.
  • Runaway delegation. A manager that can spawn sub-managers can, if left unbounded, spawn a tree of agents that never converges on an answer. Production systems put hard caps on delegation depth, on the number of parallel workers, and on total token or tool budget per job.
  • Context drift. Over a long-running job, a manager's running summary of what's happened can drift from what actually happened, especially when the summarizing itself is done by another agent under time pressure. Keeping the raw task specs and structured results around — not just the manager's paraphrase of them — gives you something concrete to audit against later.

#Context and memory: what a manager keeps, what a worker keeps

The manager's context is the coordination state: which subtasks exist, their current status, and a short structured result for each — never the workers' full transcripts. A worker's context, in turn, is whatever it needs for its own subtask and nothing more; it typically never sees the user's full original request, the other workers' outputs, or the manager's internal deliberation about how to split the work.

This separation is also what makes multi-agent systems fairly resistant to the "lost in the middle" problem that plagues very long single-agent contexts — no individual agent's context has to grow past what one focused subtask actually requires, no matter how large the overall job becomes.

#A worked example: a research-report agent team

Say the goal is "produce a report comparing three cloud providers' pricing for a specific workload." A manager/worker breakdown might look like this:

  • The manager reads the goal and decomposes it into three identical research subtasks — one per provider — plus one synthesis subtask that depends on all three finishing first.
  • Three research workers run in parallel, each with web search and document-reading tools, each returning a structured pricing breakdown for its one provider — a table of fields, not free-form prose.
  • The manager verifies each result has every required field filled in, re-dispatching any that came back incomplete with a corrected, more specific brief.
  • Once all three are in, the manager dispatches a synthesis subtask — handing over the three structured results, never the workers' raw search transcripts — to a writer worker whose only job is turning structured data into a readable comparison.
  • The manager reviews the draft against the original goal one more time, then returns it to the user.

Every step above stays legible because each agent's job is small enough for a human, or another agent, to actually check it.

#Design principles for building this yourself

  • Push detail down, keep summaries up. Managers should traffic in short structured results; workers should traffic in whatever depth of detail their one subtask genuinely needs.
  • Make failure a value, not an exception. Every worker response needs a way to say "I couldn't do this" that's every bit as structured as a success response — never a silent gap the manager has to infer.
  • Decompose for independence, not just for size. Splitting a task into pieces that still secretly depend on each other creates all of the coordination overhead of a single agent, with none of the parallelism benefit to show for it.
  • Cap everything, explicitly. Depth of sub-delegation, number of parallel workers, total budget per job — bound all of it up front, because "the manager will figure out when to stop" is not a plan.
  • Verify before you integrate. A cheap, targeted sanity check on a worker's output catches more real problems than swapping in a more capable model would, because the check is looking at the exact thing the worker was supposed to produce, rather than re-deriving the answer from scratch.

#Wrapping up

The manager/worker pattern isn't really about making agents "smarter." It's an engineering answer to a scaling problem: keeping each agent's context, tool list, and responsibility small enough to stay reliable, while still being able to tackle jobs too big for any single agent to hold at once. The manager's whole value is in decomposition, delegation, and verification; each worker's whole value is in doing one narrow thing well and reporting back cleanly. In practice, most of what makes these systems actually work is unglamorous — clear task specs, structured outputs, explicit failure states, and hard caps on how far delegation is allowed to run — not anything exotic happening inside the models themselves.

Did this land?

Conversation

Building something like this?

Tell me what you are working on. I reply within a day.

Write to me