Memory and State Management

Memory and State Management

Shared Agent Memory

30 of 69 in this book · 3 min read

What it is

A memory store that more than one agent reads from and writes to, so that what one agent learned is available to another that was never in the conversation. The storage is the easy half. The difficulty is that an item written by one agent under its own instructions, its own scope, and its own standard of evidence is later read by a different agent that has none of that context and no way to ask for it.

Why it is not shared coordination state

Coordination state is about agreeing on a live situation: who holds the lock, which subtask is claimed, what the plan currently says. It is short-lived, consistency-critical, and meaningless once the run ends. Shared memory is about what was learned; it outlives the run, tolerates staleness, and does not tolerate writes whose author is unknown. Building one with the other's properties gives you either a coordination channel that cannot be audited or a knowledge store with a lock manager bolted onto it.

Why it matters

In a multi-agent system without sharing, every agent rediscovers the same facts, pays for the same failed attempts, and asks the user the same question. With naive sharing, one agent's low-confidence conclusion becomes every other agent's premise within minutes, the uncertainty that qualified it is gone, and the resulting error has no author. The difference between those two outcomes is entirely in the write discipline, not in the store.

Key decisions

  • Whether memory is shared by reference — every agent queries one store — or by transfer, where a handing-over agent selects and passes a subset. Reference scales; transfer keeps the blast radius of a bad write small and makes the selection explicit.
  • Write authority. Which agents may write, which may only read, and whether a specialist agent's conclusions enter the common store directly or go through a reviewing agent or a human.
  • Whether every item carries its author and the instructions that author was running under, so a reader can discount accordingly and a bad writer can be identified later.
  • Namespacing: one common space, per-team spaces, or per-task spaces that are collected when the task ends. This determines whether growth has an owner.
  • What happens when two agents write incompatible items concurrently, and whether the store detects that at all.
  • Whether user-facing and background agents share one store, given that a background agent's writes become things the product says to a person.

Failure modes

  • An agent records a conclusion it held tentatively; three other agents retrieve it as settled fact, and the qualification exists nowhere.
  • Writes carry no author, so when a wrong belief is discovered there is no way to find out which agent produces that class of error or whether it still does.
  • Two agents form a loop: one writes a summary, another reads it and writes a summary of the summary, and the store fills with progressively emptier restatements of one original.
  • The common space is global and an item scoped to one customer is written without the scope key, so it is retrieved during another customer's run.
  • The store is eventually consistent, read-your-writes is assumed, and a handover passes a reference to an item the receiving agent cannot yet see.
  • Everything lands in one namespace that no team owns, so nothing is ever compacted and the growth is attributed to nobody.
  • An agent is given write access for a single experiment, the experiment ends, the access remains, and months of its output is still in the store with nothing marking it as such.

Related capabilities


Applies: Production readiness · Design questions