Ask anyone who has taken a multi-agent system past the demo stage what hurt the most, and you'll hear the same word: memory. How do agents share state? How do you resolve a conflict when two agents update the same fact? How do you make sure something one agent learned is discoverable by another without hand-wiring the connection? These feel like frontier AI questions. They aren't. They're distributed systems problems wearing a trench coat, and the teams that treat them that way are the ones whose agents survive contact with production.
This follows directly from a point we made in an earlier post: an AI agent is, in essence, a backend microservice with an inference layer. If that's true, then a fleet of agents sharing what they know is a distributed datastore, and everything we learned the hard way about distributed datastores (consistency, isolation, provenance, conflict resolution, discovery) comes back to collect its debt.
Why It Feels Solved (And Why That's the Trap)
At small scale, memory genuinely looks solved. One agent, one user. You append facts to a markdown file or a single vector index, embed the incoming query, pull the top-k nearest chunks, and stuff them into the context window. It works. It demos beautifully.
The problem is that every hard part of memory is hidden by that setup. There's no second writer, so there are no write conflicts. There's one reader, so there's no question of who's allowed to see what. Facts are fresh because you just wrote them, so staleness never bites. And "discoverability" is trivial because there's only one store to search. Easy to start, brutal to scale. The moment you add a second agent, a hundred facts a day, or a need to recall something from three weeks ago in a different context, all four of those hidden problems show up at once. Gartner logged a 1,445% surge in multi-agent inquiries between early 2024 and mid-2025; a lot of those inquiries are teams hitting this wall.
The core mistake is treating memory as an AI feature (something the model does) when it's really infrastructure that the model happens to read from and write to. You don't prompt-engineer your way out of a consistency bug.
First, What "Memory" Actually Means
Before topology and conflicts, it helps to be precise about the word, because "memory" is doing a lot of work. Borrowing from cognitive science, agent memory splits into four kinds, and they have very different engineering demands:
| Memory type | What it holds | Backend equivalent |
|---|---|---|
| Working (in-context) | The live reasoning for the current turn: the context window itself | Process RAM / request stack |
| Episodic | What happened: past tasks, interactions, outcomes | Event log / append-only store |
| Semantic | What is true: facts, preferences, world knowledge | Database / knowledge base |
| Procedural | How to do things: workflows, tool-use patterns, policies | Code / config / runbooks |
The clean way to hold it: procedural memory says how, semantic memory says what the policy is, episodic memory says what happened, and working memory holds the live thread. Almost all of the pain in multi-agent systems lives in the semantic layer (the shared, long-lived facts) because that's the one multiple agents both read and write. Two agents rarely fight over each other's working memory. They fight constantly over "what is the customer's current shipping address."
Question 1: Where Does Shared State Live?
This is the first architecture decision, and it's the one that's hardest to walk back later. There are three topologies, and real systems almost always converge on the third.
Local memory + message passing
Each agent keeps its own private store and shares by explicitly sending messages. This is where most frameworks start. It's simple and isolates cleanly, but it degrades fast: redundant work because agents can't see each other's results, fragmented context, and communication overhead that grows with the square of the number of agents. It's the microservices-with-no-shared-database pattern, and it hits the same limits.
Centralized shared memory (the blackboard)
One store (a global vector index, a shared document, a classic blackboard) that every agent reads from and writes to. This buys you joint attention, kills duplication, and makes long-horizon coordination possible. The cost is that it's a consistency bottleneck and a single point of contention: every agent reading and writing the same place resurrects the textbook problems of visibility, ordering, and write contention. Great for small teams (under ~5 agents); it bottlenecks as you scale out.
Hybrid: local perception, shared world-state
The pattern production systems settle on: each agent keeps private working and episodic memory, and a governed shared tier holds the summarized, agreed-upon world-state. Strong consistency where it matters (the shared facts), eventual consistency where it doesn't (each agent's scratch space). Anthropic's own multi-agent research system is essentially this: a lead agent holds the plan and overall state, spawns subagents that each explore with their own private context window, and the lead persists the plan to shared memory before context fills so it survives truncation past 200K tokens. That setup beat single-agent Claude Opus 4 by 90.2% on their internal research eval, at roughly 15× the tokens. Memory architecture is what made the parallelism pay off instead of collapsing into chaos.
| Topology | Best for | The tradeoff |
|---|---|---|
| Local + messaging | Few agents, strong isolation needs | Redundancy, fragmented context, O(n²) chatter |
| Centralized / blackboard | Small teams, simple orchestration | Strong consistency but bottlenecks and contention |
| Hybrid (recommended) | Most production workflows | More moving parts; you manage two consistency regimes |
The Four Ways Shared Memory Rots
Once more than one agent touches the same store, recent work on governed shared memory identifies four failure modes. They map almost one-to-one onto classic distributed data failures, which is exactly the point.
- Unauthorized leakage. An agent retrieves memory outside its scope: a support agent reads finance-only notes. This is a tenant-isolation and privacy violation, the agent version of a missing row-level security check.
- Stale propagation. An update fails to reach everyone. One agent reads an old shipping address while another already updated it. This is cache invalidation, and it's still one of the two hard things.
- Contradiction persistence. Two conflicting facts coexist and stay retrievable, because append-only stores have no notion of one fact superseding another. Both "the user prefers email" and "the user prefers SMS" come back, and nothing downstream knows which to trust.
- Provenance collapse. A retrieved fact can't be traced to who wrote it or when. Once you can't answer "where did this come from," you can't debug, audit, or govern the system, and a single hallucinated detail can propagate downstream as ground truth with no way to find the source.
The uncomfortable takeaway from that research: long-context retrieval alone is not enough for production. Bigger context windows and better embeddings do nothing for any of these four. They're systems problems, and they need systems-level abstractions.
Question 2: Resolving Conflicts When Two Agents Update the Same Fact
This is the question that separates toys from systems. When two agents write incompatible values for the same knowledge, "the model will figure it out" is not an answer. Here are the strategies that actually work, roughly in order of how much coordination they demand.
Temporal supersession (last-writer-wins, done properly)
Stop appending facts as equals. Give every memory a creation timestamp and let later writes explicitly supersede or invalidate earlier ones, with a supersession reference and a contradiction marker. Retrieval then resolves to the current fact instead of returning a pile of contradictory history. This is the single highest- leverage change most teams can make, and it's just versioned records with a validity window, nothing exotic.
Authority / priority ordering
Not all writers are equal. Resolve conflicts by role, recency, or confidence: a specialist agent's assessment overrides a generalist's; a human confirmation overrides both. This is straightforward to implement and maps cleanly onto how organizations already resolve disagreements: by who owns the decision.
CRDTs: make convergence part of the data model
When you genuinely need agents to write concurrently without a coordinator (parallel planners, executors, critics), reach for Conflict-free Replicated Data Types. CRDTs guarantee strong eventual consistency: every replica that has seen the same set of updates converges to the same state, regardless of the order they arrived in, with no locks and no consensus round. Locks don't scale and a central coordinator kills the parallelism you built the fleet to get; CRDTs push conflict resolution down into the data structure itself, often using vector clocks to reason about causality. The tradeoff is that "eventually consistent, in a merge order you don't fully control" is a real constraint: fine for a shared scratchpad or a merged set of findings, not for anything that needs a single authoritative answer at read time.
Orchestrator serialization
The pragmatic default for anything that needs one true answer: route all writes to a given fact through a single designated role (the lead agent, a memory service) that serializes them. You trade some parallelism for a clean invariant: no concurrent writes, no merge ambiguity. Most hybrid systems use this for their authoritative shared tier and reserve CRDTs for the collaborative, low-stakes surfaces.
| Strategy | Use when | Cost |
|---|---|---|
| Temporal supersession | Almost always: the baseline | You must track validity, not just append |
| Authority / priority | Roles have clear precedence | You have to define and maintain the hierarchy |
| CRDTs | Concurrent writes, no coordinator, low-stakes merge | Eventual consistency; limited merge control |
| Orchestrator serialization | One authoritative answer required | Throughput bottleneck at the serializer |
One production gotcha worth stealing: watch the order of your write pipeline. In one documented system, a synchronous near-duplicate filter ran before the asynchronous contradiction detector, and since "X is A" and "X is B" are nearly identical as text, the dedupe gate silently swallowed the very contradictions the system was supposed to catch. Correctness bugs in memory hide in the plumbing, not the model.
Question 3: Discoverability Without Hand-Wiring
The subtlest question of the three. It's not enough to store a fact: a fact one agent learns has to be findable by another agent that never knew to look for it, without you hard-coding "when Agent A learns X, tell Agent B." Hand-wiring every path doesn't scale past a handful of agents. Three mechanisms, layered, get you there.
Hybrid retrieval: vectors + graph + keys
No single index answers every question. Vector search nails fuzzy semantic recall ("what do we know about this customer's frustration?") with zero cold-start. A knowledge graph gives you deterministic, explainable multi-hop traversal ("which invoices link to this account's parent org?"). Key-value gives you fast exact lookups. Production systems run them together and fuse the results: classic keyword (BM25) for exact matches, vectors for intent, merged with something like reciprocal rank fusion. The discoverability win is that any agent, in any framework, queries the same memory layer and finds the fact on semantic merit, not because someone routed it there by hand.
Transactive memory: know who knows what
Humans in a team don't memorize everything; they remember who to ask. Agents can do the same. Instead of every agent duplicating every fact, agents learn a directory of capabilities: the support agent doesn't cache payment data, it knows the billing agent owns it and queries it on demand. This cuts duplication (and therefore staleness) and makes the system's knowledge composable rather than copied.
Registry-based discovery
Back the whole thing with an agent registry that stores each agent's metadata, capabilities, and endpoints, the direct descendant of service discovery from microservices. New agents register; existing agents discover them at runtime. No hard-coded dependencies, no redeploy to teach the fleet about a new specialist. This is the piece that lets the system grow without every addition becoming a wiring project.
Governance Is Not Optional
Tying the three questions together is governance, and it's the part demos skip entirely. The research converges on a few non-negotiables for any shared memory that outlives a single session:
- Scoped retrieval. Every memory carries a scope (agent-local, team-shared, tenant-global, restricted) and every retrieval path enforces it. The subtle bug here is real: one documented system enforced scope on search but forgot it on the plain get-by-id handler. Enforce scope uniformly across every path, or you haven't enforced it.
- Explicit provenance. Store writer identity, source, and modification lineage on every fact. If you can't reconstruct where a fact came from, you can't debug the four failure modes above.
- Temporal correctness. Timestamps, supersession links, and confidence states, so "current" is a query you can actually answer.
- Policy-governed retrieval. Retrieval is a pipeline, not a similarity search: generate candidates, filter by policy, resolve temporally, enrich with provenance, then rank. Similarity is step one of five.
What the Teams That Get This Right Actually Do
Pulling it into a checklist you can hold a design against:
- Design the memory system before the agents. Answer three questions on day one: where does shared state live, who can access what, and how are disagreements resolved. Scoping decisions made early are painful to restructure later.
- Separate persistent from working memory. Facts that must survive sessions are infrastructure; the context window is scratch. Over-storing degrades retrieval with noise: not everything the agent sees deserves to be remembered.
- Go hybrid on topology. Private local memory per agent, a governed shared tier for agreed world-state. Strong consistency for the shared facts, eventual for the rest.
- Make supersession the default, not append. Every fact gets a timestamp and can be overridden. This alone kills contradiction persistence.
- Serialize the writes that need one answer; CRDT the ones that don't. Match the consistency model to the stakes of each surface.
- Retrieve with a hybrid index and a policy pipeline. Vectors plus graph plus keys, filtered by scope and resolved by recency, never similarity alone.
- Put a registry and transactive memory between agents. Let agents discover capabilities and ask the owner, instead of copying facts and hard-wiring routes.
- Add validation checkpoints before propagation. Catch a bad fact before it becomes everyone's ground truth.
Closing Thoughts
Memory is the biggest tarpit in agents precisely because it masquerades as an AI problem. The vector search and the LLM are the easy 20%. The hard 80% (consistency across writers, resolving contradictions, scoped access, provenance, discovery without hand-wiring) is distributed systems, and we've been building that discipline for decades. Databases solved conflict resolution with versioning and MVCC. Distributed systems solved convergence with CRDTs and consensus. Microservices solved discovery with registries. Agent memory doesn't need those ideas reinvented; it needs them applied.
Which is the same conclusion we keep arriving at from every direction: making agents reliable is an architecture problem, not a model problem. A stronger model won't save a memory layer that has no notion of who wrote a fact, when it stopped being true, or who's allowed to read it. The teams shipping agents that actually work aren't the ones with the cleverest prompts. They're the ones who looked at their fleet's memory, recognized a distributed datastore, and built it like one.
References & further reading:
Governed Shared Memory for Multi-Agent LLM Systems ·
Mem0: Designing Multi-Agent Memory Systems for Production ·
MongoDB: Why Multi-Agent Systems Need Memory Engineering ·
Anthropic: How We Built Our Multi-Agent Research System ·
Letta / MemGPT: LLMs as an operating system for memory ·
Vector Databases vs. Graph RAG for Agent Memory