AWS blog hero for four layers of context engineering in Deep Insight
Deep Insight applies isolate, prompt, externalize, and verify layers with measured token cuts., Amazon Web Services

要点

  • AWS AI Blog (4 Nov 2026 PT): “Four layers of context engineering for production AI agents: How Deep Insight applies them in working code”; Part 2 of a Deep Insight series on Strands Agents SDK and Amazon Bedrock AgentCore.
  • Four layers: isolate context by multi-agent architecture; control inflow with prompts; externalize heavy content to files/tools; verify with independent agents and safeguards.
  • Measured cuts in the reference implementation: write-and-execute tool returns a short summary instead of full script text (~95% fewer tokens per script); Skills load a ~500-token catalog and pull ~3K guides on demand instead of >20K of always-on skill text (~97% shrink of that prompt bulk).
  • Shared state keeps only compressed clues, a plan checklist, brief history, and the prior agent’s final message; Coder context stays under about 25K tokens in the described hierarchy.

Lede

On 4 November 2026, Amazon Web Services published Part 2 of its Deep Insight series: a walkthrough of four context-engineering layers in working code for production AI agents. A 200K-token window looks large until a single “analyze sales and write a DOCX” job burns past 150K tokens across stages. The post’s usable claim is operational. Production agent failures are mostly context-window management failures, so a four-layer stack that isolates, prompts, externalizes, and verifies context, with measured token cuts, beats buying a bigger window. If larger windows alone, with the same agent design frozen, match the reported ~95% and ~97% cuts and keep long jobs from overflowing mid-run, that claim fails.

[1]

What shipped

Deep Insight is an open-source multi-agent data analysis solution on the Strands Agents SDK and Amazon Bedrock AgentCore. The post organizes Anthropic’s published guidance plus Strands features into four layers.

Layer 1 isolates context. Coordinator, Planner, Plan Reviewer, Supervisor, and tool agents (Coder, Validator, Reporter, Tracker, Auditor) each keep their own window. Agents pass compressed “clues” and a short completion notice rather than full transcripts. Shared state holds four items: the previous agent’s final message, compressed clues, a Planner/Tracker checklist, and a brief name-and-message history. AWS says even the heavy Coder stays under about 25K tokens total under that hierarchy.

Layer 2 controls inflow with prompts. Each agent gets an explicit output token budget (Coder about 1,000–1,500 tokens because code lives in files). Prompts require self-contained scripts so prior variables need not stay in context. The Supervisor must mark checklist items done before moving on.

Layer 3 externalizes heavy content. A single write-and-execute tool writes the script to disk, runs it, and returns a short summary (lines written, success, truncated stdout) so roughly 100 lines of code never enter the message stream; AWS estimates about 95% fewer tokens per script versus returning the full text. Common helpers become an importable module. Results accumulate in files such as all_results.txt and calculation_metadata.json that later agents read when needed. Skills keep a ~500-token catalog in the system prompt and load a ~3K guide only when called, instead of stuffing more than 20K tokens of skill text into every turn; AWS puts that prompt-bulk shrink at about 97%.

Layer 4 adds verification agents and safeguards: Validator and Auditor check calculations and citations from files, independent of the Coder’s own window, so overflow and silent numeric errors have a second line of defense.

[1]

Evidence and limits

The hard numbers are from the Deep Insight reference implementation and from cited Anthropic notes (context rot as windows grow; server-side filtering claims such as 150K→2K tokens in a separate MCP code-execution note). They are reproducible in principle because the code is open, yet they are still vendor-hosted worked examples, not a multi-site randomized study. The 95% and 97% figures are “about” estimates on the illustrated scripts and skill set. Isolation under 25K for the Coder is an AWS statement about this hierarchy, not a guarantee for every workload. Layer 2 budgets can be ignored by a noncompliant model. File-based externalization shifts risk to disk integrity, path confusion, and prompt-injection via retrieved files.

Steelman. Bigger context windows and better long-context models will reduce some overflow. Packaging known techniques into four layers with open code may add little beyond Anthropic’s own posts. Token savings that look large on verbose analysis agents may shrink on short chat agents. Verification agents cost extra calls and can disagree.

Those caveats are real. They do not erase the methodological spine: treat context as a scarce resource with architecture, prompts, tools, and checks, then publish before/after token counts on a fixed task. That spine attacks the common habit of waiting for a larger window while the agent still dumps full scripts and skill manuals into every turn.

[1]

Who pays, and what to watch

Teams shipping multi-step analysis or report agents should instrument tokens per stage before approving a model upgrade. Platform groups should prefer write-and-execute and on-demand Skills over always-on system prompts. Buyers should ask for token-per-task tables with and without externalization, not only “supports 200K context.”

Watch next: third-party replications of the 95%/97% cuts on public tasks; whether Part 3’s harness/VPC guidance changes the cost curve; and whether file-as-bus patterns become standard beside orchestrator-worker blogs.

[1]

Close

AWS’s usable sentence is not that Deep Insight invents context engineering. It is that agent reliability compounds when teams measure and cut context at four layers, and treat a larger window as the last lever, not the first. Six months on, either more teams will publish token-per-stage tables with open harnesses, or the industry will keep buying longer contexts to paper over the same overflow mid-job.

[1]