MCPcopy
hub / github.com/mudler/LocalAI / memVectorStore

Struct memVectorStore

core/services/routing/router/embedding_cache_test.go:58–62  ·  view source on GitHub ↗

memVectorStore is an in-memory KNN store with exact-vector hits, used to exercise the cache layer without a real local-store backend. Similarity is 1.0 for an exact match (after vector quantisation), 0.5 for "close" (configured via the second-arg suffix), 0.0 otherwise.

Source from the content-addressed store, hash-verified

56// Similarity is 1.0 for an exact match (after vector quantisation), 0.5
57// for "close" (configured via the second-arg suffix), 0.0 otherwise.
58type memVectorStore struct {
59 mu sync.Mutex
60 entries []memEntry
61 failOps int // remaining Search calls to fail before returning miss
62}
63
64type memEntry struct {
65 vec []float32

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected