Skip to content
Nitmonk
Tokens & Embeddings

Context Window

How much text an AI can consider at once.

Context Window — infographic explaining How much text an AI can consider at once.
Context Window — visual explainer by Nitmonk.

The context window is the amount of text (measured in tokens) an AI model can consider at one time. It includes your input, the conversation history and any documents provided before the model generates a response.

In simple terms

The model's short-term memory — the bigger it is, the more it can consider at once.

How it works

  1. 1Input & history: your message and previous conversation are added.
  2. 2Add extra context: system prompt, documents, code or other data are included.
  3. 3Fit in context window: all tokens must fit within the model's maximum.
  4. 4Model processes: the model reads and understands everything inside the window.

Key points

  • System prompt, chat history, user input and retrieved docs all count toward the limit.
  • Bigger windows allow longer conversations and larger documents.
  • Sizes vary: e.g. 4K–16K, 128K, 200K, up to 1M+ tokens.
  • Manage it by summarising history, trimming input, or using retrieval (RAG).

Why it matters

The context window sets a hard limit on how much a model can 'see' at once. Managing it well — trimming, summarising, retrieving only what's needed — is key to accurate, affordable AI apps.

Frequently asked questions

What happens when I exceed the context window?
Older content gets truncated or must be summarised, so the model can lose track of earlier information.
Do documents count toward the window?
Yes — the system prompt, history, your question and any attached text all share the same token budget.