16 views
This guide focuses on multi-agent message bus for production systems, with practical trade-offs for reliability, security, and cost.
A shared Google Doc “blackboard” feels collaborative until you cannot prove who wrote which step or why the Implementer ignored the Critic. For production agents, prefer a message bus (SQS / EventBridge) with typed envelopes — and reserve blackboards for read-mostly scratch that is still versioned.
⚡ TL;DR: Use EventBridge/SQS for agent handoffs withrun_id,role,schema_version, and payload hash. Keep a small append-only artifact store for plans/diffs. Prefer bus over shared mutable docs when you need auditability.
multi-agent message bus: production guidance
Blackboards work for short, single-tenant research loops where humans watch live. They fail when multiple writers mutate the same plan section without optimistic locking.python
# blackboard/scratch.py — OK for demos, not for prod apply
class Scratch:
def __init__(self):
self.notes: list[dict] = []
def append(self, role: str, text: str):
self.notes.append({"role": role, "text": text}) # ❌ no hash, no schema
Message bus envelopes
json
{
"run_id": "run_7f3a",
"role": "planner",
"type": "PlanReady",
"schema_version": 3,
"payload_s3": "s3://agent-artifacts/run_7f3a/plan.json",
"payload_sha256": "ab12…",
"ts": "2026-09-11T15:00:00Z"
}
python
✅ Consumers verify SHA before trusting the plan — bus messages stay small and auditable.
# bus/emit.py
import boto3, hashlib, json
eb = boto3.client("events")
s3 = boto3.client("s3")
def emit_plan(run_id: str, plan: dict, bucket: str):
body = json.dumps(plan, sort_keys=True).encode()
key = f"{run_id}/plan.json"
s3.put_object(Bucket=bucket, Key=key, Body=body, ContentType="application/json")
eb.put_events(Entries=[{
"Source": "agents.planner",
"DetailType": "PlanReady",
"Detail": json.dumps({
"run_id": run_id,
"payload_s3": f"s3://{bucket}/{key}",
"payload_sha256": hashlib.sha256(body).hexdigest(),
"schema_version": 3,
}),
"EventBusName": "agent-orchestration",
}])
SQS vs EventBridge
| Need | Prefer |
|---|---|
| Competing consumers / work queues | SQS (+ DLQ) |
| Fan-out (critic + metrics + audit) | EventBridge |
| Exactly-once apply | SQS FIFO + idempotency keys |
| Cross-account notify | EventBridge |
typescript
// consumer/idempotency.ts
const seen = new Set<string>();
export function once(key: string, fn: () => Promise<void>) {
if (seen.has(key)) return; // ✅ at-least-once bus, exactly-once side effect
seen.add(key);
return fn();
}
Closing checklist
- [ ] Typed envelopes with schema_version
- [ ] Artifacts in object storage with content hash
- [ ] DLQ + alarm on poison messages
- [ ] Idempotency keys on apply tools
- [ ] Prefer bus when multiple roles write sequentially
Series navigation
Day 51: Multi-Agent Roles: Planner, Implementer, Critic · Day 53: Avoiding Agent Ping-Pong Last updated September 11, 2026 Related: Multi-Agent Systems: How to Build Agent Teams That Do Not Hallucinate Each Other Into Failure; Day 59: Multi-Agent Eval: Task Suites, Not Vibes; Multi-Agent Systems: Orchestrating Claude, GPT-4o, and Specialized Models Together.Watch: 100 Days of AI on YouTube
Short videos from CheatCoders, one AI engineering topic per day.
Most viewed
- Python Decorators Explained: From Simple Wrappers to Production Patterns
- Claude Code vs Cursor vs GitHub Copilot: Choose by Workflow, and Set Up One Repo That Works With All Three
- AI Agent Frameworks in 2025: LangGraph vs CrewAI vs AutoGen vs Raw API
- Python String Methods: Every str Method With Real Production Examples
- Css Animation Performance: Performance-Optimized Motion for Modern UIs
Newly added
- AWS Systems Manager Parameter Store: Hierarchical Runtime Config for Coding Agents
- Amazon Cognito Identity Pools: Federate Coding-Agent Tool Callers Without Long-Lived Keys
- Amazon Athena for Coding Agents: Query Tool Audit Logs and Eval Traces on S3 Without a Warehouse
- AWS Batch for Coding Agents: Parallel Overnight PR Reviews and Long-Running Jobs Without Lambda Timeouts
- Amazon Bedrock Prompt Management: Version and A/B Test Coding-Agent System Prompts
Deep-dive PDF
Get the expanded guide for this post — extra diagrams-style checklists, failure modes, and a production walkthrough. Free when you subscribe to CheatCoders.
Already subscribed? or open the subscribe page.
Discover more from CheatCoders
Subscribe to get the latest posts sent to your email.
