# Context Window

> Part of the AI Garage Jargons glossary: https://aigarage.in/jargons (all terms: https://aigarage.in/jargons.md)

**Category:** Prompting
**Tags:** tokens, prompting, beginner

The model-specific token budget available for the information a model can use during one request, including the input and generated output and, for some models, reasoning tokens.

**In plain terms:** How much the AI can keep in mind at one time.

**Use cases:**
- Long document summarization
- Conversation memory
- Complex planning prompts

**Why it matters:** Instructions, conversation history, tool results, retrieved evidence, and the model's output share finite space. Exceeding that space can fail or truncate a request, while filling it with irrelevant material can make useful context harder to use.

**Why now:** Long-context models can process much larger working sets, but agent loops, tool output, and multimodal inputs can consume that capacity quickly. Context management is therefore part of application design, not only prompt writing.

**AI Garage example:** In an AI Garage example, Forgy, a workbook-building agent, could preserve the build brief and current constraints, retrieve only the source-session passages needed for the next workbook section, and compact older working notes instead of repeatedly sending the entire raw session.

**Mental model:** A context window is a fixed workbench for one model call. Instructions, conversation history, retrieved evidence, tool results, and the answer all compete for room, so builders must choose what deserves to stay on the bench.

**Builder scenario: Keep a coding-session workbook inside a useful context**

- **Context:** An AI assistant using MCP tools is turning a long landing-page coding session into a reproducible build workbook. The session contains the original brief, decisions, failed attempts, screenshots, and repeated tool output.
- **Failure:** Sending the entire raw session for every workbook section consumes the shared token budget, leaves less room for the answer, and makes the current constraints harder to find among stale details.
- **Intervention:** Keep the build brief and active constraints pinned, retrieve only the coding-session passages needed for the current section, reserve output space, and compact older working notes into a checked summary.
- **Outcome:** Each workbook section is generated from the relevant evidence and current constraints while the request remains within the selected model's token budget.

**Common misconceptions:**
- **Claim:** The context window is the model's permanent memory.
  **Correction:** It is the working information available to one request. Long-term memory requires an external store plus a method for selecting what returns to context.
- **Claim:** A larger context window means every included detail will be used equally well.
  **Correction:** Capacity is not guaranteed recall or reasoning quality. Relevant, well-structured context can work better than filling the window with everything available.

**Visual model (sequence):** Context engineering is the repeated choice of what stays, what is retrieved, what is compacted, and how much room remains for the answer.

**Visual description:** A fixed context budget is divided between pinned instructions, relevant retrieved evidence, compacted prior work, and reserved output space for the next workbook section.

**Related concepts:** [Token](https://aigarage.in/jargons/token), [Prompt Engineering](https://aigarage.in/jargons/prompt-engineering), [RAG (Retrieval-Augmented Generation)](https://aigarage.in/jargons/rag), [Agent Memory](https://aigarage.in/jargons/agent-memory)

**Video explainer:** [Context Window: choose what belongs in this call](https://nqqbubjesbyuwrdhqxnk.supabase.co/storage/v1/object/public/aigarage-public-media/jargons/context-window/v2/context-window.mp4) (48 seconds)

See how an AI assistant curates a long coding session into one useful model call by pinning requirements, retrieving current evidence, compacting older work, and reserving room for the answer.

**Published:** 2026-10-12T11:59:39+05:30
**Captions:** [English](https://aigarage.in/jargons/context-window/captions.vtt)
**Narration:** generated

**Transcript:** A coding assistant is turning a long session into a workbook.

The session holds the brief, decisions, failed tries, screenshots and tool output.

A context window is the limit on what the model can read in one call.

Instructions, history, evidence, tool results and the answer all share it.

If everything is sent, old noise crowds out what matters now.

So the assistant pins the brief and the active rules.

It fetches only the passages this step needs.

It squeezes old work into a short checked summary, and saves space for the output.

A bigger window holds more, but it is not memory.

Ask what the model needs for this step, not how much fits.

**Last researched:** 2026-10-11

**Sources:**
- [OpenAI API - Conversation state and context windows](https://developers.openai.com/api/docs/guides/conversation-state)
- [OpenAI API - Key concepts](https://developers.openai.com/api/docs/concepts)
- [Anthropic - Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents)

**URL:** https://aigarage.in/jargons/context-window
