Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltCache ¶
type BoltCache struct {
// contains filtered or unexported fields
}
BoltCache implements memory.HotCache using bbolt for L0 fact caching.
func NewBoltCache ¶
NewBoltCache opens or creates a bbolt database for caching.
func NewBoltCacheFromDB ¶
NewBoltCacheInMemory creates an in-memory bolt cache (for testing). bbolt doesn't support true in-memory, so we use a temp file.
func (*BoltCache) GetL0Facts ¶
GetL0Facts returns all cached L0 (project-level) facts.
func (*BoltCache) InvalidateFact ¶
InvalidateFact removes a single fact from the cache.
type CachedEmbedder ¶
type CachedEmbedder struct {
// contains filtered or unexported fields
}
CachedEmbedder wraps an Embedder and caches results in BoltDB (v3.4). Avoids recomputing embeddings for the same text, especially useful for ONNX mode where inference is expensive.
func NewCachedEmbedder ¶
func NewCachedEmbedder(inner vectorstore.Embedder, db *bolt.DB) (*CachedEmbedder, error)
NewCachedEmbedder creates a caching wrapper around any Embedder.
func (*CachedEmbedder) Dimension ¶
func (c *CachedEmbedder) Dimension() int
Dimension delegates to inner embedder.
func (*CachedEmbedder) Mode ¶
func (c *CachedEmbedder) Mode() vectorstore.OracleMode
Mode delegates to inner embedder.
func (*CachedEmbedder) Name ¶
func (c *CachedEmbedder) Name() string
Name returns the inner embedder name with cache prefix.
func (*CachedEmbedder) Stats ¶
func (c *CachedEmbedder) Stats() (hits, misses int)
Stats returns cache hit/miss statistics.