Time is the missing field in agent memory and RAG

Anthropic’s research on agent memory and Cognition’s memory repo made me think the most important property of a memory is its date: when it was written, and whether it is still true.

Both designs load an index, not all the memory

Start with what both get right: they do not load everything into context. Anthropic notes that longer instruction files reduce adherence, and that injected memory uses up tokens.

Anthropic’s design is a hierarchy. Transcripts sit at the bottom, notes and wikis sit above them, and a short injected context sits on top. Anthropic ties the design to neuroscience: the hippocampus replays recent experience during sleep, and the neocortex keeps what lasts.

Cognition’s version is a Markdown and Git repo. The agent reads a short MEMORY.md index at session start, then greps or follows links for what the task needs.

The context window is working memory, not storage. Index the memory, and let the agent look things up.

A memory without a date or source cannot be trusted

Think of Memento. Leonard cannot form new memories, so he lives on Polaroids, notes, and tattoos. Each one is a memory with no date and no source. He cannot tell when he wrote it, who wrote it, or whether it is still true. The plot turns on that gap.

Agent memory has the same gap. Anthropic warns that a note that is wrong from the start, or that drifts as the environment changes, can be read and trusted by Claude in a later session.

Cognition recommends an added date and a source link on each entry. Its Dreaming agent runs periodically to merge duplicates, remove outdated entries, and resolve contradictions. Anthropic describes dreaming too: reflect on logs, fix mistakes, write new notes.

One working setup is a Git repo with a MEMORY.md index. Outdated memory needs regular cleanup, so a daily dream pass runs on its own branch. Projects that go quiet move to archive/, which agents search only when asked for history.

Record the miss, fix it, and verify the fix

Loading only the index makes misses visible. Sometimes the agent should have looked up an entry and did not. The index line did not tell it when to use that entry. Fix the miss in four steps:

  1. Record the miss: the task, and the entry the agent should have used.
  2. Rewrite the index line, and the entry if needed.
  3. Run the same task again.
  4. Check that the agent now finds the entry.

This verification loop makes the memory improve. Without it, a rewrite is a guess. If no task ever needs an entry, move it to archive/.

Neuroplasticity works the same way: the brain learns from small errors. A system that loads everything never misses, so it never finds out which entries are badly indexed.

RAG has the same problem

A chunk has no date unless you give it one. Without a date, retrieval returns chunks from the wrong period. They match the question well and are wrong for it.

A 2023 MSA and a 2026 addendum can look almost identical to a vector search. If similarity is the only signal, the outdated clause competes with the current one and pollutes the answer. The brain clears metabolic waste during sleep, through the glymphatic system. Retrieval needs a step that clears outdated chunks.

Rank on source, time, and the question

Neither article covers forgetting by age. A mature pipeline ranks on three signals, not one:

So decay is a default, not a rule. The question decides which time matters.

Time turns storage into a lifecycle

A memory without a date cannot be decayed, superseded, or checked. With one, memory becomes a lifecycle: write, index, consolidate, retire.

How does your system handle stale or conflicting context?

References and links