Artificial Intelligence

What is Context Window?

Quick answer

The maximum amount of text, measured in tokens, that a language model can consider at one time, including the prompt and its reply.

Context Window, explained

Every language model has a fixed limit on how many tokens it can process in a single request. That limit is the context window. It covers the system instructions, the conversation so far, any documents you attach, and the answer the model generates.

When a conversation or document exceeds the window, older or extra content has to be dropped, summarized, or retrieved selectively. For example, a support assistant reviewing a long email thread might lose track of details from the first message if the thread is larger than its window. Larger windows let models work with whole reports or codebases, but they can increase cost and response time, and models do not always use information buried in the middle of very long inputs reliably. Techniques such as retrieval-augmented generation help by sending only the most relevant passages.

Related terms

Guides that mention Context Window