VisualAI
Chapter 8 · Using AI Well

The Context Window

An AI's memory has a hard edge. Fill it up and the oldest words quietly fall off the back.

7 minLesson 20 of 23

A chatbot can feel like it remembers everything you've ever told it. It doesn't. Its memory has a hard edge — and when you reach it, the oldest words quietly fall off the back.

Every time you send a message, the model doesn't just read your latest line. It re-reads the entire conversation, from the top, all over again — because it has no memory between turns. That whole transcript has to fit inside a fixed budget called the context window, measured in tokens. Once the conversation grows past that budget, something has to give.

The Forgetting Window

Add turns · drag the window size

Context window30 / 40 tokens
Window size
pinned factImportant — remember this: my name is Ada and my dog is Pixel.
Got it, Ada — noted. How can I help?
Give me a quick banana-bread recipe.

You ask, ten turns later: “What's my name?”

Your name is Ada, and your dog is Pixel.

Tokens are counted from the newest message backward. The model never “deletes” anything — the oldest turns simply stop being sent. Everything still fits — for now.

Tokens are counted from the newest message backward. Keep chatting and the pinned fact at the top eventually slides off the back — and the model genuinely can no longer answer 'what's my name?'.
Try this

Keep clicking Add another turn and watch the pinned fact at the top fade and fall out of the window. The moment it does, the answer to “what's my name?” flips from confident to clueless. Now drag window size up — give it more room and the fact survives far longer.

Why it forgets the middle, not the magic

This is the single most useful thing to understand about long chats. The model isn't getting bored or losing focus — it literally stops being shown the early turns once they no longer fit. Nothing is stored between messages; each reply is generated fresh from whatever slice of the transcript still fits in the window. Run out of room and the start of the conversation is simply no longer in front of it.

Key idea

The context window is the model's entire working memory for a conversation. It has no notebook, no database, no recall of past chats — only the tokens you fit inside the window right now. When something “gets forgotten,” it usually just fell off the back.

This is why the practical advice works: put the important stuff near the end, restate key facts in long sessions, and start a fresh chat when you switch topics. It also explains why modern models advertise their window size as a headline feature — a bigger window means more of your document, your code, or your conversation stays in view at once. But bigger is never infinite, and reading a huge window for every single reply is expensive, which is the tension the next lesson resolves.

The payoff

So the window is finite — but your knowledge isn't. If the model can only hold a few thousand tokens at a time, how do you let it answer questions about a thousand-page manual? You don't cram it all in. You teach it to look things up first. That's retrieval — and it's next.