AI builder glossary
Context window
The maximum number of tokens a model can take in a single request, covering instructions, history, documents, tool definitions, and the reply it writes.
The context window is the model's entire working view for one call. Your system prompt, tool definitions, conversation history, retrieved passages, uploaded files, and the output budget all share it. Anything outside the window simply doesn't exist for that request.
Windows have grown dramatically. Current Claude models accept up to 1M tokens, and other frontier models offer similar sizes, so the hard limit is rarely the first thing you hit. Cost and latency usually bite earlier: every token you send is billed and processed on every call, and a chat that resends a long history pays for it again on each turn.
A bigger window is not a reason to send everything. Models attend unevenly across very long inputs, irrelevant material can distract them, and a request that is mostly noise costs more and often answers worse. Treat the window as a budget you allocate deliberately: decide what earns a place, what gets summarized, and what gets dropped first when space runs short.
Know the window of every model you route to, especially smaller or local models, which can be far tighter. A feature that works on a large-window model can silently truncate history on a fallback.
A chat assistant keeps the last ten turns verbatim, replaces older turns with a short running summary, and reserves room for retrieved articles, so conversations stay well inside the window even after an hour.
Learn more in the course
- Tokens, Context Windows, and What They CostModule 1 · LLM Fundamentals for Builders
- Context Assembly: Deciding What the Model SeesModule 2 · Prompting & Context for Apps
- Managing Conversation History and StateModule 2 · Prompting & Context for Apps
- Long Context vs. RAG: When You Don't Need RetrievalModule 5 · Embeddings, Search & RAG
Related terms
Go from definitions to doing
Learn to build AI-powered apps in 132 practical lessons.