The short version
- Small memory can be loaded in full at the start of each session.
- Large memory must be searched, and only the relevant pieces loaded.
- When facts change over time, or relationships matter, a knowledge graph that records dates works better than plain text search.
The idea
Load everything. A short profile or notes file is added to every session. This is simple and reliable, and it only works while the memory stays small.
Fetch on demand. Memories are stored in a database and searched by meaning. For each request, the system retrieves the few most relevant items. This scales, and it adds the risk of fetching the wrong thing.
Tiered memory. A small core is always loaded, and a large archive is searched when needed. The model itself can decide when to save or look up, an approach taken from operating system design.
Temporal knowledge graph. Facts are stored as entities and relationships with dates: who reports to whom, which contract was in force and when. This handles facts that change and questions that need several linked facts.
You keep your phone and keys in your pocket. That is load everything. You keep files in a cabinet and pull the one you need. That is fetch on demand. For a complicated family history, you draw a family tree with dates. That is the graph.
- Small and stable: load all
- Large: search and load a few
- Changing facts and relationships: graph with dates
A shared memory service lets several agents or applications use the same memory, so a fact learned in one place is available in another. It needs the same access controls as any shared data.
An example
An account assistant starts with a one-page customer profile loaded on every request. As history grows, past interactions move to a searchable store, and only the three most relevant are fetched. Later the team finds errors after reorganizations: the assistant names a buyer who left a year ago. They add a small graph of contacts and roles with start and end dates, so the assistant knows who holds the role today.
Common mistakes
- Starting with the most complex design. Start with a notes file.
- No dates on facts, so old and new information look equally valid.
- Search that returns similar text and not the correct fact.
- Several teams building separate memories about the same customers.
What to do this week
- Estimate how much your assistant needs to remember for each user or account.
- If it fits on a page, load it in full. If not, plan search.
- Add a date and a source to every stored fact.
The terms, in plain language
| Term | What it means |
|---|---|
| Fetch on demand | Searching memory and loading only what is relevant |
| Tiered memory | A small always-loaded core plus a searchable archive |
| Knowledge graph | Facts stored as things and the relationships between them |
| Temporal | Carrying dates, so the system knows what was true when |
Further reading
Section 3.4 of the AI Engineering Guide · Last reviewed November 2026




