Context Window
The maximum amount of text a model can consider in one call — instructions, documents, conversation, and tool results all share it, measured in tokens.
Production AI is a system: context, tools, permissions, traces, evals, and feedback loops around the model.
What it is
Every model call has a hard limit on how much text the model can read at once: the context window. Current frontier models take from about 200 thousand to over a million tokens. Everything competes for that space — the system prompt, retrieved documents, conversation history, tool definitions, and tool results.
Why it matters
A bigger window is not a strategy. Filling it costs money and latency on every call, and models attend less reliably to the middle of very long contexts. Production systems treat the window as a budget to allocate deliberately, not a bucket to fill.
How it works
The disciplines that manage the window have their own entries: a context budget allocates tokens per purpose, compaction shrinks conversation history, tool result clearing drops spent payloads, and prompt caching makes the stable prefix cheap to resend.
Related resources
The total number of tokens an AI agent has available for instructions, memory, retrieved context, conversation history, and tool results — and how that budget is allocated across them.
Shrinking an AI agent's conversation history so the most relevant context stays in the model's window without exceeding the token budget — by summarizing, truncating, or selectively dropping turns.
The unit models read, write, and bill in — roughly three-quarters of a word in English — the currency of every context window and every AI invoice.
Reusing the already-processed prefix of a prompt across calls — system instructions, tool definitions, long documents — so repeated context costs a fraction of full price and returns faster.