What is Context Window?
The maximum amount of text an LLM can process in a single interaction.
Definition
A context window is the total amount of text (measured in tokens) that an LLM can consider at one time — including the system prompt, conversation history, tool results, and any documents provided. Content outside the context window is inaccessible to the model during that interaction. Modern LLMs have context windows ranging from 8K to 1M+ tokens. Longer contexts allow agents to process more data but cost more to run.
Example
Claude 3.5's 200K token context window means an agent can process roughly 150,000 words of text in one shot — enough to read an entire large codebase or many documents before responding.
Context Window vs rag: What's the difference?
The maximum amount of text an LLM can process in a single interaction.
The context window is what fits in memory right now. RAG is a technique for deciding what to put in the context window — retrieving only the most relevant information rather than dumping everything.