How does Progressive Disclosure reduce AI costs by 80-90%?
Introduction: The Hidden Cost of AI
Every AI query has a hidden cost: the amount of context (tokens) you send to the language model.
The brutal reality (typical published per-token pricing):
- Premium frontier models: ~$30 per 1M input tokens
- Mid-tier models: ~$3 per 1M input tokens
- Lightweight models: ~$1 per 1M input tokens
For enterprise AI with access to company databases, this adds up fast.
Key Takeaways
- Progressive Disclosure reduces AI costs by 80-90% through intelligent context filtering
- Traditional AI sends entire company context (millions of tokens). PROCUX sends only relevant data (thousands of tokens)
- Agent-specific templates ensure CFO queries get financial data, CMO queries get marketing data
- Relevance scoring algorithm ranks context components (0-1 scale) and filters low-relevance items
- Worked example: a Q3 revenue query reduced from 150K tokens ($4.50/query) to 12K tokens ($0.36/query)—92% savings
- 7 context source types with confidence weighting: Company DNA (95%), Database (98%), Web Search (60%), etc.
The Context Explosion Problem
What is Context?
Context is all the information you provide to an AI model to answer a query.
For enterprise AI, this includes:
- Company financial data
- Customer records
- Employee information
- Historical decisions
- Market intelligence
- Product catalogs
- Support tickets
- Compliance documents
The problem: Most of this is irrelevant for any specific query.
Real-World Cost Example
Scenario: E-commerce company with:
- 50K customers
- 10K products
- 100K support tickets
- 500 employees
- 1,000 financial documents
Query: "What was our Q3 revenue growth?"
Traditional AI Approach:
# ❌ BAD: Send EVERYTHING to the LLM
context = {
"all_customers": load_all_customers(), # 50K records
"all_products": load_all_products(), # 10K records
"all_tickets": load_all_support_tickets(), # 100K records
"all_employees": load_all_employees(), # 500 records
"all_financial_docs": load_all_financials() # 1,000 docs
}
response = llm.query(
prompt="What was our Q3 revenue growth?",
context=context # ~2.5 million tokens
)
# Cost: 2.5M tokens × $30/1M (premium-model pricing) = $75 per query
PROCUX Progressive Disclosure Approach:
# ✅ GOOD: Filter to only relevant context
context = progressive_disclosure.build_context(
query="What was our Q3 revenue growth?",
agent_type="CFO",
intent="analytical",
domain="financial"
)
# Context returned:
# - Q3 financial reports (relevant)
# - CFO past decisions on revenue (relevant)
# - Revenue trend data (relevant)
# EXCLUDES: customer records, support tickets, product catalog, employee data
response = llm.query(
prompt="What was our Q3 revenue growth?",
context=context # ~25,000 tokens (filtered)
)
# Cost: 25K tokens × $30/1M (premium-model pricing) = $0.75 per query
# Savings: 99% reduction ($75 → $0.75)
Context Explosion: Token Count Comparison
Source: Illustrative calculation at premium-model list pricing ($30 per 1M input tokens)
How Progressive Disclosure Works: Technical Architecture
PROCUX's Progressive Disclosure system uses a 6-step context enrichment pipeline that builds intelligent, agent-specific context.
Architecture Overview
User Query: "What was our Q3 revenue growth?"
↓
┌─────────────────────────────────────────┐
│ Step 1: Intent & Domain Classification │
│ - Intent: analytical │
│ - Domain: financial │
│ - Agent: CFO │
│ → Confidence: 0.95 │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Step 2: Base Context Analysis │
│ - Extract key entities: [revenue, Q3] │
│ - Detect time references: [Q3] │
│ - Identify stakeholders: [investors] │
│ → Query complexity: simple │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Step 3: Agent-Specific Template │
│ CFO Template: │
│ - Focus: financial, forecasting, ROI │
│ - Metrics: profitability, cash_flow │
│ - Time horizon: quarterly, annual │
│ → Only financial context needed │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Step 4: Context Source Gathering │
│ Sources prioritized for CFO + financial:│
│ ✅ Financial systems (high relevance) │
│ ✅ Historical financial data (high) │
│ ✅ Board expectations (medium) │
│ ❌ HR systems (low - excluded) │
│ ❌ Marketing data (low - excluded) │
│ ❌ Support tickets (low - excluded) │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Step 5: Relevance Scoring │
│ Score each context component (0-1): │
│ - Q3 financial reports: 0.95 │
│ - Revenue trend analysis: 0.90 │
│ - CFO past decisions: 0.75 │
│ - Customer satisfaction: 0.20 (drop) │
│ - Employee headcount: 0.15 (drop) │
│ Threshold: >0.5 = include │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Step 6: Enriched Context Output │
│ Final context (25K tokens): │
│ - Q3 2024 Financial Summary │
│ - Revenue YoY Comparison │
│ - CFO Q2 Revenue Strategy │
│ - Board Growth Targets │
│ → 99% reduction vs sending all data │
└─────────────────────────────────────────┘
↓
Send to LLM → Response Generated
Technical Implementation
Step 1: EnrichedContext Data Structure
Code:
@dataclass
class EnrichedContext:
"""Enriched context with only relevant data"""
original_query: str # Original user query
agent_type: str # Which C-level exec (CEO, CFO, CMO, etc.)
intent: str # analytical, strategic, tactical, operational
domain: str # financial, marketing, technology, HR
context_data: Dict[str, Any] # FILTERED context (only relevant)
relevance_scores: Dict[str, float] # Relevance score per component
timestamp: datetime # When context was built
confidence_score: float # How confident in classification
processing_priority: int # Query priority (1-5)
Step 2: 7 Context Source Types
Code:
context_sources = {
# 1. Enterprise Data (Company Systems)
"enterprise_data": {
"erp_systems": ["sap", "oracle", "netsuite"], # Financial core
"crm_systems": ["salesforce", "hubspot"], # Customer data
"bi_tools": ["tableau", "powerbi", "looker"], # Analytics
"financial_systems": ["quickbooks", "xero"], # Accounting
"hr_systems": ["workday", "bamboohr", "adp"] # HR records
},
# 2. Market Intelligence (External Data)
"market_data": {
"competitors": ["competitor_analysis", "market_share"],
"industry_trends": ["industry_outlook", "technology_adoption"],
"customer_insights": ["satisfaction", "nps_scores", "churn"],
"economic_indicators": ["gdp_growth", "inflation", "interest_rates"]
},
# 3. Historical Context (Past Decisions)
"historical_data": {
"past_decisions": ["previous_strategies", "decision_outcomes"],
"performance_metrics": ["historical_kpi", "trend_analysis"],
"organizational_memory": ["knowledge_base", "best_practices"]
},
# 4. Stakeholder Context (People Data)
"stakeholder_context": {
"board_preferences": ["board_priorities", "investor_expectations"],
"employee_sentiment": ["engagement_scores", "satisfaction"],
"customer_feedback": ["support_tickets", "complaint_trends"]
}
}
Source Confidence Weights:
- Company DNA: 95% confidence (highest trust)
- Database queries: 98% confidence (direct data)
- Executive analysis: 80% confidence (AI reasoning)
- Web search: 60% confidence (external data)
- Inference: 50% confidence (AI guesses—needs verification)
Step 3: Agent-Specific Templates
Each C-level executive has a specialized context template that filters what data they need.
Example: CFO Template:
agent_context_templates = {
"CFO": {
"focus_areas": [
"financial",
"budgeting",
"forecasting",
"risk_management"
],
"metrics": [
"profitability",
"cash_flow",
"roi",
"cost_optimization"
],
"time_horizons": [
"quarterly",
"monthly",
"annual",
"multi_year"
],
"decision_types": [
"financial",
"investment",
"cost_control",
"resource_allocation"
]
}
}
Why This Matters:
- CFO query about revenue → Gets financial systems, budget data, cash flow reports
- CFO query about revenue → SKIPS HR records, marketing campaigns, support tickets
- CMO query about campaigns → Gets marketing data, customer insights, conversion rates
- CMO query about campaigns → SKIPS financial ledgers, payroll data, IT infrastructure
Result: Each query only gets relevant context (10-20% of total data).
Step 4: Relevance Scoring Algorithm
Every context component gets a relevance score (0-1) based on:
- Does it match agent's focus areas?
- Does it match query intent (strategic, analytical, tactical)?
- Does it match query domain (financial, marketing, operations)?
Code:
def _calculate_relevance_scores(
self,
context: Dict[str, Any],
agent_type: str,
intent: str,
domain: str
) -> Dict[str, float]:
"""Calculate relevance score for each context component"""
scores = {}
# Get agent's focus areas
agent_template = agent_context_templates.get(agent_type, {})
focus_areas = agent_template.get("focus_areas", [])
for context_type, context_data in context.items():
score = 0.5 # Base score
# +0.2 for each matching focus area
if isinstance(context_data, list) and focus_areas:
matching_items = sum(
1 for item in context_data
if str(item).lower() in [fa.lower() for fa in focus_areas]
)
score += matching_items * 0.2
# +0.3 for intent/domain relevance
if intent == "strategic" and context_type in ["market_trends", "competitor_insights"]:
score += 0.3
elif intent == "analytical" and context_type in ["performance_history", "metrics"]:
score += 0.3
elif intent == "operational" and context_type in ["process_improvement", "workflow"]:
score += 0.3
# Cap at 1.0
scores[context_type] = min(1.0, score)
return scores
# Example scores for CFO revenue query:
# {
# "financial_reports": 0.95, # ✅ Include
# "revenue_trends": 0.90, # ✅ Include
# "cash_flow_data": 0.85, # ✅ Include
# "board_expectations": 0.65, # ✅ Include (borderline)
# "customer_satisfaction": 0.35, # ❌ Exclude (below 0.5 threshold)
# "employee_headcount": 0.25, # ❌ Exclude
# "marketing_campaigns": 0.20 # ❌ Exclude
# }
Threshold: Only context with score >0.5 is included in the final payload.
Step 5: Context Building Pipeline
The full 6-step pipeline constructs enriched, filtered context.
Code:
def build_context(
self,
query: str,
agent_type: str,
intent: str,
domain: str,
confidence_score: float,
processing_priority: int
) -> EnrichedContext:
"""
Build enriched context with progressive disclosure
Process:
1. Base context (query analysis)
2. Query-specific enrichment
3. Agent-specific context
4. Enterprise data integration
5. Market intelligence
6. Historical & stakeholder context
"""
# 1. Base context: Query analysis
base_context = self._build_base_context(query, agent_type)
# → Extracts: key entities, time references, urgency, stakeholders
# 2. Query-specific enrichment
query_specific = self._enrich_query_specific_context(query, intent, domain, agent_type)
# → Adds domain-specific context (financial, strategic, operational, compliance)
# 3. Agent-specific context
agent_context = self._build_agent_context(agent_type, intent, domain)
# → Uses agent template to filter relevant focus areas, metrics, time horizons
# 4. Enterprise data
enterprise_context = self._get_enterprise_data_context(agent_type, domain)
# → Connects to relevant systems (ERP, CRM, BI tools)
# 5. Market intelligence
market_context = self._get_market_intelligence_context(domain, intent)
# → Adds competitor data, industry trends, economic indicators
# 6. Historical & stakeholder context
historical_context = self._get_historical_context(agent_type, domain)
stakeholder_context = self._get_stakeholder_context(agent_type, intent)
# → Adds past decisions, performance history, board expectations
# Combine all contexts
combined_context = {
**base_context,
**query_specific,
**agent_context,
**enterprise_context,
**market_context,
**historical_context,
**stakeholder_context
}
# Calculate relevance scores
relevance_scores = self._calculate_relevance_scores(
combined_context, agent_type, intent, domain
)
# Return enriched context with filtering
return EnrichedContext(
original_query=query,
agent_type=agent_type,
intent=intent,
domain=domain,
context_data=combined_context, # Only high-relevance items
relevance_scores=relevance_scores,
timestamp=datetime.now(),
confidence_score=confidence_score,
processing_priority=processing_priority
)
What the Savings Look Like: Worked Examples
Progressive Disclosure Impact (Illustrative Model)
Source: Illustrative model based on published per-token list pricing
Worked Example 1: E-Commerce CFO Queries
Scenario: A mid-size e-commerce company (500K customers, $50M ARR)
Challenge: CFO asking 50+ financial queries per month, each costing $2-$5 with traditional AI
Implementation:
- Connected to: QuickBooks (financial), Stripe (payments), Salesforce (CRM)
- Agent-specific templates: CFO template focuses on financial + forecasting data
- Relevance threshold: 0.5 (exclude anything below 50% relevance)
Modeled results (30-day period):
| Metric | Before (Traditional AI) | After (Progressive Disclosure) | Improvement |
|---|---|---|---|
| Tokens per Query | 180K avg | 18K avg | 90% reduction |
| Cost per Query (premium model) | $5.40 | $0.54 | 90% reduction |
| Monthly Cost (50 queries) | $270 | $27 | 90% reduction |
| Annual Savings | — | $2,916 | — |
| Response Time | 2.1s | 2.3s | +0.2s (acceptable) |
Worked Example 2: Healthcare Enterprise
Scenario: A healthcare services company (500 employees, $200M revenue)
Challenge: Multiple executives (CEO, CFO, CMO, CHRO) using AI daily, costs spiraling to $15K/month
Implementation:
- Connected to: Epic (patient records), SAP (ERP), Workday (HR), Salesforce (CRM)
- Agent-specific templates for all 16 executives
- Domain-based filtering (healthcare compliance, financial, operational)
Modeled results (90-day period):
| Executive | Queries/Month | Cost Before | Cost After | Savings |
|---|---|---|---|---|
| CEO | 120 | $4,200 | $480 | 89% |
| CFO | 200 | $6,500 | $720 | 89% |
| CMO | 150 | $3,800 | $450 | 88% |
| CHRO | 80 | $2,100 | $280 | 87% |
| Total | 550 | $16,600 | $1,930 | 88% |
Modeled annual savings: $176,040 (88% reduction)
The pattern that makes this work: a CMO query about marketing campaigns only gets marketing data—not patient records. Obvious in hindsight, but it requires sophisticated filtering to implement.
Progressive Disclosure vs Traditional AI: Complete Comparison
Context Management Approaches
| Feature | Traditional AI (RAG) | PROCUX Progressive Disclosure |
|---|---|---|
| Context Sent to LLM | All available data | Only relevant data (filtered) |
| Token Count (Avg) | 150K-500K | 15K-50K (10x less) |
| Cost per Query (premium model) | $4.50-$15 | $0.45-$1.50 (90% cheaper) |
| Cost per Query (mid-tier model) | $0.45-$1.50 | $0.05-$0.15 (90% cheaper) |
| Response Quality | Good | Same or better (less noise) |
| Response Time | 2-5s | 2.5-5.5s (+0.5s filtering) |
| Setup Complexity | Simple (send everything) | Complex (requires templates) |
| Privacy Risk | High (all data sent) | Low (only relevant data sent) |
Key Insight: Progressive Disclosure trades a small increase in complexity (+0.5s latency for filtering) for a 10x cost reduction and improved data privacy.
How Context Filtering Improves Response Quality
Counterintuitive Finding: Sending less context often produces better responses.
Why?
- Less noise: LLMs perform better with focused, relevant context vs overwhelming them with millions of tokens
- Clearer signal: When 95% of context is relevant (vs 5% in traditional AI), the LLM focuses on what matters
- Fewer hallucinations: Less irrelevant data = less chance of mixing up unrelated facts
Example: CFO asks "What was Q3 revenue growth?"
Traditional AI (sends everything):
Context includes:
✅ Q3 financial report (relevant)
❌ 50K customer support tickets (irrelevant)
❌ 10K product descriptions (irrelevant)
❌ 500 employee profiles (irrelevant)
❌ 1,000 marketing emails (irrelevant)
LLM Response: "Q3 revenue grew 23%. Also, customer support volume increased 15% and..."
(Mixed irrelevant data into response—hallucination risk)
Progressive Disclosure (filters context):
Context includes:
✅ Q3 financial report (relevant)
✅ Revenue trend analysis (relevant)
✅ CFO past revenue decisions (relevant)
❌ Everything else excluded
LLM Response: "Q3 revenue grew 23% to $4.2M, driven by enterprise customer growth (18% increase) and improved retention (churn reduced from 5.2% to 3.8%)."
(Focused, accurate, no noise)
API Usage Examples
Basic Context Building
from procux import ProcuxClient
client = ProcuxClient(api_key="your_api_key")
# Query with progressive disclosure (default)
response = await client.query(
query="What was our Q3 revenue growth?",
agent_type="CFO", # Auto-filters to CFO-relevant context
progressive_disclosure=True # Default: enabled
)
print(response.content)
# "Your Q3 2024 revenue was $4.2M, representing 23% YoY growth..."
# View token usage
print(response.metadata['tokens_used'])
# Input: 18,542 tokens (vs 180K without filtering)
# Output: 247 tokens
# Total: 18,789 tokens
print(response.metadata['cost'])
# $0.57 (vs $5.42 without filtering)
# Savings: 89%
Custom Relevance Threshold
# Set custom relevance threshold
response = await client.query(
query="Should we expand to European markets?",
agent_type="CEO",
progressive_disclosure_config={
"relevance_threshold": 0.7, # Only include context >70% relevant (stricter)
"max_context_tokens": 10000, # Hard cap on context size
"prioritize": ["market_data", "competitor_intelligence"] # Prioritize these sources
}
)
# Even more aggressive filtering
# Result: 8,234 tokens (vs 18K with default 0.5 threshold)
# Cost: $0.25 (vs $0.57 with default)
View Relevance Scores (Debug Mode)
# Enable debug mode to see what context was included/excluded
response = await client.query(
query="What was our Q3 revenue growth?",
agent_type="CFO",
debug_mode=True
)
# View relevance scores
for context_type, score in response.metadata['relevance_scores'].items():
included = "✅" if score > 0.5 else "❌"
print(f"{included} {context_type}: {score:.2f}")
# Output:
# ✅ financial_reports: 0.95
# ✅ revenue_trends: 0.90
# ✅ cfo_past_decisions: 0.75
# ✅ board_expectations: 0.65
# ❌ customer_satisfaction: 0.35 (excluded)
# ❌ employee_headcount: 0.25 (excluded)
# ❌ marketing_campaigns: 0.20 (excluded)
Frequently Asked Questions
Q1: Does filtering context reduce response quality?
A: No. In fact, it often improves quality.
Less irrelevant context = less noise = fewer hallucinations. When nearly all of the context is relevant to the question, the model focuses on what matters instead of mixing in unrelated facts.
Q2: What if the query needs context from multiple domains?
A: The system handles multi-domain queries intelligently.
Example: "How did our Q3 marketing campaigns impact revenue?"
- Domains detected: marketing + financial
- Context included: Marketing campaign data (CMO) + Revenue data (CFO)
- Context excluded: HR records, support tickets, product catalog
The relevance scoring algorithm boosts scores for both domains.
Q3: How much latency does context filtering add?
A: Minimal: +50-200ms on average.
Breakdown:
- Intent classification: 20-50ms
- Relevance scoring: 30-100ms
- Context assembly: 10-50ms
Total: 60-200ms added latency
Worth it? Yes. Saving $5/query is worth 0.2 seconds.
Q4: Can I disable progressive disclosure for specific queries?
A: Yes. Set progressive_disclosure=False to send all context.
response = await client.query(
query="Give me a complete company overview",
progressive_disclosure=False # Send ALL context
)
Use case: Broad exploratory queries where you want comprehensive context.
Warning: Will result in higher costs (10x typical).
Q5: How does PROCUX handle context updates (new data)?
A: Context is dynamically rebuilt for every query with the latest data.
Process:
- Query arrives
- System checks data freshness (
_get_data_freshness_info()) - Fetches latest data from connected systems (ERP, CRM, etc.)
- Filters to relevant context
- Sends to LLM
Data age: Typically <1 hour old (real-time for databases)
Q6: What's the difference between Progressive Disclosure and RAG?
A:
RAG (Retrieval-Augmented Generation):
- Retrieves relevant documents via vector search
- Good for filtering large document sets
- Still sends all retrieved docs to LLM (no further filtering)
Progressive Disclosure:
- Filters at multiple levels (domain, agent, intent, relevance)
- Applies agent-specific templates (CFO vs CMO get different context)
- Uses relevance scoring to rank and filter context components
- Works with RAG (RAG retrieves, Progressive Disclosure filters further)
Best practice: Use RAG for document retrieval, then apply Progressive Disclosure for final filtering.
Q7: How do I connect my company data sources?
A: PROCUX supports 20+ native connectors:
Financial: QuickBooks, Xero, Stripe, Plaid CRM: Salesforce, HubSpot, Zoho, Dynamics 365 ERP: SAP, Oracle, NetSuite, Workday HR: Workday, BambooHR, ADP, Gusto BI: Tableau, Power BI, Looker, Qlik
Setup:
client.connect_data_source(
source_type="salesforce",
credentials={
"instance_url": "https://your-org.salesforce.com",
"access_token": "your_token"
},
sync_frequency="hourly" # How often to refresh data
)
Conclusion: Stop Wasting Money on Irrelevant Context
The bottom line:
- ✅ 80-90% cost reduction through intelligent context filtering
- ✅ Same or better response quality (less noise = fewer hallucinations)
- ✅ Improved data privacy (only relevant data sent to LLM)
- ✅ Faster response times (less context = faster LLM processing)
Progressive Disclosure isn't optional—it's essential for cost-effective enterprise AI.
Next Steps
- Try PROCUX: Start free trial (1,000 queries with progressive disclosure)
- Calculate savings: ROI calculator (enter your current AI costs)
- Connect data sources: Integration guides
- Read the docs: API documentation
Questions? Contact our team for a personalized cost analysis.
Related Resources
- PROCUX Board™: Multi-Agent Consensus Mechanism
- PROCUX Verify™: Evidence-Based AI
- PROCUX DNA™: Teaching AI Your Company Culture
- Progressive Disclosure API Reference