Overview
When multiple AI agents work together on complex tasks, they need shared memory to coordinate, avoid redundant work, and build on each other's progress. This architecture describes how to design memory systems that enable effective multi-agent collaboration.
The Coordination Challenge
Without Shared Memory
With Shared Memory
Memory Layers
Agent-Private Memory
Each agent's working memory:
Shared Team Memory
Accessible by all agents:
Orchestrator Memory
Coordination layer:
Architecture Design
┌─────────────────────────────────────────────────────────────┐
│ ORCHESTRATOR │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Orchestrator Memory │ │
│ │ - Task queue and status │ │
│ │ - Agent assignments │ │
│ │ - Dependency graph │ │
│ └─────────────────────────────────────────────────────┘ │
└──────────────────────────┬──────────────────────────────────┘
│
┌─────────────────┼─────────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Agent A │ │ Agent B │ │ Agent C │
│Research │ │Analysis │ │Writing │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
│ Private │ Private │ Private
│ Memory │ Memory │ Memory
│ │ │
└────────────┬────┴────┬────────────┘
▼ ▼
┌─────────────────────────┐
│ Shared Team Memory │
│ - Research findings │
│ - Analysis results │
│ - Decisions made │
│ - Fact repository │
└─────────────────────────┘
Coordination Patterns
Publish-Subscribe
Agents publish findings, others subscribe:
Blackboard Pattern
Shared workspace all agents read/write:
Message Passing
Explicit communication between agents:
Memory Operations
Writing to Shared Memory
When an agent has a finding:
shared_memory.add({
"agent_id": "research-agent-1",
"type": "finding",
"content": "Discovered that X relates to Y",
"confidence": 0.85,
"sources": ["doc1", "doc2"],
"timestamp": now(),
"task_id": current_task
})
Reading from Shared Memory
Before starting work:
relevant_context = shared_memory.search(
query=current_task_description,
filters={
"task_id": current_task,
"type": ["finding", "decision", "fact"]
},
exclude_agent=self.id # Don't re-read own outputs
)
Conflict Resolution
When agents disagree:
Task Handoff
Context Package
When handing off work:
Memory Pointer
Don't copy, reference:
Scaling Considerations
Memory Partitioning
For large agent teams:
Consistency Models
Choose appropriate consistency: