Agent runtime

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.

Operating principle

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