Cost Optimization

Strategies for reducing agent costs without sacrificing capability.

Broker Routing

The biggest cost saver is the Broker Routing engine. Instead of sending every task to an LLM, the broker tries cheaper options first:

Task → Skill Match (free) → WASM Handler ($0.001) → LLM ($0.03+)

Enable broker routing:

broker:
  enabled: true
  routing:
    preferSkill: true
    llmAsLastResort: true

Cost Savings Breakdown

Route Avg Cost Speed
Skill match $0.00 <1ms
WASM handler ~$0.001 ~10ms
LLM fallback ~$0.03 ~2s

With broker routing enabled, typical projects see 40-60% cost reduction.

Caching

Enable response caching to avoid duplicate LLM calls:

broker:
  cache:
    enabled: true
    ttl: 3600    # cache for 1 hour

Right-Sizing Budgets

Use the dashboard to analyze actual spending patterns:

naos dashboard --open

Navigate to the Cost page to see:

  • Per-agent spending over time
  • Peak usage periods
  • Budget utilization rates

Tips

  1. Start with generous budgets and tighten based on actual usage
  2. Use skill handlers for repetitive tasks (summarize, classify, extract)
  3. Enable caching for idempotent operations
  4. Monitor the dashboard weekly to identify optimization opportunities
  5. Use throttle instead of pause to maintain availability at reduced capacity