Submit a Story

Glossary

Context Window

The maximum amount of text, measured in tokens, that a language model can take in and consider at once, including your instructions, the conversation and its own reply.

The context window is the model's working space for a single request. Everything has to fit inside it: the system prompt, earlier messages, retrieved documents, tool results and the answer the model is about to write. Anything that does not fit is cut off or left out, and the model cannot see it.

Sizes differ between models and have grown a lot, but a bigger window is not a free pass. Longer inputs cost more and run slower, and models can overlook details buried in the middle of a very long prompt. It is usually better to include the right material than all of it.

That is why techniques like document chunking and Retrieval-Augmented generation exist: they pick the relevant pieces instead of pasting everything. Agents also need a plan for what to keep in AI agent memory as a task grows.

Related: Large Language Model, AI Agent Context, Prompt Engineering.

← All terms