Agent memory
How do multiple AI agents share memory?
Alexandru Lupascu, CTO & Co-founder · Updated
Multiple AI agents share memory through a store that sits outside every agent's context window, which all of them can read and write, plus rules for who writes what and how results flow back. Anthropic's multi-agent Research system is a documented example: the lead agent saves its plan to memory because a context window over 200,000 tokens gets truncated, and subagents store their work in external systems and pass "lightweight references back to the coordinator." Sharing the store is the easy half. Deciding what each agent should see from it, and what to do when agents disagree, is the hard half.
What are the main ways to share memory between agents?
Four patterns cover most setups, and they differ in what is shared and how long it lives.
| Pattern | What agents share | Fits | Where its scope ends |
|---|---|---|---|
| Instruction files in version control | Rules and conventions (CLAUDE.md, AGENTS.md) | One repository, one team | Edited by hand; holds instructions, not what agents learn |
| Artifact store with references | Outputs that subagents store and point to | A lead agent and its subagents in one run | Often lives only as long as the task |
| Shared memory service | Facts and episodes behind an API or MCP server | Several agents and tools over weeks | Concurrent writes, stale entries, access scope |
| A runtime that decides per turn | A working set built for each turn from the shared store | Many agents, tools and teams | Adds a step to every turn |
Claude Code's documentation says project CLAUDE.md files are "shared with your team through version control", while auto memory "is machine-local".
What goes wrong when agents share memory?
Shared memory multiplies the failure modes of single-agent memory. Anthropic reports that without detailed task descriptions its research agents would "duplicate work, leave gaps, or fail to find necessary information", and warns that running subagents asynchronously, which its system does not yet do, "adds challenges in result coordination, state consistency, and error propagation." Two agents can also write different values for the same fact; Claude Code's documentation notes that when two instructions contradict each other, "Claude may pick one arbitrarily." Cost grows too: in Anthropic's data, multi-agent systems used about 15 times more tokens than chats. Loading the whole shared store into every agent's window makes the contradiction and cost problems worse.
How do you set up shared memory safely?
Set write access per memory type first, then make every entry traceable.
- Decide who may write to which memory. The CoALA paper (Sumers et al., 2023) gives its example retail agent read and write access to episodic memory but "read-only access to semantic and procedural memory".
- Record who wrote each entry, when and from which source, so a reader can judge it.
- Pass references, not copies: store a large output once and hand other agents a pointer.
- Scope reads by tenant, team and task, so one agent does not see another team's data.
- Mark replaced facts as superseded instead of appending a second version. See what happens when memory holds conflicting information.
How does elephant.broker handle memory shared by many agents?
elephant.broker gives the agents of one tenant a shared store and builds a separate working set for each turn. According to the elephant.broker site, every turn "recalls from, and writes back to, one graph and vector store, gateway-isolated per tenant", and context is assembled from your tools, teammates and past sessions. When two sources conflict, both are placed and weighed by proof rather than one being dropped silently. The runtime holds no connectors and no keys; it keeps pointers to your systems, and your agents use the access you already gave them. Agents connect through an MCP server, native plugins or a REST API, from harnesses such as Claude Code, Codex and Cursor. For coding agents, see one memory across Claude Code, Codex and Cursor; for picking the store itself, how to choose agent memory.
Sources
- Anthropic engineering blog, post on its multi-agent Research system (Jun 13, 2025)
- Claude Code documentation, How Claude remembers your project
- Sumers, Yao, Narasimhan, Griffiths, Cognitive Architectures for Language Agents (2023)
- elephant.broker: how a turn flows, features, security and deployment
Product details come from each vendor's public documentation as viewed on 2026-10-28 and may have changed. Product names are trademarks of their respective owners; elephant.broker is not affiliated with them.