Context management
Context management is the deliberate control of information or resources available and maintained within an execution or interaction.
Context Engineering
Context management is the shaping of context through selecting, writing, compressing, and isolating information before model consumption.
- How it is used
- Shapes the working context for individual LLM calls within a broader context engineering pipeline.
- How deep it goes
- Defines four complementary operations and their resource constraints, then illustrates implementations in coding agents.
- Examples
- Illustrates context editing and memory in Claude, project instructions and compaction in OpenCode, and repository maps in Aider.
- What you can do after
- Operate and configure OpenCode context inputs using instruction sources and targeted file inclusion.
Coding with AI
Context management is the deliberate organization of codebase information and prompts so an AI system receives relevant context for producing useful outputs.
- How it is used
- Improves AI-assisted coding by supplying focused project information for generation, debugging, and multi-file workflows.
- How deep it goes
- Explains context sources, selection rationale, and prompt specificity, then demonstrates them through a SQLite implementation.
- Examples
- Uses Cursor context sources and a Blackbox AI Python example that connects to data/questions.db.
- What you can do after
- Apply it via Cursor or Blackbox AI to formulate focused prompts and integrate generated code after review.
Effective Conversational AI
The ongoing process of tracking, retaining, updating, and applying conversational context as an interaction progresses.
- How it is used
- Keeps virtual-assistant responses coherent, relevant, and personalized as conversations and user needs change.
- How deep it goes
- Explains state updates, contextual cues, changing preferences, feedback loops, and RAG integration without implementation-level detail.
- Examples
- Uses a travel recommendation exchange in which a preference shifts from budget options to luxury accommodations.
- What you can do after
- Apply dynamic context management to adapt assistant responses, recommendations, and retrieved information as interactions evolve.
Read how Effective Conversational AI explains context management →
Also covered in
- Designing AI SystemsIn early access (MEAP)
- Vibe EngineeringIn early access (MEAP)
- Build an AI Agent (From Scratch)
- Build a Multi-Agent System (from Scratch)In early access (MEAP)
- AI Agents in Action, Second Edition
- Python How-To
What to know first
- conversational aiConversational AI is artificial intelligence that enables software systems to interpret user input and interact with users through natural-language dialogue.
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- workflowA workflow is an organized sequence of coordinated activities or tasks through which work progresses toward a defined outcome.
- dependency graphA dependency graph is a graph whose nodes represent entities and whose edges represent dependency relationships among them.
Related concepts
- memory management modelhas part · Memory management is the set of processes and policies by which a system allocates, organizes, retains, updates, and releases memory resources or stored information.
- contextuses · Context is the relevant information, state, or circumstances surrounding an input, decision, or activity that influence its interpretation or behavior.
- AI frameworkused by · An AI framework is a software framework that provides reusable abstractions and components for developing artificial intelligence models or applications.
- subagentused by · A subagent is an agent assigned by another agent to perform a delegated part of a larger task under its coordination or authority.
- compactionhas part · The consolidation or reorganization of data, objects, or context to reduce size or fragmentation while preserving necessary information or state.
Questions about context management
What is context management?
Context management is the deliberate control of information or resources available and maintained within an execution or interaction.
Which Manning books explain context management?
Context Engineering, Coding with AI and Effective Conversational AI.
What should I know before learning context management?
Manning books that teach context management usually introduce conversational ai, language model, workflow and dependency graph first.
What is context management part of?
Context management is part of context engineering stack. A context engineering stack is a conceptual organization of the core and harness components involved in building context-aware AI systems.
What are the parts of context management?
Context management includes memory management model and compaction.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


