# What Is a Context Window?

> A context window is the maximum amount of text an LLM can process in a single request — limiting how much conversation history, documents, and tool results an agent can hold.

**Term:** Context Window  
**Category:** Fundamentals  
**Also known as:** context limit, token limit, context length  
**Updated:** 2026-07-22  
**Canonical:** https://www.frameworkr.com/glossary/context-window

---

A **context window** is the maximum amount of text (measured in tokens) that an LLM can process in a single request. Everything the model "sees" — system prompt, conversation history, retrieved documents, tool results — must fit within this limit.

## Why context window matters for agents

Agents accumulate context rapidly. Each loop iteration adds:

- The user's original request
- Previous reasoning traces
- Tool call arguments and results
- Retrieved documents (via RAG)

A long-running agent task can exceed the context window, forcing you to truncate, summarize, or split the work.

## Managing context in agents

Common strategies:

- **Summarization** — Compress older conversation turns into a summary
- **Selective retrieval** — Only fetch the most relevant documents (RAG)
- **External memory** — Store state outside the prompt, retrieve on demand
- **Task decomposition** — Break large jobs into smaller agent runs
- **Context budgeting** — Reserve tokens for tools vs. history vs. instructions

## Context window sizes (2026)

Windows vary widely by model — from ~128K tokens on many production models to 1M+ on specialized variants. Bigger is not always better: larger contexts increase cost, latency, and the risk of the model losing focus on important details ("lost in the middle" problem).

## Related reading

See [Agent Memory](/glossary/agent-memory) and [RAG](/glossary/rag) for how agents work within context limits.

## Related terms

- [llm](https://www.frameworkr.com/glossary/llm.md)
- [agent memory](https://www.frameworkr.com/glossary/agent-memory.md)
- [rag](https://www.frameworkr.com/glossary/rag.md)


---

_Published by Frameworkr — https://www.frameworkr.com_
