A multi-agent pipeline has an orchestrator that manages 5 subagents. The orchestrator needs to pass a 10,000-token document to each subagent for independent analysis. Naively, this requires each subagent call to include the 10,000-token document in its messages array, totaling 50,000 input tokens across 5 calls. What architecture reduces this cost?
Select an answer to reveal the explanation.
Short Explanation
Here's the deal — put the 10,000-token document in a cached prefix with prompt caching, and the first subagent call writes it to cache while the other four calls read it from cache at the lower cache-read rate. You keep the full document available to every subagent without paying five full input-token charges.
Full Explanation
Prompt caching is the right architecture for this pattern. If the 10,000-token document is placed in a cached prefix with cache_control, the first subagent call writes it to cache, billed at a slightly higher cache-write rate, and subsequent subagent calls that share the same document prefix hit the cache, billed at the significantly lower cache-read rate, typically 10% of standard input token cost. The total cost becomes 1 cache-write plus 4 cache-reads rather than 5 full input-token charges. The LZ4 compression option is wrong because the Anthropic API does not accept LZ4-compressed content or perform transparent decompression; tokens are counted on the text/content as decoded, not on compressed size. The shared external store option is wrong because having each subagent fetch the document via a retrieval tool adds 5 tool-call round-trips and requires an external storage system; the document still must be embedded in tool_result blocks and processed as tokens, and the tool-call overhead negates the savings. The summarization option is wrong because summarizing the document to 2,000 tokens loses information that the subagents require for independent analysis; this is a trade-off that may not be acceptable and should be evaluated against the specific task requirements rather than used as a default optimization.