AIToday
Open-Source AIAI Business & IndustryAmazon AI BlogPublished: Jul 28, 2026, 04:00 JST

AWS shows task-aware compression cuts AI query costs by up to 98%, beating RAG

Send on LINE
AWS shows task-aware compression cuts AI query costs by up to 98%, beating RAG

3 Key Points

  1. What happened

    AWS published an open-source implementation of task-aware knowledge compression (TAKC), a technique that pre-compresses document collections into task-specific representations at four tiers (8x, 16x, 32x, 64x compression) and deploys them on AWS serverless infrastructure. The system compresses documents once per task during ingestion, then routes incoming queries to the appropriate tier based on complexity, reducing daily input token usage from 100,000,000 tokens (full context) to as low as 1,563,000 tokens (TAKC Ultra at 64x compression).

  2. Why it matters

    RAG (retrieval-augmented generation)—the standard approach for AI on large document sets—surfaces only similar fragments and misses cross-document connections. TAKC solves this by compressing entire knowledge bases through the lens of a specific task (e.g., financial analysis vs. legal risk review), keeping what matters for that task and discarding the rest. For enterprises processing complex analytical queries across hundreds of documents (such as due diligence on a $500 million acquisition spanning 12 subsidiaries, 200+ supplier contracts, and 50+ legal cases), TAKC enables answers RAG cannot find while cutting inference costs by up to 98.4% on routine queries.

  1. What to watch

    The implementation uses AWS Lambda, Amazon ElastiCache Serverless, Amazon Bedrock, and Amazon Cognito; it is deployable via a single AWS Cloud Development Kit command. Compression happens offline once; query time is a cache lookup plus inference on compressed context. TAKC requires upfront ingestion cost that amortizes only for knowledge bases that change daily or less and get queried repeatedly—hourly-changing datasets may still favor RAG's per-query retrieval model.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

By signing up you agree to the Terms of Service and Privacy Policy.

Context & Analysis

Task-aware knowledge compression addresses a real ceiling in RAG for enterprise analytical work. When an analyst at a private equity firm evaluates a $500 million acquisition and must synthesize financial risks, supplier terms, and pending litigation across 12 subsidiaries, 200+ contracts, and 50+ legal cases, RAG's lexical similarity search fails because the relevant connections share no vocabulary overlap. TAKC solves this by compressing the entire corpus through the lens of the task—financial analysis, legal risk review, compliance audit—and preserving task-relevant relationships that RAG would discard.

The four-tier compression strategy (8x to 64x) reflects a practical insight: most enterprise queries are simple lookups ("What was Q3 revenue?") that need minimal context, while complex analytical questions need richer detail. A query complexity analyzer routes straightforward questions to ultra-compressed (64x) tiers at minimal cost, reserving the lightly compressed (8x) cache for cross-document synthesis. This tier-based routing complements existing RAG optimizations like metadata filtering and query reformatting.

Cost amortization is the key constraint. TAKC requires one-time Bedrock compression calls during ingestion—a significant upfront cost—which pays off only for knowledge bases queried repeatedly with infrequent changes. Knowledge bases that change hourly remain better served by RAG's per-query retrieval model, where the compression cost per document is paid once and cached, then re-executed only when content changes.

FAQ
How does TAKC differ from RAG?
RAG uses similarity search to surface relevant document fragments, which misses cross-document connections. TAKC pre-compresses entire knowledge bases through the lens of a specific task (e.g., financial analysis), keeping task-relevant information and discarding the rest, so it preserves connections between documents and can answer complex analytical questions RAG cannot.
How much does TAKC reduce token usage compared to full context?
For a 100,000-token knowledge base queried 1,000 times per day, TAKC Ultra (64x compression) uses approximately 1,563,000 daily input tokens compared to 100,000,000 for full context—a reduction to 1.6% of the original cost. TAKC Light (8x) costs 12.5%, TAKC Medium (16x) costs 6.25%, and TAKC High (32x) costs 3.1%.
When should I use TAKC instead of RAG?
TAKC suits cross-document reasoning and synthesis on knowledge bases that change daily or less and have well-defined task types. RAG is better for narrow factual lookups, unpredictable query patterns, or knowledge bases that change hourly or more frequently.
What is the deployment environment?
The implementation runs on AWS as two serverless pipelines using AWS Lambda, Amazon ElastiCache Serverless, Amazon Bedrock, Amazon S3, Amazon API Gateway, Amazon Cognito, and AWS WAF. It is defined as a single AWS Cloud Development Kit stack and deploys with a single command.
Amazon AI BlogRead Original Article
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleNvidia's $5B stake in Nebius sparks 19% stock jump