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.
| 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. |
| 58 | type memVectorStore struct { |
| 59 | mu sync.Mutex |
| 60 | entries []memEntry |
| 61 | failOps int // remaining Search calls to fail before returning miss |
| 62 | } |
| 63 | |
| 64 | type memEntry struct { |
| 65 | vec []float32 |
nothing calls this directly
no outgoing calls
no test coverage detected