Course 6, lesson 54 of 100, Ages 12+

Context windows

An AI’s working memory

Like I’m 5

When you chat with an AI, it can only look at a certain amount of the conversation at once, like reading through a window. That's its context window.

The big idea

The context window is the maximum number of tokens a model can consider at once: your messages, its replies, and any documents you paste in. Some models handle a few pages, others whole books.

When a conversation is longer than the window, older parts fall out of view, so the model may forget early details. Many chatbots don't learn from your chat afterwards; they only remember within the window, unless a separate memory feature saves notes.

Examples

  • Long chats: After a very long chat, it may forget your name from the start.
  • Pasting a book: Large windows let you ask questions about a whole report.
  • Fresh start: A new chat usually begins with an empty window.

How it works

  1. Your messages and documents enter the context window.
  2. The model reads everything in the window to reply.
  3. If it overflows, the oldest parts drop out of view.

Check your understanding

What is a context window?
Options: How much text a model can look at at once; A real window in the computer; A list of passwords.
Answer: How much text a model can look at at once. It's the model's working memory for the current conversation.
Why might a chatbot forget something from early in a long chat?
Options: It fell outside the context window; It got tired; It deleted the internet.
Answer: It fell outside the context window. Once text leaves the window, the model can't see it.

Remember

A context window is the AI's working memory. Too much text, and early parts fall out.

Talk about it

How much of a conversation do you remember after an hour? How is that like a context window?

Go deeper

Window sizes are measured in tokens. Attention cost grows with sequence length, so long-context models use efficient attention variants. Retrieval (RAG) and memory tools extend effective context.