Skip to main content

Module embedding_cache

Module embedding_cache 

Source
Expand description

Embedding cache for reducing API calls.

Provides LRU cache with TTL for embedding vectors.

§Example

use oxios_kernel::memory::EmbeddingCache;

let cache = EmbeddingCache::new(3600, 10000);  // 1 hour TTL, 10k max
cache.insert("hello", vec![1.0, 2.0, 3.0]);
let embedded = cache.get("hello");
assert!(embedded.is_some());

Structs§

CacheStats
Cache statistics for monitoring.
EmbeddingCache
Content-addressable embedding cache with TTL and LRU eviction.