Semantic Cache for cortex
Provides caching with optional semantic similarity matching for LLM responses. Supports multiple backends:
- In-Memory: Fast LRU cache with TTL support (default)
- Redis/Valkey: Distributed cache for multi-instance deployments
Features
memory(default): Enable in-memory LRU cacheredis: Enable Redis/Valkey backendfull: Enable all backends
Example
use ;
// In-memory cache
let cache = new;
// Store a response
cache.store.await?;
// Retrieve (exact match)
if let Some = cache.get.await?