7 Context management and orchestration
This chapter covers
- Context management techniques: selection, writing, compression, and isolation
- Context orchestration models and mechanisms
- Coordination patterns for multi-agent systems
- Interoperability protocols for agentic systems
Previous chapters described the six context sources that LLM-based systems supply to the model: instructions, external knowledge, tools, memory, state, and user prompt. Those sources provide the raw material for every context window, and their effectiveness depends on how that material is handled during execution. This chapter develops the two remaining functional layers of the context engineering stack presented in Chapter 1. The first is context management, which assembles and maintains the window for a single model call through selection, writing, compression, and isolation, and treats the context window as a scarce execution surface. The second is context orchestration, which routes context across the steps, agents, tools, and user interfaces of a multi-step execution. The closing sections cover multi-agent coordination patterns and the protocols used to exchange context across agents, user interfaces, editors, and external components.