Asked about Memory across sessions

How would you give an assistant long-term memory?

An answer that works

Memory is three parts, not a model feature: durable storage, a write policy and a retrieval policy. Store stable facts and decisions rather than transcripts, keyed by what they are about so a new value supersedes the old one. Retrieve by scope first, then relevance with a floor, then a hard token budget. And let users see, correct and delete what is stored.

Then they push further

Why key by subject rather than appending a row per turn?

An append-only store grows with conversation length and keeps every superseded version, so retrieval eventually returns several mutually exclusive memories about the same thing and the model has no way to pick. One slot per subject makes superseding automatic, bounds growth at the number of things the user has actually told you, and means staleness has nowhere to accumulate.

What happens when a request matches nothing?

Nothing should be retrieved. A top-k search with no relevance floor always returns k memories however irrelevant, and the model cannot tell that the context it was handed is noise, so it answers as though it were not. The floor is what makes an empty result possible.

What gets marked up

Strong answers separate the write policy from the retrieval policy and say which one a given failure belongs to. Describing memory as something the model does is the usual weak answer.

Reading an answer is not being able to give one. The section that teaches this is Memory across sessions, 4 hours of Context management.

Learn this properly