A language model has no lasting memory of a conversation. For every answer it is shown all the relevant text again: system instructions, your previous messages, its own replies, attachments and search results. The context window is the upper limit for all of that.
What counts towards the context window
- instructions from the system or an agent
- the conversation so far
- attached files and search results
- tool results, such as data from an app
- the answer the model is currently writing
Its size is given in tokens. Current models have very different context windows, from a few tens of thousands to a million tokens and more.
Why bigger is not automatically better
A large context window allows long documents in one go. But every token in context is paid for again with each answer, and models do not always pay equal attention to information in very long contexts. It is often better to provide only the relevant sections. That is exactly what RAG does: search picks the right passages instead of dumping everything in.
What happens when the window is full
When the limit is exceeded, the application has to cut: summarise or drop older messages, or reject the request. In long chats the model can therefore “forget” early details.
Example
An in-house lawyer reviews a 200-page supply contract in a single chat. After about 30 follow-up questions, the model overlooks a liability cap it had quoted correctly at the start. He puts the contract into a knowledge collection, starts a new chat and asks his key questions in one go. The answers now quote the relevant clauses with their location.