What is a context window?
A context window is the limit, measured in tokens, on how much text a language model can read and take into account in a single request. The system instructions, the conversation history, any attached documents and the model's own answer all have to fit inside it. When the limit is reached, older content is dropped or the request fails, so you have to choose what the model sees.
Definition
A context window is the limit, measured in tokens, on how much text a language model can read and take into account in a single request.
How does a context window work?
A large language model reads text as tokens, not as words. The context window is the maximum number of tokens it can process in one request. Input and output both count: system instructions, conversation history, attached documents, tool results and the answer the model writes. The limit differs from model to model and tends to grow with new releases.
Why does the context window matter?
It decides three things: how much material you can show the model, how long a conversation can run, and what the request costs. Filling the window is not always a good idea. Longer contexts cost more and respond more slowly. A model can also overlook details buried in the middle of a long text.
That is why enterprise assistants do not send the whole archive to the model. With RAG, only the passages relevant to the question are retrieved and added to the context. How documents are split into chunks directly affects what fits.
What to watch for
Token counts vary by language. Morphologically rich languages such as Turkish usually need more tokens than English for the same content, so fewer pages fit in the same window. Test with your own documents instead of relying on a general estimate.
Everything in the context is sent to the model provider. For documents with personal data, decide early what may enter the context, under GDPR or, for data processed in Türkiye, KVKK, Türkiye’s data protection law.
Further reading
What drives the cost of a RAG project?One-off and running cost drivers of a RAG knowledge assistant, the choices that raise or lower them, and what to prepare before a quote.
How to evaluate a RAG systemTest sets, metric choice, LLM-as-judge and live monitoring for measuring retrieval and generation quality in RAG systems.
AI-powered process automationWhere language models fit into business workflows, which process to start with, and how to set up human approval, data protection and measurement.Related terms
- Token (AI)A token is the unit of text, often smaller than a word, that a language model reads and writes in and that usage is billed by.
- LLM (Large Language Model)An LLM (large language model) is an AI model trained on very large amounts of text that answers questions, summarises, translates and writes by predicting what text should come next.
- RAG (Retrieval-Augmented Generation)RAG (Retrieval-Augmented Generation) is an AI architecture that lets a language model retrieve relevant passages from a chosen document collection, such as a company's own documents, and use them as context before it writes an answer.
- ChunkingChunking is a RAG preparation step that splits long documents into smaller, self-contained passages for embedding and retrieval.
- System PromptA system prompt is the instruction text given to a language model before a conversation starts, which sets the model's role, tone, limits and output format.
Frequently asked questions
Is a model with a larger context window always better?
No. A larger window lets you pass more text at once, but every token is billed and responses take longer. In very long contexts a model can miss details in the middle. For most tasks, selecting the relevant passages gives better results than sending everything.
Is the context window the model's memory?
It is not permanent memory. The model only sees the text sent in that request. A chat appears continuous because the application resends the history each time. Lasting knowledge needs a document index or a separate memory layer.
What happens when the window is full?
It depends on the application. Some drop the oldest messages, some summarise the history, and some return an error. When a model forgets an early instruction in a long chat, this is usually the reason.
Let’s talk about your transformation
Tell us which work repeats every week. We will tell you honestly whether it is worth automating.
How we start
- A free first callWe pin down the problem and the goal together.
- A 2-week discovery sprintWe look at the data, the process and the tools, and decide where to start.
- A written proposalScope, architecture and timeline, in writing.