./glossary / context-window

Context window

A context window is the maximum amount of text, measured in tokens, that a model can consider at one time. Anything outside it is invisible to the model. It is the reason long conversations get summarised, and the reason a long agent task costs more than a short one.

The window holds everything at once: the instructions, the conversation so far, any documents pasted in, and the reply being written. When it fills, software either drops the oldest material, compresses it into a summary, or fails outright. Each of those loses something, and which one happened is a property of the product, not the model.

A large window is not a substitute for structure. Filling it with irrelevant material makes the answer worse and the bill larger at the same time. What works better is retrieving the few relevant passages and leaving the rest out.

For agents this is the central engineering problem. Every step re-sends the context, so a job that runs for an hour can spend most of its tokens on material the model has already read. Reducing that repetition is one of the few optimisations that cuts cost without changing the answer.

Where this comes up

Related terms

Cite this definition

MershLab, “Context window”, https://www.mershlab.com/glossary/context-window.

Last updated: 2026-11-29.