Context window
Definition
The maximum number of tokens a model can consider in one request, covering both the input you send and the output it writes.
In more detail
Limits range from a few thousand tokens in small local models to a million or more in some hosted models. A bigger window lets you include more, but models do not use all of it equally well, and you pay for every token you send.
Related terms
Context engineering
Deciding what information, tools and history a model sees at each step, and what to leave out, to get the result you want.
Context rot
The gradual decline in a model's accuracy and instruction-following as its context fills up with long, stale or irrelevant content.
Token
The unit of text a model reads and writes, often a word or part of a word; in English a token averages about four characters of text.
Agent loop
The repeating cycle of model call, tool call, observation and next decision that drives an agent until the task is done or a limit is hit.
Agent memory
Information an agent keeps beyond a single context window, such as user preferences, past decisions or task notes, and retrieves when needed.
Attention
The mechanism that lets a transformer weigh how much each token should draw on every other token when building its representation.
Read more about Context window
- Context engineering
Deciding what instructions, documents, tools and history a model sees at each step.
- Context rot: why long contexts fail and what to do
Why models get worse as their context fills up, from lost-in-the-middle to distractors and poisoned context, and the practical fixes for agents and RAG.
- RAG vs long context vs fine-tuning: how to choose
What each approach changes, what it costs, where it fails, and a practical order to try them in before you commit to one.