Start here

Multi-agent memory: shared context without shared confusion

Multi-agent memory is a scoped coordination system, not one global transcript. Each agent needs private working memory, the team needs selected shared facts and decisions, and the application needs explicit ownership for writes, conflicts and deletion. Without those boundaries, agents amplify stale context, duplicate work and leak private information.

Updated November 3, 202612 min readAI Memory field guide
A network of specialized agent cores connected to a shared memory plane while retaining private violet memory vaults.

What is multi-agent memory?

Multi-agent memory is the set of shared and private records that lets several agents coordinate a task without replaying every transcript through every role. It includes working state for the active run, durable facts and decisions visible to selected agents, and private context used only by one specialist.

The problem is different from single-agent memory because several writers can produce conflicting values at the same time. The architecture must answer who may write, which memory is authoritative, who can read it and how a handoff carries only the context the next agent needs.

Which memory should agents share and which should stay private?

Share approved facts and decisions needed for coordination. Keep temporary reasoning, failed hypotheses and specialist-specific context private by default. A shared blackboard filled with every intermediate thought creates context pollution and increases the impact of one incorrect agent.

MemoryRecommended scopeWhy
Current task and completion statusRun or teamAll coordinating agents need progress and ownership
Approved architecture decisionProject or accountShould remain stable across agents and handoffs
Agent scratchpadAgent + sessionUseful only while that specialist reasons
Failed attemptTask episode, selected readersPrevents repeated work without becoming a global rule
User preferenceTenant + userMay be visible to multiple products after policy approval
Credential or payment dataDo not storeUse the authoritative secure system

How should memory move between agents during a handoff?

A handoff should transfer an explicit package: task, current state, approved facts, unresolved questions, source references and the next expected action. It should not dump the sender’s full context window into the receiver. The receiving agent must know which claims are data, which are instructions and which are still uncertain.

Prefer a shared run record for coordination and bounded memory retrieval for relevant history. If the receiver needs a fact that is not in the handoff package, it can query the same scoped memory service rather than ask another model to summarize the entire conversation.

Structured handoff packagetypescript
type Handoff = {
  taskId: string;
  objective: string;
  completedSteps: string[];
  approvedFacts: MemoryRef[];
  unresolvedQuestions: string[];
  blockedActions: string[];
  nextAgent: string;
  sourceIds: string[];
};

await runStore.writeHandoff(taskId, handoff);
await memory.recordEpisode({
  tenantId,
  userId,
  agentId: 'planner',
  taskId,
  kind: 'handoff',
  summary: 'Planner handed implementation to coding agent.',
  sourceIds: handoff.sourceIds,
});

How do you prevent conflicting writes across agents?

Assign write ownership by memory type and entity. A billing agent owns billing-state observations; a research agent proposes facts but cannot overwrite them; a coordinator approves a shared project decision. When multiple agents must write the same record, use version checks, confidence, source priority and conflict review.

Do not let the model choose the final truth from two confident statements. Preserve both with provenance, select the correct value through deterministic rules or an authorized resolver, and mark the losing record as rejected or superseded rather than deleting its history immediately.

Conflict typeResolution
Two observations of the same factKeep both; current authoritative source wins
A user corrects a memoryCreate a superseding version with source and time
Two agents propose different plansRequire coordinator approval and record the decision
Low-trust document contradicts verified dataQuarantine the document unless a qualified resolver confirms it
Concurrent writesUse version preconditions or optimistic concurrency

How should multiple agents coordinate working state?

Use a run coordinator or graph runtime for task state, assignments and completion. Keep the durable shared memory smaller than execution state. The coordinator can publish milestones and approved decisions, while individual agents maintain their own local working context.

LangGraph persistence can store graph state and namespaced data, while frameworks such as CrewAI provide their own memory primitives. Whichever runtime you use, preserve a framework-neutral retention contract for facts that must outlive the graph or crew.

  • One owner for each shared task milestone.
  • Explicit status transitions instead of inferred progress.
  • Bounded handoffs with sources and unresolved issues.
  • Private scratchpads that are not automatically promoted.
  • A shared decision log separate from conversation history.
  • Idempotent writes so retries do not duplicate tasks.

