By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
You're building a multi-agent system and need to decide what each agent tells the next one. Pass too little and they work blind. Pass everything and you're shipping entire transcripts across every boundary, which gets expensive and slow. The real design challenge isn't picking a framework—it's defining what information actually needs to cross each line.
Message passing is direct: Agent A sends a structured message to Agent B. Shared state or blackboard means both agents read and write to a common store. Artifacts are files or objects—a PDF report, CSV data—that one agent produces and another consumes.
| Approach | Strength | Risk |
|---|---|---|
| Message passing | Explicit, easy to log and test | Message schema must be agreed |
| Shared state | Everyone sees the latest facts | Conflicting writes; agents see data they should not |
| Artifacts (files, documents) | Big or binary outputs travel cleanly | Must track provenance and versions |
Each pattern has trade-offs. Message passing is explicit and auditable but requires you to decide exactly what goes in each message. Shared state is flexible but creates coupling and makes it harder to reason about who changed what. Artifacts work well for large outputs but require agreement on format and location.
Define each handoff like an API. The sender must provide specific information; the receiver returns structured output. This forces clarity on both sides.
// handoff: triage -> billing
{
"goal": "Refund order 4521",
"facts": { "customer_id": "c_81", "order_id": "4521", "amount": 49.0 },
"constraints": ["refunds over 100 need human approval"],
"already_tried": ["checked order status: delivered 3 days ago"],
"expected_output": { "refund_status": "string", "reason": "string" }
}A handoff contract should include the goal (what the receiver is supposed to do), the facts (customer ID, order ID, amounts—the data they need), constraints (refunds over 100 need human approval), what's already been tried (so the receiver doesn't repeat work), and the expected output format (so the next agent or your code can parse it).
Pass a summary and key facts, not the whole transcript. If a triage agent has read 20 emails, the billing agent doesn't need all 20. Include the goal and constraints so the receiver doesn't accidentally undo earlier decisions. Ask for structured output, not free text. Never pass secrets in the message itself; pass references the receiver is authorized to resolve.
A research agent might scrape 40 pages of data. The writer doesn't need all 40 pages in context. Return the distilled result—the summary or key findings—plus a pointer to the full artifact if the writer needs to dig deeper. This keeps context windows manageable and forces you to think about what actually matters at each step.
If you cannot write down the handoff schema, you do not yet understand the boundary.
This is the real test. If you can't define what goes from Agent A to Agent B in a schema or contract, you haven't thought through the boundary clearly enough. The act of writing it down—the fields, types, required vs. optional—forces you to make real decisions instead of hand-waving.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.