Production-grade Context Engineering for Multi-Agent AI (Google ADK)

Google ADK outlines production context engineering. - Identifies core context pressures: cost/latency, signal decay, physical limits. - Reframes context as Source → Compiler → View pipeline. - Proposes four tiers: Working Context, Session, Memory, Artifacts. - Recommends ordered processor chains for observable context construction. - Advocates on-demand artifact loading and ephemeral use to avoid polluting context. - Uses compression and filtering to manage session history. - Applies strict scope control and narrative casting in multi-agent handoffs.
Key insights
Context as a compiled view replaces long token buffers
Google ADK reframes 'context' as a compiled, layered view rather than a raw appended token buffer. It defines three conceptual components: Source (complete session logs, long-term memory, files), Compiler (processors that filter, sort, compress), and View (the optimized prompt sent to the LLM). The ADK blog identifies three core context pressures—cost/latency, signal decay, and physical window limits—and argues that treating context as a lifecycle managed by compilers and views addresses these pressures.
Tiered model separates storage from presentation
ADK proposes a four-tier context structure: Working Context (temporary per-call prompt), Session (structured persistent interaction logs), Memory (cross-session long-term knowledge), and Artifacts (large data objects referenced by name/version). The architecture mandates on-demand artifact loading, background compression of old logs, and rule-based filtering to prevent token bloat. The pipeline uses ordered processor chains to make context construction observable, testable, and composable.
Multi-agent scope control and narrative casting reduce hallucinations
For multi-agent systems ADK enforces strict scope controls: agents hand off only necessary instructions and minimal context; artifacts are referenced by name until explicitly loaded; when switching agents the system converts prior assistant messages into narrative background (e.g., '[background]: Agent A said...') to avoid new agents misattributing prior actions. These measures aim to limit context explosion and reduce agent confusion.