In this guide
A context window is the maximum amount of text, measured in tokens, that an AI model can take into account at one time. It includes your prompt, any documents you provide, the earlier conversation and the reply the model is writing. Anything outside the window is not visible to the model, which is why long chats can seem to forget early details.
What the context window includes
Think of the context window as the model's working desk. Only what is on the desk can be used for the current answer. It holds:
- The hidden instructions set by the app or provider.
- The conversation so far, both your messages and the model's earlier replies.
- Any text you paste or files you upload.
- Results from tools such as search, if the app uses them.
- The reply currently being generated.
The window is measured in tokens, not words, so the real amount of text it holds depends on the language and content. Different models have different window sizes, and these figures change often, so check the provider's current documentation for exact numbers.
Context window is not long-term memory
A model does not store your conversation internally between requests. The chat app resends the earlier messages each time, as described in how AI chatbots like ChatGPT work. So the "memory" of a chat lasts only as long as the history fits in the window.
Some products add a separate memory feature that saves chosen facts about you and inserts them into future chats. That is an app feature layered on top of the model, and its behaviour varies, so read the product's documentation and privacy settings.
What happens when the window fills up
The exact behaviour depends on the app, but common outcomes are:
- Old messages are dropped. The app removes the earliest turns to make room, so the model loses early instructions or facts.
- The conversation is summarised. The app compresses earlier turns, which can lose detail.
- The request is rejected. An error says the input is too long.
- The reply is cut off. There is not enough room left to finish writing.
A less obvious problem is that even inside the limit, models can pay uneven attention to long inputs. Details buried in the middle of a very long document are sometimes missed. A bigger window helps, but it does not guarantee that every detail will be used well.
Signs you have hit the limit
- The model contradicts something you told it earlier.
- It stops following a format or rule you set at the start.
- It asks for information you already supplied.
- Answers get vaguer or more generic as the chat grows.
These symptoms can also lead to invented details, which is why context problems and AI hallucinations are closely linked.
How to work within the context window
- Start a new chat for a new task. Old, unrelated text only takes up space and can distract the model.
- Put the most important instructions where they are easy to find. Repeat key constraints near your final request in long prompts.
- Send only what is relevant. Paste the needed sections, not entire documents.
- Summarise and restart. Ask for a short summary of decisions so far, then paste it into a fresh chat.
- Split large jobs. Process a long document in sections, then combine the results.
- Ask for evidence. Request that the model quote the part of your text it used, so you can check it actually read it.
When documents are too large: retrieval
If you need an AI system to work across a large collection of documents, such as a company knowledge base, pasting everything in is not realistic. A common solution is to search for the few relevant passages first and give only those to the model. This approach is explained in what RAG (retrieval-augmented generation) is.
Why a larger window is not always better
A bigger window lets you include more material, but it can also mean higher cost, slower responses and more chance of irrelevant text distracting the model. Often a short, well-chosen input beats a huge one. The skill is deciding what the model really needs.
If you want to practise writing focused prompts and managing long tasks, the QAM.AI curriculum includes practical exercises on exactly this.
Key takeaways
- The context window is the text, measured in tokens, a model can consider at one time.
- It covers instructions, conversation history, documents and the reply itself.
- It is not permanent memory: when history no longer fits, details are lost.
- Start fresh chats, trim inputs and summarise to stay within limits.
- For large document collections, retrieval is usually better than pasting everything.
Frequently asked questions
Does a bigger context window make a model smarter?
Not by itself. It lets the model see more text at once, but the quality of reasoning and accuracy depends on the model and on how well your input is organised.
Why does the AI forget what I said earlier in a long chat?
Either the earlier messages were dropped to make room, or they are still present but received less attention. Restating the key points or starting a new chat with a short summary usually fixes it.
How do I find a model's context window size?
Look in the provider's current model documentation or product description. Do not rely on older articles, because sizes and product limits change frequently.
This guide is general educational information and is reviewed periodically. AI tools change quickly, so check each vendor's current documentation before relying on specific features or limits.