Skip to main content

Glossary

Context Window

Meaning and details

The context window is the model's working memory: everything it can attend to in a single call. System prompt, conversation history, retrieved documents, pasted code and the response it is generating all share that budge...

Context Window meaning

The maximum number of tokens a model can consider at once, combining input and generated output.

What is Context Window?

The context window is the model's working memory: everything it can attend to in a single call. System prompt, conversation history, retrieved documents, pasted code and the response it is generating all share that budget. When the window is full, the oldest content falls out or the call fails. Windows range from about 8,000 tokens on small models to 200,000 or a million on frontier ones.

Why it matters to an indie builder: the window size decides what your product can do. An agent with an 8k window can read one file; one with 200k can hold a small codebase, a documentation set and a conversation at once. It also drives cost: you pay for every token in the window, whether or not it helps.

A concrete example: a docs-answering bot. Your docs are 120,000 tokens. Stuffing all of them into every question costs real money and actually degrades answers, because the model drowns. The fix is retrieval: embed the docs, fetch the five most relevant chunks (5,000 tokens), and send those with the question. Same window, better answer, one twentieth of the input cost.

Common mistakes: confusing context window with memory (the window resets every call; memory requires you to persist and resend, or use a memory layer like the ones agent frameworks provide), assuming bigger windows mean better retrieval (retrieval quality still dominates), and ignoring the input-plus-output rule: if the window is 128k and you send 120k of context, the model can only generate 8k before the call errors. When you need persistent memory and selective recall, that is what RAG and vector databases like Qdrant or pgvector are for; the window is a workbench, not a warehouse.

When you evaluate models for a product, check the window but budget for retrieval. The math that matters: tokens actually sent per request times calls per month times price per million. Frontier windows are listed on the aiaas pages here; the vector-db blocks cover the storage side of the retrieval pattern.

Keep exploring the glossary