---
title: "What is a context window?"
description: "Context window defined: the token-bounded text an LLM can attend to in one call, what the limit means in practice, and how it differs from memory."
canonical: https://past.dev/glossary/context-window
last-updated: 2026-09-02
---
# What is a context window?

Source: https://past.dev/glossary/context-window

The context window is the bounded amount of text a language model can attend to in one call, measured in tokens. Everything the model can use in a call must fit inside it: system instructions, conversation history, retrieved documents, and tool results. It is working space rather than memory. Nothing persists between calls unless it is resent, and quality can degrade before the limit is reached.

## How the context window works

A language model processes one call at a time, and the context window is the total token budget for that call: system instructions, conversation history, retrieved documents, tool results, and the output being generated all count against it. Tokens are the model's text units; a token is roughly a short word or a word fragment. Window sizes differ by model and change between releases, so systems are designed around the constraint rather than around a specific size.

The model attends over whatever is inside the window and over nothing else. Between calls the window is empty; continuity in a conversation exists because the application resends prior messages each time.

## What the limit means in practice

- **Truncation.** When a conversation outgrows the window, older turns are dropped or summarized, and the model loses access to them.
- **Cost and latency.** Input tokens are paid for on every call, so routinely filling a large window is expensive and slow.
- **Degradation.** Quality over very long inputs can drop before the hard limit, a failure mode described under [context rot](/glossary/context-rot).

## Context window vs memory

The window is per-call working space. Memory is a persistent store outside the model that is queried and selectively loaded into the window. The two are complements: memory decides what is worth retrieving, and the window is where the retrieved material becomes usable. In practice they combine on every call: recall selects a small, relevant slice of stored memory, and the window carries that slice while the model works.

| Property | Context window | External memory |
| --- | --- | --- |
| Lifetime | One call | Across sessions |
| Capacity | Fixed token budget | Grows with stored data |
| Access | Everything present is visible | Retrieved by query |
| Cost model | Paid on every call | Paid on write and recall |

Choosing what enters the window is its own discipline, covered in [context engineering](/context-engineering). [Working memory](/glossary/working-memory) names the in-window state; [long-term memory](/glossary/long-term-memory) names the store outside it.

## Related concepts

- **[Context rot](/glossary/context-rot)**: degradation over long contexts.
- **[Working memory](/glossary/working-memory)**: what the agent holds in the window for the current task.
- **[Session memory](/glossary/session-memory)**: conversation-scoped state that ends with the session.
- **[Long-term memory](/glossary/long-term-memory)**: persistent storage across sessions.
- **Evaluation**: the [benchmark methodology](/benchmarks/methodology) describes how agent memory systems are evaluated.

## Frequently asked questions

### What is a context window in an LLM?

It is the maximum amount of text, measured in tokens, that the model can consider in a single call, covering the prompt and the generated output together.

### What happens when the context window is full?

Older or lower-priority content has to be dropped, truncated, or summarized to make room. Whatever is removed is invisible to the model on that call, even if it appeared earlier in the conversation.

### Is a bigger context window the same as memory?

No. A larger window lets one call see more text, but it is still emptied between calls, costs tokens every time, and can degrade over very long inputs. Memory persists outside calls and is retrieved selectively.

## Related

- [What is context rot?](https://past.dev/glossary/context-rot)
- [What is working memory?](https://past.dev/glossary/working-memory)
- [What is long-term memory?](https://past.dev/glossary/long-term-memory)
- [What is session memory?](https://past.dev/glossary/session-memory)
- [Memory API quickstart](https://past.dev/docs/memory-api/quickstart)