← AI Engineering Roadmap

Step 6 of 15

What Is a Context Window? (The AI's Short-Term Memory)

What Is a Context Window? — AI Engineering Roadmap by Haroon Muhammad
TL;DR: The context window is the AI's short-term memory — how much text it can look at in one go. Too much, and it forgets the oldest parts.

Explain it like I'm 5

Imagine a whiteboard. You can write a lot on it, but once it's full, you have to rub off the top to add more at the bottom. The context window is the AI's whiteboard. Old notes fall off when it gets full.

What is the context window?

The context window is the total amount of text (measured in tokens) the model can read at once — your prompt, the chat history, any files you paste, and its own answer all count. It's the AI's working memory for that single moment.

Why does it matter?

If your conversation or documents are bigger than the window, the model can't see all of it. It may forget what you said earlier, miss details buried in a long file, or lose the plot in a long chat.

A everyday example

Ever had a long chat where the AI forgot something you said at the start? That's the context window filling up. The earliest messages slid off the whiteboard to make room for new ones.

How builders handle it

AI engineers deal with this by sending only the most relevant text, summarizing long history, or fetching just the right pieces on demand (that last trick is called RAG — coming up later in this roadmap).

Frequently asked questions

Is a bigger context window always better?

Not always. Bigger windows cost more and can still lose details in the middle of huge inputs. Sending the right text often beats sending all of it.

Does the AI remember me between chats?

By default, no. Once a chat ends, the window is wiped. Any long-term memory has to be built in on purpose by the developer.

What counts toward the context window?

Everything in that turn: your instructions, the conversation so far, any pasted files, and the model's own reply all share the same token budget.

Want to know exactly where you stand on the road from using AI to building it? Take the free 3-minute AI Builder Scorecard and get your single biggest gap.