All answers

Agent memory

How do I choose a memory layer for AI agents?

Alexandru Lupascu, CTO & Co-founder · Updated

Choose a memory layer by six criteria: who must share it, who writes to it, how it handles stale and conflicting facts, how it ranks what it returns, how much context it adds per turn, and where the data lives. For one person in one tool with short sessions, the memory built into that tool, such as Claude Code's CLAUDE.md files and auto memory, is often enough. Once several agents, tools and teams depend on the same facts, you need memory that sits outside any one vendor's tools and a clear rule for what reaches the model on each turn. Test your shortlist on your own tasks before you commit.

What kinds of memory layer are there?

Seven categories show up in production, and each covers a different part of the problem.

CategoryWhat it doesFits whenWhere its scope ends
Memory built into one vendor's toolsInstructions and notes for that vendor's agentOne person or team, one toolThat vendor's tools
Memory libraries and providersAPI or SDK to store and recall factsYou build your own agentYour code decides what enters the prompt
Vector databasesSimilarity search over embeddingsRecall by meaningNo relationships or history by default
Graph databasesEntities and their relationshipsOwnership, dependencies, timelinesWork to build the graph
Context warehousesCompany context copied into one storeMany sources, one query pointFreshness depends on sync
Connectors and enterprise searchSearch live systems at query timeFinding documents across appsReturns matches, not what the agent learned
A runtime that decides per turnBuilds the working set before each model callMany agents, tools and teamsAdds a step to every turn

These categories combine: a runtime or a library usually sits on top of a vector or graph store. See vector vs graph databases for agent memory.

Which criteria decide the choice?

Six questions separate the options for your case.

  1. Sharing scope: one person, one team, or many agents across tools. Claude Code's auto memory "is machine-local", which suits one developer.
  2. Write path: which agents can write, who approves, and whether each entry keeps its source and time.
  3. Freshness and conflicts: whether replaced facts are marked as superseded and disagreements shown, not resolved silently.
  4. Ranking: similarity only, or also recency, importance and relationships, as in the "Generative Agents" retrieval model (Park et al., 2023).
  5. Context budget: how many tokens it adds per turn. Anthropic's guidance is to find "the smallest possible set of high-signal tokens".
  6. Data location: where memory is stored, how long it is kept, and whether you can self-host. For GDPR, the rules depend on your country, the data and how the agent uses it; check with your data protection officer.

When is a simple option enough?

A simple option is enough when one person uses one tool, sessions are short, and the facts the agent needs fit in a few instruction files. In that case, CLAUDE.md files or Anthropic's memory tool, which runs client-side so that "you control where and how the data is stored", need no extra system and are easy to read and fix. Anthropic's context engineering guide gives the same advice for agent design in general: "do the simplest thing that works." Move to a shared system when you see the same correction repeated across tools, agents acting on outdated facts, or teams keeping separate copies of the same knowledge. For background, see what memory for AI agents is.

Where does elephant.broker fit among these?

elephant.broker belongs in the last category: a pluggable runtime for AI agents, not a memory store. The runtime sits between your harness and your business and decides on every turn what your agent sees, using a memory provider underneath: Cognee by default, or the memory you already run. elephant.broker reports on its website 40-80% less context per task, with only verified, relevant knowledge reaching the window. That is elephant.broker's own reported result, not an independent or head-to-head test. The trade-off is an extra retrieve and rerank step on every turn. See what a pluggable runtime for AI agents is and what security teams should check.

Sources

Product details come from each vendor's public documentation as viewed on 2026-10-23 and may have changed. Product names are trademarks of their respective owners. Cognee is the default memory provider in elephant.broker; elephant.broker is not affiliated with the other products named.