How should multi-agent memory enforce user and tenant scope?

Resolve tenant and user identity before an agent runs and pass the trusted scope into every memory operation. An agent ID is an additional scope dimension, not a replacement for user or tenant identity. A supervisor should not inherit private memory from every specialist automatically.

Define which agent identities may read which scopes. Shared team memory can be visible to all approved agents, project memory only to project participants and user memory only when policy permits. If scope resolution fails, fail closed rather than querying a default namespace.

OperationRequired trusted fields
Read shared decisiontenant + project + agent authorization
Read user preferencetenant + user + purpose
Write specialist statetenant + agent + session
Promote to shared memorytenant + project + approving principal
Delete usertenant + user + deletion authorization

What must multi-agent deletion cover?

Deletion must cover every memory surface an agent can read: source events, extracted facts, summaries, graph relationships, embeddings, local caches and exports. It must also invalidate shared references used by coordinators and other agents.

Test deletion by querying through every agent identity, not only the agent that originally wrote the memory. A deleted customer fact that remains in a supervisor cache or second agent’s summary is still a production failure.

How do you test multi-agent memory?

Create a multi-agent run with overlapping work, one handoff and one changed decision. Verify that private scratchpads stay private, the receiver obtains only the needed handoff package and all agents return the latest approved decision from their allowed scopes.

Add adversarial tests for stale writes, simultaneous updates and cross-tenant requests. Then delete a fact through one agent and query through every other agent and coordinator path until no derived copy remains.

TestPass condition
Private specialist contextOther agents cannot retrieve it
Handoff completenessReceiver has state, sources and blockers
Concurrent conflictOne versioned outcome wins deterministically
Stale coordinator cacheOld value is invalidated after correction
Second tenantZero foreign records are returned
Cross-agent deletionAll read paths lose the deleted memory

What are the most common multi-agent memory failures?

The most damaging pattern is a global blackboard containing every agent’s reasoning. It spreads one specialist’s hallucination to the entire team, consumes context and makes authorization difficult. Another common failure is a handoff that sends a narrative summary without source IDs, blockers or ownership, forcing the receiver to reconstruct work that already happened.

Concurrent writes create a different class of failure. Two agents can both write a plausible but conflicting decision, and last-write-wins may preserve the less authoritative source. Version checks, explicit write ownership and coordinator approval keep shared memory from becoming an opaque race.

  • Global context for every agent, regardless of purpose.
  • Private scratchpads promoted without review.
  • Handoffs without sources, blockers or expected next action.
  • Last-write-wins updates without version checks.
  • Deletion tested through only the original writing agent.

What is the recommended multi-agent memory architecture?

Use the run coordinator for task state, scoped durable memory for facts and decisions, and explicit handoff packages for transitions. Keep specialist scratchpads private, assign write ownership, resolve conflicts deterministically and test deletion through every agent identity.

Frequently asked questions

What is multi-agent memory?

It is the shared and private context that lets several agents coordinate a task. It includes run state, approved shared facts, handoff packages and specialist-only working memory.

Should every agent share one memory namespace?

No. Use a small shared scope for approved coordination data and separate scopes for private agent state, users, projects and tenants.

What should a multi-agent handoff contain?

Send the objective, current state, completed steps, approved facts, unresolved questions, blocked actions, sources and the expected next action.

How do you resolve conflicting memories between agents?

Preserve both sources, use deterministic source priority and versioning, and require an authorized coordinator or resolver for shared decisions.

Can LangGraph or CrewAI memory work with an external memory layer?

Yes. Keep their runtime or crew persistence for execution state and use an external scoped memory API for facts that must outlive the graph, crew or framework.

How do you test deletion in a multi-agent system?

Delete through an authorized path, then query through every agent, coordinator, cache, export and tenant boundary to prove no derived copy remains retrievable.

Give each agent the context it needs and nothing more

Model one shared decision, one private scratchpad and one handoff. Then test a conflicting update, a second tenant and cross-agent deletion before expanding the topology.

Multi-Agent Memory: Shared Context Architecture | AI Memory