Shared Memory
A common memory space that multiple agents can read from and write to, enabling coordination and information sharing without direct agent-to-agent communication. Agents post intermediate results, observations, and conclusions. Other agents read from the shared space to inform their own processing.
Also known as the blackboard pattern in classical AI.
Structure
All agents have read and write access to a shared data structure. There is no central controller — agents independently decide when to read and what to contribute. The shared memory becomes the coordination mechanism.
Mechanism
- Write Path
- Read Path
- Lifecycle
- Agents write intermediate results, observations, and conclusions to the shared space
- Writes can be structured (key-value) or unstructured (append-only log)
- Optional namespacing to organize by topic, task, or agent
- Conflict resolution: last-write-wins, merge, or versioned entries
- Write access may be governed by policies (who can write what)
- Agents read relevant sections of shared memory before acting
- Retrieval: full read (small memory), filtered by namespace, or searched by relevance
- Agents may subscribe to changes (event-driven) or poll periodically
- Read access can be scoped — not all agents need to see everything
- Created: When the multi-agent task begins
- Updated: Continuously as agents contribute findings
- Persists: For the duration of the collaborative task (sometimes longer)
- Cleaned up: Summarized or archived when the task completes
- Variants: Blackboard (unstructured), shared state graph (structured), message bus (event-driven)
Key Characteristics
- Decoupled coordination — agents communicate through data, not direct messages
- Asynchronous — agents read and write independently without blocking
- Flexible — any agent can contribute any type of information
- Consistency challenges — concurrent writes can create conflicts
- Only useful in multi-agent systems — single agents don't need shared memory
When to Use
- Multiple agents need to collaborate on a shared task
- Agents should be loosely coupled — no direct inter-agent communication
- Intermediate results from one agent inform another agent's work
- You need a coordination mechanism simpler than a central orchestrator
- The task benefits from asynchronous, incremental contributions from multiple agents