Context window
How much an AI can remember at once
Have you noticed an AI "forgetting" something you told it earlier in a long chat? That's the context window at work. Understanding it will save you a lot of frustration.
What is a context window?
Think of a whiteboard. You can write a lot on it, but it has edges. When it's full, you have to erase old notes to make room for new ones.
The context window is the AI's whiteboard. It is the AI's short-term memory:
- It holds everything the AI can "see" right now.
- It is measured in tokens.
- Anything outside it, the AI simply cannot see.
What fills the context window
Many things share the same space:
- The system message and any custom instructions
- Every message you sent in this chat
- Every answer the AI gave
- Files, images, and documents you uploaded or pasted
- The new answer it is writing right now
Modern models have big context windows. But long chats with pasted files can still fill them up.
Long chats forget early details
When a chat gets very long, the AI may lose track of what you said at the start. Some apps quietly drop or shorten old messages to make room. Even before that, details in the middle of a long chat get less attention.
Signs this is happening:
- The AI ignores a rule you set at the start.
- It asks for information you already gave.
- It brings back a bug you fixed earlier.
How to work with it
Start fresh chats
Use one chat per task. When you switch topics, or the chat feels confused, open a new chat. Before you leave, ask for a summary to carry over:
Summarize everything we decided in this chat as a short
bullet list I can paste into a new chat. Include the app
name, the features, and any rules we agreed on.Paste key info again
If something is important, repeat it. Paste the summary at the top of the new chat, or remind the AI: "Remember, the app must work on mobile."
Use files and projects
Many chat apps let you save files and instructions in a "project" (ChatGPT and Claude both call it this; Gemini has a similar feature). Every new chat in that project can use those files. Later in the course, you'll keep notes for your AI in project files like a README.
Common mistakes
- One giant chat for everything. Split work into focused chats.
- Assuming the AI remembers other chats. Most of the time each chat starts empty. Some apps have a memory feature, but don't rely on it for important details.
- Pasting the same large file many times. Each copy uses more of the window. Paste it once, or add it to a project.
Practice
Try these exercises to lock in what you just learned.
What's next?
When an AI loses context or lacks information, it may make things up. Next, let's learn about hallucinations and how to catch them.