Skip to content

AWS Shows How to Cut RAG Token Costs on Bedrock by Trimming Irrelevant Context

Short answer

AWS published a method for Amazon Bedrock that compresses retrieved documents down to only the passages relevant to a user's query before passing them to an LLM, cutting the token volume sent per request. For companies running RAG-based support bots or internal search, this can meaningfully lower per-query cost and response latency without changing answer quality.

What this means for operators

If your support bot, sales assistant, or internal knowledge search runs on a retrieval-augmented pipeline through Bedrock (or a similar architecture), the token bill scales with how much irrelevant context gets stuffed into every prompt — long documents, boilerplate, and near-duplicate passages you retrieve 'just in case.' Query-aware compression addresses that by filtering retrieved chunks against the actual question before they reach the model, which is the same lever that determines whether a 20-person support team's AI assistant costs $200 or $2,000 a month at scale. Teams already running RAG in production should treat this as a concrete cost-reduction checklist item, not a future upgrade — it requires no model swap, only a compression step inserted into the existing retrieval-to-generation pipeline.

AWS Machine Learning Blog detailed a technique for reducing the cost of retrieval-augmented generation (RAG) systems built on Amazon Bedrock. The approach, called query-aware compression, filters retrieved passages against the specific user query before they are sent to the underlying language model, rather than forwarding entire retrieved documents or chunks as-is.

Most RAG systems retrieve a fixed number of document chunks per query and pass all of them into the model's context window, regardless of how much of that text is actually relevant to the question. That inflates the token count per request — and since Bedrock and most hosted LLMs charge per token, it directly inflates the bill. AWS's method scores and trims retrieved content down to the parts that matter for a given query, reducing the tokens sent to the model without requiring a different retrieval index or a different underlying model.

This matters operationally because RAG has become the default architecture for AI-powered support bots, internal knowledge search, and sales enablement assistants at small and mid-sized companies — systems that answer questions by pulling from a company's documents, tickets, or product manuals rather than relying purely on a model's training data. As usage scales from a pilot to full deployment, token costs from oversized context windows are often the single largest line item, exceeding the cost of the model calls themselves.

For a 10-200 person B2B company already running or piloting a RAG-based support or search tool on Bedrock, this technique is directly applicable: it's a pipeline modification, not a re-architecture, and AWS's post includes the mechanics needed to implement it. Companies evaluating vendors for AI support automation should also ask whether the vendor's retrieval pipeline already applies compression or similar filtering — the difference shows up in the monthly invoice, not in the demo.

No pricing figures, latency benchmarks, or adoption numbers were included in AWS's post beyond the architectural description; teams should treat the magnitude of savings as workload-dependent and unconfirmed until tested against their own retrieval corpus.

Source: AWS Machine Learning Blog

Next step

Visibility Analyzer

This is what the Visibility Analyzer measures on a real site: which answers cite you, which pages an engine cannot retrieve, and what to fix first. Free to run.

Run a free visibility audit

Free to run. No card.

Fee
Free
Length
One run, minutes

Free tier: two analyses a day, no card required.