Papers
Topics
Authors
Recent
Search
2000 character limit reached

Agent Capsules: Quality-Gated Granularity Control for Multi-Agent LLM Pipelines

Published 1 May 2026 in cs.CL and cs.AI | (2605.00410v1)

Abstract: A multi-agent pipeline with N agents typically issues N LLM calls per run. Merging agents into fewer calls (compound execution) promises token savings, but naively merged calls silently degrade quality through tool loss and prompt compression. We present Agent Capsules, an adaptive execution runtime that treats multi-agent pipeline execution as an optimization problem with empirical quality constraints. The runtime instruments coordination overhead per group, scores composition opportunity, selects among three compound execution strategies, and gates every mode switch on rolling-mean output quality. A controlled negative result confirms that injecting more context into a merged call worsens compression rather than relieving it, so the framework's escalation ladder (standard, then two-phase, then sequential) recovers quality by moving toward per-agent dispatch rather than by rewriting merged prompts. On LLM-judged quality, the controller matches a hand-tuned oracle on every measured (model, group, mode) cell: routing compound whenever the oracle would, and reverting to fine whenever quality would fail the floor, without per-model configuration. Against a hand-crafted LangGraph implementation of a 14-agent competitive intelligence pipeline, Agent Capsules uses 51% fewer fine-mode input tokens and 42% fewer compound-mode input tokens, at +0.020 and +0.017 quality respectively. Against a DSPy implementation of a 5-agent due diligence pipeline, the framework uses 19% fewer tokens than uncompiled DSPy at quality parity, and 68% fewer tokens than MIPROv2 at +0.052 quality. Even before compound mode fires, the runtime delivers efficiency through automatic policy resolution, cache-aligned prompts, and topology-aware context injection, matching both hand-tuned and compile-time baselines without training data or per-pipeline engineering.

Authors (1)

Summary

  • The paper introduces Agent Capsules, which combine a behavioral composition score, rolling-mean quality gate, and escalation ladder to merge agents when safe and revert to sequential execution when quality falls.
  • The system matches an LLM-judge oracle across measured model, group, and mode cells, while code-review experiments raise quality from 0.313 to 0.724, reduce tokens by 10%, and cut latency by 15%.
  • Agent Capsules use automatic prompt and infrastructure optimizations to reduce input tokens by 51% versus LangGraph and 19% versus uncompiled DSPy in reported benchmarks, although results remain limited to four pipelines and selected models.

Problem and approach

Multi-agent LLM pipelines typically issue one LLM call per agent per run, paying repeated system-prompt ingestion, context setup, and per-request scheduling on every dispatch. Merging agents into fewer calls ("compound execution") reduces this overhead, but naive merging degrades output quality through tool loss and prompt compression, and existing orchestration frameworks (CrewAI, LangGraph, Google ADK) provide no mechanism for deciding when merging is safe. Agent Capsules (AC) addresses this by treating multi-agent execution as a group-level optimization problem with empirical quality constraints (2605.00410).

The runtime operates through three mechanisms. First, a composition score—a weighted linear combination of coordination-overhead ratio (weight 0.45), agent count (0.25), mean tool calls per agent (0.25), and dependency depth (−0.05)—predicts when merging is worth attempting from behavioral signals measured in fine-grained mode. Second, a quality gate shadow-evaluates compound output against the fine baseline using an LLM judge, blocks switches below a configurable floor, and reverts when rolling-mean quality degrades. Third, an escalation ladder upgrades execution strategy (standard → two-phase → sequential) when lower tiers fail the gate, recovering quality by un-merging rather than rewriting merged prompts.

The negative result motivating the ladder

A controlled experiment tests whether enriching the two-phase compound's Phase A pre-pass with structured reasoning could relieve compression in the merged Phase B call. On Sonnet, the reasoning pre-pass improved analysis quality (+0.084) but regressed research quality from 0.742 to 0.675 across the sweep. The paper concludes that injecting more context into a merged call gives the model more material to compress, not less reason to compress—merged calls are the fundamental compression bottleneck. This is why sequential execution (NN separate calls with accumulated context), despite saving only 0–8% tokens without guidance, is the structurally correct escalation target for reasoning-heavy groups.

Quality gate and oracle-equivalent routing

The controller's load-bearing claim is oracle-equivalent routing: on every measured (model, group, mode) cell, the adaptive controller routes compound exactly when an LLM-judge-defined oracle would—routing compound where quality clears the 0.75 floor and reverting to fine otherwise—with no per-model configuration. A second, structural measurement regime (schema compliance) agrees directionally: groups that pass under judge quality preserve structure under forced compound, while Haiku research drops 0.396 compliance points and GPT-4o research drops 0.417. The paper is careful to note that FINE mode scores 1.000 compliance by construction, so these deltas are upper bounds measuring structure loss, not quality loss.

