[ ABORT TO HUD ]
SEQ. 1
SEQ. 2
SEQ. 3
SEQ. 4
SEQ. 5
SEQ. 6
SEQ. 7
SEQ. 8

Agent Communication Protocols

👥 Multi-Agent Systems⏱ 10 min⭐ 90 BASE XP⌨ HANDS-ON LAB

How Agents Talk to Each Other

In multi-agent systems, the way agents share information is as important as the agents themselves. Poor communication patterns lead to lost context, infinite loops, and token explosions.

Communication Patterns

PatternHow It WorksProsConsBest For
Direct MessagingAgent A sends a message directly to Agent BSimple, low latencyTight coupling, hard to scale2-3 agent systems
Shared BlackboardAll agents read/write to a shared stateDecoupled, easy to add agentsRace conditions, coordination neededCollaborative research
Message BusAgents pub/sub to named channelsScalable, asyncComplex setup, ordering issuesEnterprise orchestration
HierarchicalManager agent delegates to worker agentsClear authority, structuredManager as bottleneckTask decomposition
Debate/AdversarialAgents argue opposing positions, a judge decidesHigh-quality decisions3x token costCritical decisions, safety

Shared Blackboard Pattern

// Shared Blackboard Architecture
const blackboard = {
  goal: "Write a technical blog post about RAG",
  research: null,    // ResearcherAgent writes here
  outline: null,     // PlannerAgent writes here  
  draft: null,       // WriterAgent writes here
  feedback: null,    // ReviewerAgent writes here
  status: "researching"
};

// Each agent reads the blackboard, does its job, writes back:
while (blackboard.status !== "complete") {
  const activeAgent = selectAgent(blackboard.status);
  await activeAgent.process(blackboard);
}

The Token Cost Problem

Every time agents communicate, you're burning tokens. A naive 4-agent system that passes full context between agents can use 10-50x more tokens than a single agent. Mitigation strategies:

  • Summarize before passing: Agent A sends a summary, not its full output.
  • Structured handoffs: Use JSON objects with specific fields, not prose.
  • Lazy loading: Agents only request context they actually need.
🎯 Pro Tip: Start with the Hierarchical pattern (one manager + N workers). It's the easiest to debug and the most token-efficient. Only move to more complex patterns when you hit its limitations.
⌨ HANDS-ON LABTest JSON-RPC 2.0 Task Delegation Message
⭐ +150 XP

Dispatch an asynchronous task payload from supervisor agent to worker agent formatted as a JSON-RPC 2.0 request.

1Validate JSON-RPC 2.0 task invocation schema.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 1 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 2
What is the main risk of naive multi-agent communication?
Agents argue too much
Token costs can explode to 10-50x because full context is passed between every agent
Agents become too creative
Network bandwidth issues