Tokencito Game of the day Play

What is a context window in AI?

The context window is the maximum amount of text, measured in tokens, that an AI model can take into account at once: your messages, its answers, the instructions and any documents you give it. Whatever falls outside that window does not exist for the model. That is why it seems to forget the beginning of a long chat.

💬Conversation history📱The app builds context📏Token limit🤖The model answers

Put it to the test

A question from the app. Pick an answer.

What does it look at to predict what comes next?

Play the full lesson: How does it predict?

Why AI "forgets" in a long chat

The model keeps no memories between one message and the next. For each answer, the app sends it the conversation again along with your new message. While everything fits in the window, it seems to remember. When the chat grows too big, the app usually cuts the oldest part or replaces it with a summary.

An example: at the start you tell a bakery assistant you are celiac. Forty messages later you ask for a bread. If the app trimmed or summarized the chat and left that detail out, the model no longer receives it and cannot take it into account. So when something like that fails, it is worth asking what actually reached the model.

What takes up room in the window

Not just your messages. The instructions the app gives the model (which you do not see), the files you attach, the chunks a RAG search brings in and the answer the model is writing all count too. Everything shares the same space, and choosing what goes in is context engineering.

With example numbers: if the window were 200,000 tokens and you paste documents worth 150,000, about 50,000 are left for the instructions, the chat and the answer. That is why, after pasting long documents, the app may have to trim the conversation sooner.

Other languages fill it faster

Many tokenizers split languages like Spanish or Portuguese into more pieces than English. So the same chat written in one of those languages usually takes more tokens and fills the window sooner. If you use AI in a language other than English and it seems to forget quickly, it is not always the model: the language weighs in too.

Common mistakes and what to do

"With a huge window it remembers everything perfectly." A big window does not guarantee that every detail is used well. Check that the answer respects the important constraints. "The window is the app's memory." No: some apps keep notes separately and send them again with every message, but that is a different piece.

What to do: if a detail is key, repeat it close to your question. If the chat is already very long, ask for a summary, open a new chat and start by pasting that summary.