Back
advanced

AI Agents & Autonomous Systems

Multiple agents: divide work only when the boundary helps

Choose useful agent boundaries, define handoff contracts, and evaluate coordination costs and correlated mistakes.

Lesson 31 of 67About 23 min with practice

Three agents agree on an answer. Have you gained three independent pieces of evidence? Only if their work adds independent support. Start by mapping the data and deliverable each worker contributes.

Before you begin: You understand a tool-using agent and shared application state.

An agent here is a model-driven component with a role, context, and permitted actions. Several agents can use the same underlying model. Giving them different names does not make their errors independent.

Find a task that can actually be divided

Suppose a research request needs information from three independent document collections. Separate workers can search those collections in parallel and return evidence. A coordinator can then combine results and identify gaps.

By contrast, asking a planner, thinker, critic, and writer to repeatedly discuss a simple factual question may add little. A single model with a read-only retrieval tool and an explicit output contract is a useful baseline.

Choose agent boundaries around different data access, tools, expertise requirements, or independently checkable deliverables. Boundaries based only on personalities are difficult to evaluate.

Define a handoff as data

A worker should return the task identifier, supported findings, source references, unresolved questions, and status. A coordinator should not have to infer completion from a paragraph that sounds confident.

FieldWhy it matters
Task and scopePrevent work on a different question.
Evidence referencesLet the next stage inspect support.
StatusDistinguish complete, partial, and failed work.
Open questionsPreserve uncertainty through the handoff.

Pass only the context needed for the task. Copying the entire conversation and all credentials to every worker increases cost and access risk. Each tool still enforces the acting user's permissions.

Give shared state one clear owner

Parallel workers can overwrite each other's updates if they all edit a single mutable plan. Prefer separate results keyed by task ID and a coordinator that resolves conflicts deliberately. Use durable state when work must survive restarts.

A worker timeout does not mean its external action never happened. If a worker can change state, use operation identities and recovery procedures. Avoid giving both coordinator and worker responsibility for the same side effect without a clear protocol.

Two agents agreeing is not equivalent to two independent sources agreeing. They may share the same model, prompt, retrieved document, or misconception. A critic adds value when it checks evidence or a concrete invariant, not merely when it produces another opinion.

Remove one worker and predict what disappears

Suppose a coordinator has a catalog reader, a date checker, and a writer. The reader returns records; the checker validates date consistency against those records; the writer produces a response. Remove the checker and ask which failure should become more likely. If you cannot name one, its role may be too vague to evaluate.

How can a critic earn its place?

Give it a specific, testable responsibility such as detecting a date mismatch, and compare systems with and without that check on relevant cases. If ordinary code can perform the same check more reliably, use that as another baseline. A second opinion without a distinct evidence or validation boundary may only add cost.

Keep worker outputs separately so the coordinator can identify the source of a conflict. Then measure both total model usage and elapsed time. Parallel work can improve one while worsening the other; agreement alone measures neither.

Measure the system against a simpler baseline

Compare task success, unsupported claims, latency, total cost, and handoff failures. Parallel work can reduce elapsed time while increasing total model usage. Include unsuccessful tasks in cost accounting rather than reporting only cheap successful examples.

Exercise: three agents independently repeat a false fact found on the same webpage. Does majority voting increase confidence?

Compare your reasoning

Their agreement reflects a shared source, so it adds little independent evidence. Check the source and seek a genuinely independent authoritative reference. Record source provenance so the coordinator can detect this overlap.

Next, build a research workflow whose outputs can be checked claim by claim.

Sources

The LangChain multi-agent documentation describes orchestration patterns. The A2A specification addresses communication between agents; neither source implies that extra agents always improve a task.

Continue: Project: Autonomous Research Agent.

Practice for this lesson

Remove one worker and predict what disappears

Divide work only where the boundary helps, and compare against a simpler baseline.

About 12 min70 points3 checks and one written task
Loading your lesson progress...