What is a context window in AI?
The context window is the total text a model can consider at once: your question, the chat history, any documents and the answer.
What is a context window?
The context window is the total amount of text a language model can consider in a single request. It includes your question, earlier messages in the chat, any documents you give the model and the answer the model writes. It is measured in tokens, not words or pages.
Think of the model as someone who can read any paper placed on their desk, but the desk has a fixed size. Pages that do not fit are not read. When the window fills up, the application cuts or summarizes the oldest messages and the model no longer sees them.
What changes as windows grow?
Early chat models had windows of a few thousand tokens. Today windows reach hundreds of thousands of tokens, and some models go past a million. You can now give a model a long contract, a book or much of a software project in one go.
A bigger window does not solve everything. With long inputs, models tend to use information at the start and end better than information in the middle, an effect researchers call "lost in the middle". Filling the window also raises cost and response time, because the model processes the whole text again on every request.
Is the context window the same as memory?
No, although the two are often confused. The window is the text in front of the model during the current conversation, and it is gone when the chat ends. Remembering across conversations needs a separate memory layer that stores information and puts it back into the window when needed.
Using the window well
In practice, what you put in the window matters more than its size. Picking the passages that match the question instead of sending a whole archive (this is what RAG does), summarizing long chats from time to time and keeping the system prompt short improve both answer quality and cost.