What Is a Context Window? A Simple Explanation with Examples

Updated · By Viviai

A context window is the maximum amount of text an AI can consider at once, measured in tokens. It includes your message, the conversation history, any documents you provide, and the answer it generates.

The short definition

The context window is the working memory of a language model for a single request. Everything the model needs to reference must fit inside it. Once content falls outside the window, the model cannot see or use it.

An analogy: a desk, not a library

Imagine a desk of fixed size. You can spread out notes, a book, and a letter, and while they sit on the desk you can reference them instantly. The library behind you holds far more, but you cannot look at anything unless it is placed on the desk.

The context window is the desk. Training data is the library — enormous, but not directly visible during a conversation.

What counts toward the limit

The window holds four things together:

  1. Your current prompt.
  2. Earlier messages in the conversation.
  3. Uploaded documents and pasted text.
  4. The model's output as it is generated.

A long conversation or a large document consumes the same shared budget.

What happens when you exceed it

Why bigger is not always better

A larger window is useful, but there are trade-offs:

Practical tips

Context window vs memory

Context window Memory
Scope One request Stored across interactions
Nature Fixed capacity A feature added by the product
Content Everything in the current chat Selected facts and preferences
Limit Token-based Policy and feature-based

Frequently asked questions

How big is a typical context window? Sizes vary widely by model and product, from modest windows to ones holding hundreds of thousands of tokens. Check the current model specification.

Does a bigger window mean smarter answers? Not by itself. It allows more reference material, but reasoning quality depends on the model.

Why did the AI forget something I said earlier? If it left the window, the model can no longer access it. Start a focused chat or restate the detail.

Can I feed in a whole book? Technically, if the book fits the window, but the model may not weight every chapter equally, so verify key points.

Key takeaways

Read next: what a token is and how to summarize long PDFs with AI.

Sources

  1. https://www.zml.kit.edu/english/agentic-ai.php

Learn by doing

Read a guide, then practice with bite-sized AI lessons you can take offline.

Start learning free