chapter seven

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.

7.1 Context management

7.2 Context selection

7.2.1 Principles

7.2.2 Techniques

7.3 Context writing

7.3.1 Principles

7.3.2 Techniques

7.4 Context compression

7.4.1 Principles

7.4.2 Techniques

7.5 Context isolation

7.5.1 Principles

7.5.2 Techniques

7.6 Context orchestration

7.6.1 Orchestration models

7.6.2 Coordination and interoperability

7.7 Patterns for multi-agent coordination

7.7.1 Sequential

7.7.2 Parallel

7.7.3 Loop

7.7.4 Router

7.7.5 Network

7.7.6 Hierarchical

7.8 Interoperability protocols