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.