chapter seven

7 Context management and orchestration

 

This chapter covers

  • Core techniques for context management: selection, writing, compression, and isolation.
  • Orchestration as the layer that coordinates context across steps, tools, agents, and interfaces.
  • Common patterns for multi-agent collaboration.
  • Protocols for agentic interoperability.

Previous chapters described six fundamental context sources that shape LLM behavior: instructions, external knowledge, tools, memory, state, and user prompts. These components provide the raw material for LLM-based systems, but their effectiveness depends on how they are managed during execution. This chapter develops context management, the discipline of selecting, writing, compressing, and isolating context. Context management treats the context window as a scarce execution surface: tokens consume money, long prompts add latency, and excessive material competes for the model’s attention. The chapter then turns to context orchestration, the runtime layer that uses context to coordinate agentic execution and interoperability. The chapter closes by examining multi-agent coordination patterns and protocols for exchanging 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