# Context Management

- **Canonical URL:** https://getaimath.com/dictionary/context-management/
- **Topics:** [Context, Memory & Retrieval](https://getaimath.com/dictionary/category/context-memory-and-retrieval/)
- **Last updated:** 2026-11-25

## What is Context Management?

**In one sentence:** Context management is deciding what information goes into a model's limited context window, and what stays out.

Apps must choose which messages, documents and instructions to include. Good context management keeps the important bits, removes clutter, and sometimes summarizes old parts.

![Context Window vs. Memory: Your Desk vs. The Filing Cabinet — Simple cartoon comparing the AI Context Window (a small desk that can only fit a few pages right now) with External Memory & Search (a big filing cabinet where a librarian grabs just the 3 pages you need).](https://getaimath.com/diagrams/context-memory-and-retrieval.png)
*Napkin Diagram (Context, Memory & Retrieval): The context window is the small desk the AI can see right now; search grabs the right pages from the filing cabinet.*

## What is an example of Context Management?

A coding assistant might include only the files related to your question instead of your entire project.

## Why does Context Management matter?

Smart context management gives better answers at lower cost.

## Related Concepts

- [Context Overflow](https://getaimath.com/dictionary/context-overflow/): Context overflow is what happens when there is more text than fits in a model's context window.
- [Context Engineering](https://getaimath.com/dictionary/context-engineering/): Context engineering is the practice of carefully designing everything a model sees, like instructions, examples, retrieved documents, tools and memory, to get the best results.
- [Context Length](https://getaimath.com/dictionary/context-length/): Context length is the number of tokens a model can handle at once, or how many tokens are currently being used.
- [Context Compression](https://getaimath.com/dictionary/context-compression/): Context compression shrinks the information in a model's context so more fits or it costs less.
- [Context Window](https://getaimath.com/dictionary/context-window/): The context window is the maximum amount of text, measured in tokens, that a model can look at in one go.
- [Context Rot](https://getaimath.com/dictionary/context-rot/): Context rot is when a model gets worse at using information as its context gets longer and more cluttered.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/context-management/)
