Skip to main content

Module vector_cache

Module vector_cache 

Source
Expand description

Vector embedding cache with LRU eviction.

Provides an in-memory cache for embedding vectors with:

  • LRU eviction (configurable max entries)
  • Cache warming (preload frequently accessed vectors)
  • Hit/miss statistics tracking
  • Memory-bounded eviction
  • Cache invalidation (by key, by prefix, clear all)
  • Optional per-entry TTL-based expiry
  • Batch get/put operations
  • Cache persistence (save/load)

Structsยง

CacheSnapshot
A serializable representation of the cache for persistence.
CacheStatistics
Hit/miss statistics for the cache.
VectorCache
An LRU cache for embedding vectors.
VectorCacheConfig
Configuration for the vector cache.