Archive/MODELS

Context windows are not memory

A bigger window lets a model read more at once. It does not make it remember, prioritise or forget well. How to design for that difference.

Context windows are not memory

Context windows keep growing, and each increase is announced as if it solved memory: paste in all your documents, your whole codebase, every past conversation, and the model "knows" it all. In practice, teams that build this way run into the same problems. Costs climb with every request, answers get slower, the model misses details that are plainly in the input, and nothing persists once the conversation ends.

The root cause is a category error. A context window is the amount of text a model can read in a single request. Memory is a system that decides what to keep, how to find it again and when to forget it. This article explains the difference, why a larger window does not give you memory, and how to design systems that combine both.

What a context window actually is

A language model is stateless. Each request is independent: the model receives a sequence of tokens (the system prompt, the conversation so far, any documents or tool results) and produces a response. The context window is the maximum length of that sequence.

Everything that looks like memory in a chat interface is the application re-sending earlier messages with every new request. When the conversation exceeds the window, something must be dropped, truncated or summarised. Nothing is "remembered" between requests except what the application chooses to send again.

Three properties follow:

Why a bigger window is not memory

Memory requires selection

Human memory is valuable because it is selective. Of everything you experienced last year, you retain what mattered. A context window has no notion of importance: a throwaway remark and a critical constraint occupy the same space. As you add more, the important facts become a smaller share of the input and are easier to miss.

Memory requires persistence

A context window lasts one request. If a user tells your assistant their preferences today, nothing carries over tomorrow unless your application stores it somewhere and puts it back in the context.

Memory requires retrieval

To use the right memory at the right time, you need to find it. With a big window, the implicit strategy is "include everything and let the model find it." That works for small amounts of material and degrades as the material grows, both in quality and in cost.

Memory requires forgetting and updating

Facts change. A user moves house, a policy is replaced, a decision is reversed. A context full of old and new versions of the same fact invites the model to use the wrong one. Real memory systems overwrite, expire and resolve conflicts.

Context window, retrieval and memory compared

Three ways to give a model information
ApproachWhat it isStrengthsWeaknesses
Long contextPut everything in the promptSimple; model sees full documentsCostly, slow, uneven attention, no persistence
Retrieval (RAG)Search a store and insert the best matchesScales to huge corpora; cheaper per requestDepends on search quality and chunking
Stored memoryWrite and update facts about users or tasksPersists across sessions; can forgetNeeds rules for what to store, privacy controls

Most good systems use all three: a stable system prompt, retrieval for knowledge, stored memory for user- or task-specific facts, and the context window as the place where the selected pieces are assembled for one request.

Designing the context: what goes in each request

Think of each request as assembling a briefing for a capable colleague who has never met you. A useful order:

  1. Instructions and rules (system prompt), kept stable so it can be cached.
  2. Durable facts about the user or task from stored memory: preferences, constraints, decisions already made.
  3. Retrieved knowledge relevant to the current question, ordered by relevance.
  4. Recent conversation, possibly with older turns summarised.
  5. The current request at the end, with any key constraint restated.

Placing the question last and keeping the most relevant material near it counteracts the position effects of long inputs. Retrieval quality depends heavily on how documents are split; see RAG chunking strategies compared.

Summarisation: useful, but lossy

A common technique for long conversations is to summarise older turns and keep the summary in context. It works, with caveats:

A good pattern is to keep a short running summary plus a structured list of facts and decisions, each with a source and a timestamp.

Building real memory

For assistants and agents that work across sessions, design memory explicitly:

We cover these choices in detail, including privacy, in memory for agents: what to store, what to forget.

When a long context really is the right tool

Long context windows are genuinely valuable for:

The architecture behind large windows is covered in sparse attention explained. The key is to treat the window as working space for the current task, not as a database.

A quick diagnostic

If your system shows these symptoms, you are probably using context as memory:

The fix is rarely a bigger window. It is selection, storage and retrieval.

Frequently asked questions

What is the difference between a context window and memory in LLMs?

The context window is the maximum amount of text a model can process in one request. Memory is an application-level system that stores information between requests and decides what to retrieve, update or forget. Models are stateless; memory must be built around them.

Does a larger context window make a model remember more?

It lets the model read more in a single request, but nothing persists afterwards, and models do not use every part of a long input equally well. Persistence and selection require a memory or retrieval system.

Should I use RAG or a long context window?

Use retrieval for large or changing knowledge bases and long context for reading a single long document or a set of related files thoroughly. Many systems combine both: retrieve relevant material, then let a long-context model read it.

How do chatbots remember previous messages?

The application re-sends earlier messages, or a summary of them, with every new request. Some products also store selected facts in a database and add them to the context in future sessions.

MO
WRITTEN BYMira OkaforEvals lead. Breaks models for a living, writes about it on Sundays.

Keep reading

Liked this? The Sunday Diff has one like it every week.