# Context Window

URL: https://www.onsomble.ai/tools/ai-glossary/context-window

Published: 2026-03-15 00:00:00.000Z

The maximum amount of text (measured in tokens) that a language model can consider at once — including both the input prompt and the generated output.

Category: Models & Platforms

## Size matters, but not how you think

Context windows have grown dramatically: from 4K tokens (early GPT-3.5) to 200K (Claude) to 1M+ (Gemini). But bigger isn't always better. Models can struggle with information buried in the middle of very long contexts (the "lost in the middle" problem), and costs scale linearly with input length.

## Practical implications

-   **RAG vs. long context** — for very large document sets, RAG is still more cost-effective than stuffing everything into the context. For single documents or small corpora, long context is simpler.
-   **Prompt caching** — services like Anthropic's prompt caching let you pay once for a long system prompt and reuse it across requests.
-   **Context engineering** — the art of deciding what goes into the context window and in what order. More important than context size.

## Why it matters

The context window is the fundamental constraint of every LLM application. It determines how much information the model can work with, what your architecture looks like, and how much each request costs.

## Related terms

- [Large Language Model](https://www.onsomble.ai/tools/ai-glossary/large-language-model)
- [Retrieval-Augmented Generation](https://www.onsomble.ai/tools/ai-glossary/retrieval-augmented-generation)
- [Token](https://www.onsomble.ai/tools/ai-glossary/token)

## Related Radar topics

## Related articles

### [RAG vs Long-Context LLMs: The Decision Framework That Actually Helps You Choose](https://www.onsomble.ai/blog/rag-vs-long-context-decision-framework)

Every RAG vs long-context article ends with "it depends." This one gives you the specific thresholds to make the decision yourself.

Rosh Jayawardena · Published 2026-02-05T12:00:00+00:00 · Updated 2026-08-02T12:12:41.52786+00:00 · 9 min

### [RAG vs. Long Context Windows: A Decision Framework for Research Workflows](https://www.onsomble.ai/blog/rag-vs-long-context-windows)

Long context windows are getting massive—but that doesn't mean RAG is dead. Here's when each approach actually works, with real numbers.

Rosh Jayawardena · Published 2025-12-28T12:00:00+00:00 · Updated 2026-08-02T12:12:41.52786+00:00 · 9 min
