Skip to main content
Caching improves performance and reduces costs by reusing previous responses and leveraging provider-specific prompt caching.

Quick Start

1

Enable Caching

2

With Configuration


Cache Types

Response Caching

Stores LLM responses locally for identical requests:

Prompt Caching

Uses provider-specific caching (Anthropic, OpenAI):

Configuration Options


Provider Support


Cache Benefits


When to Use Caching

✅ Enable Caching For

  • FAQ bots
  • Repeated queries
  • Static content generation
  • Development/testing

❌ Disable Caching For

  • Real-time data needs
  • Personalized responses
  • Time-sensitive content
  • Random/creative output

Cache Invalidation

Caches are invalidated when:
  • System prompt changes
  • Model changes
  • Temperature changes
  • Tools change

Best Practices

Agents that answer common questions benefit most from caching.
If your system prompt is large, enable prompt caching to reduce costs.
Don’t cache responses that should vary (time-sensitive, personalized).
Track cache effectiveness to optimize your caching strategy.

Execution

Performance limits

Memory

Persistent storage