AI AgentsPublished 2 December 20266 min

What Is a Context Window? What AI Keeps, What It Loses

By Alexandre Saint-Jean

What Is a Context Window? What AI Keeps, What It Loses

Audio version

Audio version produced by text-to-speech from the article. Our AI charter


You have been working with an assistant for an hour, and it stops following an instruction you gave at the start, or answers beside a passage that is plainly in your document. It is not a whim: it is often the context window. Until you know what it holds, and what drops out as it fills up, these slips look random.

What is a context window?

It is everything the model has in front of it at once when it produces an answer. Anthropic's documentation (an undated page, accessed 29 November 2026) defines it as all the text a language model can refer to when generating a response, including the response itself. It calls it a "working memory" and distinguishes it from the large body of text the model was trained on.

In practice four things sit in it: the starting instructions (the tool's and yours), the conversation history, the documents you attach, and what the model is currently writing. The same documentation notes, for its programming interface, that each request carries the whole previous history as input. The model does not "recall" your messages: they are put back in front of it on every turn.

The window is measured in tokens, the pieces of text we cover in our article on tokens and AI pricing, which deals with pricing. Here the mechanics are the point. Anthropic's page lists sizes of up to 1 million tokens depending on the model, and 200,000 for others: sizes vary widely between models and change fast, so check the publisher's page.

Is a context window a memory?

Not in the sense of keeping a recollection. The window belongs to one conversation: open a new one and it starts empty. What you said yesterday is gone unless you provide it again.

Many tools do offer a "memory" or "preferences" feature. That is a different mechanism, specific to each tool, which stores certain items on the side. What it keeps, where, and for how long cannot be deduced from the notion of a window: the tool's help pages tell you, and that is where to look before you entrust it with anything sensitive.

What happens when a conversation goes over the window?

It depends on the tool, and publishers do not all do the same. Anthropic's documentation describes three cases for its own ecosystem, which give an idea of the possible choices:

  • Rejection. When a request on its own exceeds the window, the service returns an error ("prompt is too long").
  • Dropping the oldest messages. Chat interfaces can manage the window on a "first in, first out" basis: the oldest messages leave to make room.
  • Automatic summary. A compaction mechanism summarises earlier exchanges so the conversation can continue past the limit.

In the last two cases the start of the conversation is the most exposed, and often that is where your opening instructions live. If the assistant begins ignoring a rule set at the outset, or an answer contradicts a point settled earlier, the window is the first thing to suspect. A summary also loses detail: what mattered to you may not have been judged important.

Does a large window mean every passage is read equally well?

No. Having room for a long text does not mean the model uses all of it equally. Research has measured this. In "Lost in the Middle: How Language Models Use Long Contexts" (Nelson F. Liu and co-authors, Transactions of the Association for Computational Linguistics, volume 12, 2024), the authors test models on questions spanning several documents and on retrieving a value from a list. They find that performance is often highest when the relevant information is at the beginning or end of the input, and that it drops when it sits in the middle, including for models built for long contexts.

Anthropic's documentation points the same way in broader terms: as the token count grows, accuracy and recall degrade, a phenomenon it calls context rot, and it concludes that curating what goes into the context matters as much as how much room there is.

One caveat: Liu and co-authors first put their study online in July 2023, and it covers the models of that time. It says nothing about how any particular model behaves today, or how strong the effect is. Keep the principle, not a number: what is buried in the middle of a long text deserves extra vigilance.

Which habits help you work with the window?

Four habits, none of them technical, follow from the above.

1. Restart from a fresh conversation with a summary. When the exchange drags on or the assistant drifts, ask it for a summary, then paste that into a new conversation:

Summarise this conversation in ten lines at most, so that I can pick it up in a new conversation: my goal, the decisions made, the constraints to respect, the points still open.

Check by hand: reread the summary before pasting it, and add whatever is missing (a constraint, a figure).

2. Put the key instruction at the start AND repeat it at the end. The start and end of a long text are the zones used best according to the study above, so put what matters there. An example reminder to close your message:

Reminder of the instruction: answer in under 150 words, without jargon, and use only the information in the document above.

3. Send only the passage that matters. For a question about two pages of a forty-page report, paste those two pages, not the whole report. Less text means less noise around the useful information and less risk of it being buried. Never paste personal data about customers, students or employees.

4. Ask for a quote of the passage used. Make the model show where its answer comes from:

For each claim in your answer, quote in quotation marks the exact passage of the text you rely on. If you find no passage, write "not in the text" instead of answering.

Check by hand: search for each quote in your document with the reader's search (Ctrl+F or Cmd+F). A quote you cannot find is a warning sign, and that is exactly the check this instruction makes possible. It ties into the deeper question of how reliable answers are, which a coming issue of the newsletter will take up: hallucination.

What should you take away?

Three ideas are enough. The window is what the model has in front of it here and now, not what it knows or retains. When it overflows, the tool rejects the request, drops older messages or summarises them, depending on how it is built, and the start of the conversation is often hit first. And even when everything fits, information buried in the middle of a long text was used less well by the models studied: so you sort, you repeat, you ask for quotes.

This notion builds on what an LLM, a large language model, is: a model that completes a text from what it is shown. To pick a model with its price and speed in mind, see choosing a model by cost, speed or quality.

What are the limits of this article?

It describes a principle, not a product. We rely on a single publisher's documentation, Anthropic's, to illustrate what a tool does when the window overflows: other publishers and other interfaces may do things differently, and their behaviour changes. So do window sizes: read them on the publisher's page, on the date you need them.

This notion is number twelve in our free AI newsletter, one idea per week.

Frequently asked questions

What is an AI context window?
It is all the text a language model can refer to when producing an answer, the answer itself included. Anthropic's documentation (accessed 29 November 2026) describes it as the model's "working memory", distinct from the text it was trained on: it holds the instructions, the messages exchanged, the attached documents and the reply being written.
Does an AI remember a conversation from one chat to the next?
Not through the context window: a new conversation starts empty. Some tools offer a separate memory feature that stores items on the side. What that feature keeps, and how, depends on the tool, and its help pages say so.
What happens when a conversation goes over the context window?
It depends on the tool. According to Anthropic's documentation, a service can reject a request that is too long, a chat interface can manage the window by letting the oldest messages drop out, and a compaction mechanism can summarise earlier exchanges. When the tool drops or summarises older messages, the start of the conversation is the most exposed.
Why does AI make less use of the middle of a long document?
Because a large window does not guarantee equal use of every passage. The "Lost in the Middle" study (Liu et al., TACL 2024) found that performance is often highest when the relevant information sits at the beginning or end of the input, and drops when it is in the middle, including for models built for long contexts. Anthropic's documentation likewise says that more context is not automatically better.
What should I do when a conversation gets too long?
Ask the assistant for a summary (goal, decisions, open points), paste it into a fresh conversation and carry on from there. You keep the essentials and drop the accumulated noise.

Sources

Get the AI briefing, no commitment

Free · Every Wednesday morning · One-click unsubscribe · Your data is never sold

Free first call

Got an AI project in mind?

30 minutes to scope your need and see how to fund it. No commitment.

Working with companies across France, remote.