Close

AI Basics - LLM Context Window

[Last Updated: Jan 18, 2026]

In the previous tutorial, we introduced the three types of LLM memory. Today, we focus on the most important one for daily users: the Context Window. This is the model's "active workspace" or short-term memory.

The context window is the maximum amount of information (measured in tokens) that an AI can process at one single time. Think of it like a physical desk: you can only fit so many papers on the desk before you have to move some off to make room for new ones.

Everything inside the window is "remembered" for the current response. Everything outside the window is completely invisible to the AI.

How the "Memory" Stays Consistent

LLMs are technically stateless, meaning they don't actually remember the past. To make it feel like they do, the application (like a chat interface) performs a clever trick:

Every time you send a new message, the system bundles your entire previous conversation and sends it back to the AI. The AI reads the whole history from scratch to generate the next response.

Input = [Previous User Messages] + [Previous AI Answers] + [Your New Question]

The "Token" Limit and Overflow

Every model has a hard limit, such as 32,000 or 128,000 tokens. When the conversation exceeds this limit, the system must choose what to forget. Usually, it uses one of two methods:

  • First-In, First-Out: The very first messages of your chat are deleted to make room for the newest one.
  • Summarization: The system creates a short summary of the early chat and keeps that summary in the window while deleting the original full text.

Practical Tips for Managing Context

Because short-term memory is limited, you can get better results by following these rules:

Be Concise: Don't fill the window with unnecessary fluff. The more "garbage" in the window, the less "attention" the AI can pay to your actual goal.

Reset Often: If you are starting a completely new topic, start a fresh chat. This clears the context window and prevents old, irrelevant information from confusing the AI.

Use Clear References: If a chat gets very long, explicitly remind the AI of important facts from earlier, just in case they are nearing the edge of the window.


What's Next?

Now that you know how the AI handles short-term conversation, you might wonder: "What if I need the AI to know about a 500-page manual that won't fit in the window?"

In the next tutorial, we will explore RAG (Retrieval-Augmented Generation), the technology that lets AI "search" through massive amounts of data.

See Also

Join