The escalation ladder itself is validated on the code-review review group (Sonnet), where standard compound is structurally broken—the merged [AGENT:] framing suppresses tool use entirely (behavioral stability index = 0.0). Enabling escalation improves quality from 0.313 to 0.724 (+0.411, roughly 14× the Opus judge's minimum detectable difference of 0.030) while reducing tokens 10% and latency 15%. The improvement decomposes into tier rescue via two-phase tool restoration (~+0.18) and controller stabilization: with escalation enabled, the group commits to compound in 5/7 runs versus 1/7 without it. One caveat: recovered quality lands 0.026 below the 0.75 floor—one judge minimum-detectable-difference away, statistically indistinguishable from the floor.

Prompt-engineering tunables

Four tunables sit above the mode ladder, each adopted as a default only after passing a multi-pipeline gate:

  • Output guidance: forced-concise hints cut Sonnet/Haiku output tokens 74–86% at statistical-null quality deltas, but regress gemini-2.5-flash-lite by −0.160 (above its 0.065 noise floor). The automatic selector applies concise only when per-agent output exceeds 1,500 tokens, yielding 63–64% savings on Sonnet and Haiku while staying neutral on Gemini; no deployer is worse off under auto.
  • Context injection: predecessor-only injection shows above-floor gains on due diligence (+0.033) and long-chain Haiku (+0.089), with nulls elsewhere; token savings were only 2–3%, below the expected 5%, because tool output dominates accumulated context.
  • Structural hint: budgeted per-agent output budgets lift Haiku +0.209 and Gemini-flash +0.404 on standard compound, with Sonnet a statistical null.
  • Prefix cache alignment: hoisting shared prefixes into cache-annotated system blocks yields above-floor quality gains (+0.044, +0.061) in addition to Anthropic's 90% cached-token discount.

Competitive benchmarks

Against a hand-tuned LangGraph implementation of a 14-agent competitive intelligence pipeline (Haiku, 15 runs/cell, identical agent system prompts), AC uses 51% fewer fine-mode input tokens and 42% fewer compound-mode input tokens, at +0.020 and +0.017 quality respectively. Notably, the fine-mode rows already beat the baseline before any merging occurs, driven by five framework-mediated optimizations (cache alignment, auto output guidance, topology-aware context injection, per-group policy resolution, terminal-label stripping) that fire automatically from the pipeline declaration. The paper transparently reports that an earlier measurement showed AC at 1.31–1.69× LangGraph's input overhead; the gap closed through three audit-driven refinements rather than capability changes.

Against DSPy on a 5-agent due diligence pipeline (Sonnet, Opus judge), AC sequential compound uses 19% fewer total tokens than uncompiled DSPy at parity quality (+0.012, within the 0.030 noise floor) and 68% fewer than MIPROv2 at +0.052 quality. The MIPROv2 result carries an important caveat the authors state plainly: bootstrapped demonstrations inflated prompts ~2.9× (102K input tokens/task) while regressing quality −0.040 relative to uncompiled, partly attributable to training-distribution drift with disjoint target companies; the comparison bounds the compile-time axis as typically deployed, not DSPy itself.

Infrastructure findings

Latency benefits are model-tier dependent: Sonnet's large per-call fixed cost (mean 96,131 ms wall-clock) amortizes well under compound (up to 67.2% reduction on analysis groups), whereas GPT-4o-mini's ~4,875 ms mean makes latency gains negligible. Single-agent synthesis groups show negative latency reduction under compound (−187.5% on Sonnet), motivating a single-agent guard that disables compounding below two agents. Gate-adjusted versus achievable savings are distinguished explicitly: Haiku's achievable 53–75% savings realize as zero because the quality gate blocks all compound modes for it.

Limitations

The paper concedes several scope restrictions. Validation covers four pipelines (1–4 agents per group) across two domains; generalization to creative-writing or customer-service domains, 20+ agent pipelines, or larger per-group counts is unmeasured, and the composition score's agent-count normalization is a design heuristic. Explicit-reasoning models (o1, o3-mini, DeepSeek-R1) are unevaluated—billed chain-of-thought may inflate the overhead ratio and trigger composition at wrong thresholds. Judge dependence bounds all claims to within-provider comparisons given the 0.17-point cross-judge calibration gap. Each competitive benchmark is a single pipeline on a single model, so cross-benchmark dominance transfer is directional, not established. The auto-guidance threshold is calibrated on information-retrieval pipelines and mid-tier models.

Conclusion

Agent Capsules demonstrates that multi-agent execution granularity can be controlled automatically and safely: a behavioral composition score decides when to attempt merging, a rolling-mean quality gate makes batching trustworthy without per-model configuration, and a three-tier escalation ladder converts the cost-quality tradeoff from binary to continuous. The central finding is not that batching saves tokens—that is arithmetic—but that gating plus escalation recovers quality by un-merging toward per-agent dispatch, matching a hand-tuned orchestration baseline and both compiled and uncompiled prompt-compilation baselines on tokens and quality without training data or per-pipeline engineering.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 1 tweet with 0 likes about this paper.