Memory Designs

Load Everything, Fetch on Demand, or Build a Graph

There are a few standard ways to build memory for AI systems. The right one depends on how much there is to remember and how exact recall must be.

Ranjit Nethi

·

Memory Designs

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.

  1. Small and stable: load all
  2. Large: search and load a few
  3. 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

  1. Estimate how much your assistant needs to remember for each user or account.
  2. If it fits on a page, load it in full. If not, plan search.
  3. Add a date and a source to every stored fact.

The terms, in plain language

TermWhat it means
Fetch on demandSearching memory and loading only what is relevant
Tiered memoryA small always-loaded core plus a searchable archive
Knowledge graphFacts stored as things and the relationships between them
TemporalCarrying dates, so the system knows what was true when

Section 3.4 of the AI Engineering Guide · Last reviewed November 2026

All parts of the guideChecklists and templates

About the author

Ranjit Nethi leads AI and data for commercial operations at a global industrial manufacturer. He writes about the operating model that turns AI pilots into results finance will sign. Kellogg Executive MBA; MS in Computer Science. This site is his own perspective and view, with no affiliation with any organization.