Context Window

Definition: The maximum amount of text — measured in tokens, not words — that a model can hold in view at once, including everything you've said in the conversation so far, any documents you've pasted in, and the reply it's generating.

Why it matters: Once a conversation or document exceeds the context window, the model doesn't remember the earliest parts anymore — it has genuinely lost them, not just deprioritized them. A model that seems to "forget" something you said earlier in a long chat has usually just run past its window.

Example: A 200,000-token context window fits roughly a 500-page book — but a long back-and-forth conversation with pasted documents can fill that up faster than you'd expect.

What fills the window

Everything the model sees in one request counts against the context window: the system prompt, tool definitions, the whole conversation so far, any documents or search results you include, and the answer it is writing. All of it is measured in tokens, not words.

Window sizes vary a lot between models, from tens of thousands of tokens to around a million on some current models. Check the provider's documentation for the exact figure, because it changes with each model release.

Why a bigger window isn't the whole answer

  • Cost and speed. You pay for every input token on every request, so sending a huge document each time gets expensive and slow.
  • Attention isn't perfect. Models can miss details buried in the middle of very long inputs. Putting long material first and the question at the end helps.
  • It isn't memory. The window is wiped between conversations. Anything the model should remember next time has to be stored somewhere and sent again.

What to do when you run out

  • Retrieve only the relevant parts with RAG instead of sending everything.
  • Summarize older parts of a long conversation (often called compaction).
  • Keep durable facts in a separate memory store and load only what the task needs.

Learn more on Lumis