TECHNOLOGIES

What is a Context Window?

A context window is the most text an LLM can take in at one time, counted in tokens. It is why you cannot simply paste a whole knowledge base into each prompt.

Last reviewed: byAtta Ur Rehman LinkedIn ↗

A context window is how much an LLM can hold in working memory during one request, counted in tokens (one token is about three-quarters of a word). All of it must fit: the system prompt, the conversation so far, every pasted document and the response the model writes. Whatever spills past the limit is, quite literally, invisible to the model.

Even with a big window, “just stuff it all into the prompt” breaks down for three reasons. Cost comes first: most providers bill by the token, so attaching a large document to every call multiplies what you pay. Latency is second: the more tokens, the slower the reply. The third is the least obvious, quality: models pay less reliable attention to facts buried in the middle of a very long context, so adding more can make things worse. A tight prompt frequently outperforms a bloated one.

That is precisely the problem RAG solves. Rather than pouring the entire corpus into the window, you fetch only the few chunks that matter for each question and send those alone. You keep the value of a large knowledge base without paying to process every word of it on each request. Think of the context window as the budget, and retrieval plus careful prompt-engineering as the way to spend it well.

One effect regularly catches teams off guard, often called “lost in the middle”. A company drops a 40-page policy document into the prompt and asks something answered on page 20. Although the whole document technically fits in the window, the model answers wrongly, because its attention weakens for content deep inside a long context. Give the same model just the two paragraphs retrieval surfaced, and it gets the answer right. A larger window did not solve anything; sharper context did. Founders tend to miss this counter-intuitive point whenever a new model launches with an eye-catching window size: extra capacity does not mean extra reliability.

What to take away: the context window is a limited resource that costs money, not empty space to fill. Larger windows ease the pressure without eliminating it, and both cost and latency still grow with whatever you add. In our Artificial Intelligence work we design around that budget on purpose.

// FAQ

FAQs

It is the upper limit, counted in tokens, on how much text an LLM can handle in a single request. The system prompt, the conversation so far, any pasted documents and the answer it writes must all fit within it.
Because of cost, speed and quality. Extra tokens raise the bill and slow the reply, and models pay less dependable attention to details buried deep in a long context. A tight prompt generally does better than a bloated one.
Managing it is the reason RAG exists. Rather than filling the window with your entire corpus, you fetch just the chunks each question needs, so you keep the value of a big knowledge base without paying to process all of it on every request.