
Amazon Bedrock now lets builders cut RAG costs by filtering context through a cheaper model first.
In testing, the compression pattern reduced input tokens to the primary model to 12% of baseline and total cost to 67%, while preserving answer quality.
The smaller model extracts only relevant text spans, avoiding summarization that could lose precision.
What happened
Amazon Bedrock now supports query-aware compression, a pattern that filters retrieved context through a smaller, cheaper model before sending it to the primary model. The smaller model (Claude Haiku) extracts only the verbatim spans relevant to the user's query, then the primary model (Claude Sonnet) generates the answer from the compressed evidence.
Why it matters
RAG applications often send thousands of input tokens to expensive models on every query. The compression pattern reduces tokens sent to the primary model to 12% of baseline, cutting total cost to 67% while maintaining answer quality. Smaller retrieved contexts also reduce hallucination risk.
What to watch
The pattern works best when retrieved context is large, the price gap between small and primary models is wide (Haiku to Sonnet), and meaningful content can be trimmed without hurting answers. Results shown are from a benchmark of 500 questions across 9 enterprise source types; your own documents and queries will differ.
Ask the AI about this article →
RAG (Retrieval Augmented Generation) applications face a cost challenge at scale: retrievers typically return 5–20 chunks, often totaling several thousand input tokens per query, all of which flow to expensive foundation models. Amazon Bedrock's query-aware compression pattern intercepts this flow with an intermediate step: a smaller, lower-cost model filters the retrieved chunks against the user's original query, outputting only the verbatim spans relevant to the question. The economics work because the savings on reduced input tokens to the primary model far outweigh the cost of running the smaller compression model, especially when the price ratio between small and large models is steep (Claude Haiku to Claude Sonnet). The pattern also reduces hallucination surface area by removing irrelevant context, an important secondary benefit for enterprise applications. Amazon Bedrock's open, composable architecture supports this as a post-retrieval customization step that layers on top of existing capabilities like prompt caching and intelligent prompt routing. The benchmark results—12% of baseline tokens and 67% of baseline cost—come from a specific corpus and query distribution; results will vary with different documents, chunk sizes, and question types.
AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.
Free · takes 30 seconds · unsubscribe anytime
Ask AI anything about this article. Q&As are published on this page for other readers too.
Nvidia has taken a minority stake in Cloverleaf Infrastructure, a company that has helped develop more than se…

Michael Burry issued a Substack warning Friday that the AI data center boom mirrors 2008's structural excesses…

CoreWeave and Nebius, both neocloud providers offering computing capacity tailored for AI workloads, have rise…

Synopsys has beaten earnings expectations in two consecutive quarters—Q1 and Q2—and raised full-year 2026 guid…

A workplace researcher who has studied four-day workweeks for seven years argues that despite AI's productivit…

Ora, a platform that tests how well AI agents can navigate and transact on live websites, ran side-by-side ben…
