AI Basic Concepts

What is a Context Window and Why is it Important?

When you have a conversation with an AI or build a web application, the system doesn't just send your last question to the model. To provide a relevant answer, the model needs to 'see' the context of the conversation or documents. The maximum amount of text the model can process at one time is called the context window.

You can compare it to the AI's short-term memory. As soon as the input becomes larger than this window, the model starts to 'forget' the oldest or least prominent information. This is measured in tokens (parts of words).

Practical Examples: When is it Crucial?

1. Remembering Chat History

When working iteratively, you want the model to remember instructions from your first message. A small context window results in an AI that loses track of previous agreements on formatting or variables halfway through the session.

2. Analyzing Long Documents

With advanced models like Claude Pro, which offer a very wide context window, you can input extensive reports all at once for analysis. With models that have a smaller window, you will run into error messages or get incomplete summaries.

3. RAG (Retrieval-Augmented Generation)

RAG works excellently to bypass the limitations of a context window. Instead of stuffing a giant database directly into the prompt, the system uses vector search to look locally for the most relevant paragraphs (for example, via OpenClaw). Only this specific fraction is placed into the context window of models like DeepSeek or other LLMs. This is faster, cheaper, and more accurate.

💡 Tip: A larger context window is impressive, but requires substantially more compute (processing power). This translates directly into higher costs per API call and longer waiting times.

The Do's and Don'ts

Frequently Asked Questions (FAQ)

How many words fit in a token?

As a rough estimate (note: this varies per tokenizer), 1 token corresponds to about 0.75 words in the English language. For Dutch, this ratio is often slightly lower because we use many long, compound words.

What is the 'Lost in the middle' phenomenon?

Various benchmarks show that LLMs tend to pick up information at the beginning and the end of a fully filled context window well. However, crucial facts hidden somewhere in the middle of the document are more easily overlooked.