Added
- Store introspection and writes —
Has,IDs,Clear,Dims,Metric,Upsert,AddUnique, per-id metadata (SetMeta/Meta), andLockedStorefor concurrent writers. - Search APIs —
SearchIDs(no vector clones),SearchOpts(WithoutVectors,WithPredicate,WithMetaEqual,WithMaxDistance,WithParallel),SearchBatch,SearchRadius,Rerank, andHybridscore blending. - Persistence —
WriteTo/ReadFrom/WriteJSONTo/ReadJSONFrom,SaveAtomic(temp + fsync + rename). Structurally invalid gob/JSON is rejected and leaves existing state unchanged. - Metrics —
ChebyshevDistanceandHammingDistance, plus zero-allocChebyshev/Hamming. - Random projections options —
NewRandomProjectionsOptswithWithSeed,WithNGrams,WithHashingTrick,WithTFIDF,WithMinTokenLen;FitMore;MustEmbed/BatchEmbedder/EmbedBatch. Defaults stay seed 42. - HTTP embedder knobs —
WithRetry(429/5xx only),WithMaxBatch,WithUserAgent,WithMaxResponseBytes,WithEndpointPath. - ONNX —
EmbedContext/EmbedBatchContext, thread options,WithOutputName,WithMeanPoolExcludeSpecials,WithCUDA/WithCoreML. pkg/hnsw— pure-Go approximate index overvector.Vector. Own gob format; corrupt graphs rejected on load.pkg/quantize— int8 scaling helpers andInt8Store.- CLI —
go-vector index|query|benchin addition todemo|embed|persist.
Changed
- Packed row-major store + cached norms + first-id index when all vectors share a length (mixed lengths still fall back).
- Distance kernels unroll 4-wide for
n >= 16; new in-placeAddIn/SubIn/ScaleIn/NormalizeIn. Store.Searchtop-k heap is worst-at-root (correct eviction whenk < n). v1.3 results matched only whenk >= n.- README and landing page document the new APIs. v1.3 gob/JSON fixtures still load.
Compatibility
Existing v1.3 callers keep compiling. Vector stays []float32; pkg/vector stays stdlib-only; Add still allows duplicate IDs; Search still clones; RP default seed stays 42; Embedder did not gain methods.
go get github.com/BackendStack21/go-vector@v1.4.0