---
title: "What is a context window? Definition and examples"
description: "A context window is the maximum amount of text, measured in tokens, that a language model can take in and consider at once, including the prompt, any…"
canonical: "https://finic.ai/glossary/context-window"
last-updated: "2026-12-03"
---

# What is a context window?

A context window is the maximum amount of text, measured in tokens, that a language model can take in and consider at once, including the prompt, any attached data and its own reply.

Also called: context length, context size

## How it works

Every request to a model has a budget of [tokens](https://finic.ai/glossary/llm-token). The system instructions, the conversation so far, any retrieved documents and the model's answer all share that budget. If the total is too large, the oldest or least important content must be cut or the request fails.

Larger windows let a model work with longer documents in one pass. But a big window does not guarantee the model uses all of it well. Details in the middle of a long input can get less attention than details at the start or end.

## Why it matters for risk work

Fraud and compliance cases are often long: transaction histories, account notes, emails and documents. Teams must decide what goes into the window. Putting in too little can hide key facts; putting in too much adds cost and noise.

A common approach is to store case data outside the model and pull in only the relevant parts with [retrieval-augmented generation](https://finic.ai/glossary/retrieval-augmented-generation). Summaries of older events can also keep long histories in view without filling the window.

## Security points

Everything in the window can influence the model. If an agent reads a web page, email or file that contains hidden instructions, those instructions sit in the same window as your own. This is the root of [prompt injection](https://finic.ai/glossary/prompt-injection), and it is why untrusted content should be clearly separated and treated with care.

## Example

A hypothetical analyst asks a model to review a merchant's last year of activity. The raw data is far too large for the window, so the tool first groups transactions by week, flags outliers and passes only those summaries and flagged rows to the model.

## Related terms

- [Token (AI)](https://finic.ai/glossary/llm-token.md): In AI, a token is the small unit of text, often a word or part of a word, that a language model reads and writes. Model limits and usage prices are usually counted in tokens.
- [Retrieval-augmented generation (RAG)](https://finic.ai/glossary/retrieval-augmented-generation.md): Retrieval-augmented generation (RAG) is a method where an AI system first finds relevant documents or records, then gives them to a language model to use when it writes its answer.
- [Prompt injection](https://finic.ai/glossary/prompt-injection.md): Prompt injection is an attack in which text given to an AI model contains instructions that override what its developer or user intended, so the model leaks data or takes unwanted actions.
- [Large language model (LLM)](https://finic.ai/glossary/large-language-model.md): A large language model (LLM) is a neural network trained on large amounts of text to predict and generate language. It powers chat assistants, AI agents and many text tools.
- [Agent memory](https://finic.ai/glossary/agent-memory.md): Agent memory is how an AI agent keeps information across steps and sessions, such as past conversations, user preferences and task progress, beyond one prompt.
