L006 · How AI thinks · 2 min · Interactive
The context window: AI's short-term memory
A chatbot can only see a limited amount of text at once, and in a very long chat the oldest parts can slip away.
01 · The idea
The context window is everything the model can see right now: your messages, its replies, any files you added, and hidden instructions. It is measured in tokens.
Modern windows are large. Many models can hold a whole book. But they are not endless, and models pay less attention to details buried in the middle of a long chat.
When a chat gets very long, the tool may drop or squash the oldest messages. That is why a chatbot can forget a rule you gave it an hour ago.
Try it below: keep chatting and watch the earliest messages fall out of the window.
02 · Think of it like this
It is like a whiteboard. You can write a lot, but when it fills up, someone wipes the top to make space. Anything wiped is gone unless you write it again.
03 · Try the toy
Why chatbots forget
Tap Next message to move the chat on. The AI can only see what fits inside the memory window.
- Hi! I'm Amara, and I'm planning a trip to Lisbon.14 tokens
0 messages forgotten so far.
04 · Do it now
05 · Quick check
Words in this lesson
See also
L004How AI thinks · 1 min
Tokens: how AI reads
AI does not read words; it reads tokens, small chunks of text that are often parts of words.
L003How AI thinks · 1 min
What a chatbot really does
A chatbot writes its answer one small piece at a time, each time picking a likely next word.
L032How AI thinks · 2 min
Why AI forgets in long chats
Long chats slowly get worse because the model has to juggle more and more text, and older details get crowded out.
L012Asking well · 2 min
Temperature: safe or creative
Temperature is the setting that decides whether AI picks the most likely next word or takes a risk.