What is Context Window?
Context Window is the maximum amount of text, measured in tokens, that an AI model can process and reference at once, encompassing the prompt, any retrieved documents, and the conversation history. Content beyond the context window is invisible to the model, either truncated or dropped, no matter how relevant it might be.
TL;DR
Context window is the maximum amount of text an AI model can see at once, and anything beyond it simply doesn't exist to the model, no matter how important.
Formula
Context Window is a fixed model-specific limit, typically stated in tokens (e.g. 8,000, 128,000, or 1,000,000 tokens), not a value that varies per request.
Why It Matters
Context window matters because it's a hard ceiling on how much information a model can reason over in a single request, and a model has no way to know what it's missing once content is truncated or dropped past that limit. It matters because a document, conversation history, or set of retrieved sources exceeding the context window forces a choice between cutting content off, potentially losing critical information, or splitting it into chunks, potentially losing important cross-references between sections. Ignoring context window limits means building an AI application that silently fails on longer inputs, producing confidently wrong or incomplete answers with no obvious error to flag the problem. It directly shapes system design decisions, like whether to pick a larger-context model outright or build a retrieval system that intelligently selects only the most relevant sections to feed in. Context window size also interacts with cost and latency, since larger context windows generally mean more tokens processed per request, which increases both compute cost and response time.
Example
A legal AI assistant with a 32,000-token context window is asked to analyze a 50,000-token contract in a single request. Because the document exceeds the context window, the system must either truncate the contract, losing potentially important clauses, or split it into chunks and process them separately, losing some cross-references between sections. Choosing a model with a larger context window, or building a retrieval system that only feeds in the most relevant sections, are the two common ways teams work around this limit.
Frequently Asked Questions
Related Terms