AI memory, explained
What is AI memory — and why a bigger context window isn't enough
"AI memory" is how an assistant holds on to what matters to you across time — your documents, decisions, and history — and brings back the right piece when you ask. The naive version is to paste everything into one long prompt. The research says that quietly fails. Here is the better model.
The context window is not memory
A model's context window is its short-term working space. It is bounded, and once something scrolls out of it, the model behaves as if it never happened. Making the window bigger helps a little, but it does not turn short-term context into durable memory — and it introduces its own problems.
- Models under-read the middle of a long context, so information buried there is often missed.
- Piling on more text stops helping — and for many models starts hurting — well before the window is full.
- Long context is expensive: you pay to reprocess everything on every single query.
Real memory is structured and managed
The alternative, borrowed from decades of systems design, is a memory hierarchy: keep a small working set in the window and a large, organized store outside it, and surface the relevant pieces on demand. The value is not in how much you can cram into one prompt — it is in how well the right slice is selected. Structure, not volume, is what makes memory work.
That is what FocusLM builds: an agent interviews you to understand the problem, designs a folder ontology, writes its own filing rules, and sorts everything you feed it into a structured memory of inspectable, exportable markdown. When you ask a question, it surfaces the relevant, cited pieces — wherever they originally came from.
The research, in plain English
Short, grounded explainers of the papers behind this — each with an original diagram.
Encrypting AI memory: why a key per project beats a key per database
An AI that remembers your life holds material you would not hand to a stranger. We encrypt every memory file and chat message under a key belonging to that project alone — and the research explains why the obvious alternatives leak.
More context isn't always better: what happens past 64k tokens
A large study across 20+ models found that stuffing more retrieved text into the prompt often stops helping — and for many models starts hurting — well before the window is full. Bigger is not the same as better.
What if an LLM managed memory like an operating system?
The context window is small and fixed. MemGPT borrows a 40-year-old idea from operating systems — a memory hierarchy with paging — to let a model work with far more information than fits in the window.
RAG vs long context: which one should you actually use?
When a model can read a million tokens, is retrieval obsolete? A Google DeepMind study says no — long context wins on quality when you can afford it, retrieval wins on cost, and a simple router gets most of both.
Lost in the middle: why long context windows quietly fail
LLMs use the start and end of a long context far better than the middle — a U-shaped effect that persists even in models built for long context. Here's what the research shows and what it means.