# What is a context window in AI?

> A context window is the maximum amount of text an AI model can consider at once. Learn what tokens are, what happens when it fills up, and how to work within it.

URL: https://www.jalkarna.in/based/learn/what-is-a-context-window/  
Last updated: 2026-11-16

A context window is the maximum amount of text an AI model can read and consider at one time when producing a reply. It includes your prompt, earlier messages in the conversation, any instructions, and the reply being written. Anything outside the window is invisible to the model.

Think of it as the model's working desk. Only what fits on the desk can be used, and it has no view of papers left in the filing cabinet.

## How is a context window measured?

Context windows are measured in tokens, not words. A token is a small chunk of text, which can be a whole word, part of a word, or punctuation. In English, a token is often a bit shorter than a word, so a window measured in tokens holds somewhat fewer words than the token count suggests. The exact ratio varies by model and language, so use it only as a rough guide.

Different models have different window sizes, and larger windows are possible but cost more computing power to use. Chat applications may also set their own, smaller limits on how much they send.

## What happens when the context window fills up?

The model cannot take in more than its limit, so the application must decide what to leave out. Common strategies are:

- **Dropping the oldest messages** so the newest fit.
- **Summarizing earlier parts** of the conversation into a shorter note.
- **Limiting each message's length** so no single message uses up the space.

The result is that long conversations can seem to "forget" earlier details. The model did not lose them from a memory; they simply were not included in the text it was given this time.

## Context window vs memory

These are often confused. The context window is short-term: whatever text is supplied for this reply. [AI memory](https://www.jalkarna.in/based/learn/what-is-ai-memory/) is a separate system that stores selected facts and feeds them back into the window later. A bigger window helps a conversation, but it does not create lasting memory by itself.

## Does a bigger context window mean better answers?

Not automatically. More space lets you include longer documents or conversations, but quality still depends on the model and on what you put in. Cluttered or irrelevant text can distract the model, so it often helps to include only what the task needs. This is part of [writing good prompts](https://www.jalkarna.in/based/learn/how-to-write-good-prompts/).

## How can you work within a context window?

1. Put the most important instructions and facts in the message itself rather than assuming the model recalls them from far back.
2. Restate key details when a conversation gets long.
3. Start a fresh conversation for a new topic.
4. Paste only the relevant excerpt of a long document instead of all of it.
5. Ask for a summary and carry that forward.

## Why this matters for hallucinations

If the needed information is outside the window, the model may fill the gap with a plausible guess. See [what are AI hallucinations](https://www.jalkarna.in/based/learn/what-are-ai-hallucinations/).

## How Based handles context

Based reads a bounded window of recent channel messages to follow a conversation. By default that is 40 messages, up to 12,000 characters in total, and up to 500 characters from any single message. Server staff can change these limits, and nothing is archived. If you want Based to use older details, restate them in your message. The [AI chat docs](https://www.jalkarna.in/based/docs/ai-chat/) and [dashboard](https://www.jalkarna.in/based/dashboard/) explain the settings. For the model side of the story, read [what is a large language model](https://www.jalkarna.in/based/learn/what-is-a-large-language-model/).

## FAQ

### What is a context window in simple terms?

It is the amount of text an AI can consider at once. Anything that does not fit in the window is not seen by the model for that reply.

### How is context window size measured?

In tokens, which are small chunks of text such as words or parts of words. The number of words that fit depends on the model and the language.

### Why does an AI forget what I said earlier?

Older messages may have been cut or summarized to fit the window, so the model never saw them in the latest reply. Restating key details fixes it.

### Is a context window the same as memory?

No. The window is short-term working space for one reply, while memory stores facts to bring back later.

## Related
- [What is a large language model (LLM)?](https://www.jalkarna.in/based/learn/what-is-a-large-language-model/)
- [What is AI memory?](https://www.jalkarna.in/based/learn/what-is-ai-memory/)
- [What is an AI chatbot?](https://www.jalkarna.in/based/learn/what-is-an-ai-chatbot/)
- [What are AI hallucinations?](https://www.jalkarna.in/based/learn/what-are-ai-hallucinations/)
- [How to write good AI prompts](https://www.jalkarna.in/based/learn/how-to-write-good-prompts/)
