06

Lesson 6 · 2 min

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.

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.

Try it

Why chatbots forget

Tap Next message to move the chat on. The AI can only see what fits inside the memory window.

What the AI can see14 / 60 tokens
  • Hi! I'm Amara, and I'm planning a trip to Lisbon.14 tokens

0 messages forgotten so far.

1 / 10

Do it now

Start fresh on purpose

  1. 1.Next time a long chat starts giving worse answers, ask for a summary using the prompt below.
  2. 2.Open a new chat and paste the summary as your first message.
  3. 3.Notice how the answers get sharper again.
Summarise this conversation so far in under 150 words: my goal, the decisions we made, and any rules I asked you to follow. I will paste it into a new chat.
A chatbot ignores a rule you gave it at the start of a very long chat. What is the most likely reason?

Quick check

A chatbot ignores a rule you gave it at the start of a very long chat. What is the most likely reason?

Words from this lesson

Context window
The maximum amount of text an AI can look at in one go. Anything beyond it is forgotten for that conversation.
Token
A chunk of text, often part of a word, that AI reads and writes in. Limits and prices are counted in tokens.
LLM
An AI trained on huge amounts of text to predict the next word, which lets it write, summarise, translate and chat.