Memory Patterns for Multi-Agent Systems
Three shapes of shared memory in multi-agent systems (isolated, fully shared, scoped shared) and the orchestrator pattern that prevents the race conditions and memory poisoning that come with shared writes.
Multi-agent systems are the next obvious step after "one agent doing one thing." A planner agent decomposes a task. Worker agents execute pieces. A reviewer agent checks the output. Each one has its own context window. Each one needs memory. The shape of that shared memory is what determines whether the system works or thrashes.
Three shapes that show up
1. Fully isolated. Each agent has its own memory store. They share nothing except the messages they exchange. Simplest to reason about; loses all the value of having multiple agents because none of them learn from each other's experience.
2. Fully shared. All agents read/write the same memory namespace. Maximum information flow; also maximum conflict. Two agents writing the same key at the same time produces classic race conditions, and a misbehaving agent can corrupt memory all others depend on.
3. Scoped shared. Each agent has private memory plus access to a shared namespace governed by explicit write rules. The middle path; the one that works in practice.
Designing the shared namespace
- Read-many, write-few. Most agents should be readers. Designate a small number of "writer" agents (or use a dedicated curator agent) that own writes to the shared layer.
- Typed memories with ownership. Every memory carries the agent that created it. Avoids the "who wrote this and why" mystery.
- Conflict resolution policy. When two agents disagree, store both with lineage rather than picking one. The orchestrator can decide later.
- Eviction respects sharing. Do not evict shared memories on the access pattern of one agent; that is a memory leak in the cooperative sense.
The role of an orchestrator
In production multi-agent systems, the cleanest architecture has one orchestrator agent that manages the shared memory namespace. Worker agents read freely but propose writes through the orchestrator, which validates, deduplicates, and adds lineage. This avoids the race conditions of free-for-all writes without losing the benefit of shared learning.
Common failure modes
- Memory poisoning. One agent writes a wrong fact; all others act on it. Provenance + correction lets you trace and undo.
- Echo chambers. Agents reinforce each other's beliefs because they all read from the same memory. Periodic ground-truth checks against external sources help.
- Memory bloat. Each agent contributes; nothing gets pruned. Typed eviction (above) prevents this.
Where Memnode fits
The provenance model maps cleanly to multi-agent: every memory knows which agent wrote it, what it supersedes, and what depends on it. The orchestrator pattern works because writes go through a single API surface that records lineage by default.
When the multi-agent system runs inside a live multiplayer game (each agent owning a different live-ops domain — matchmaking, economy, balance, support), the orchestrator side of the architecture also needs a real-time backend for player/session state. Game Server Backend handles that side of the stack; Memnode handles the agent-memory side. The two pair cleanly for AI-driven live-ops.