Skip to content

v1.4.0 — Packed search, HNSW, quantization, store extensions

Latest

Choose a tag to compare

@cursor cursor released this 05 Sep 11:09
c861f03

Added

  • Store introspection and writes — Has, IDs, Clear, Dims, Metric, Upsert, AddUnique, per-id metadata (SetMeta / Meta), and LockedStore for concurrent writers.
  • Search APIs — SearchIDs (no vector clones), SearchOpts (WithoutVectors, WithPredicate, WithMetaEqual, WithMaxDistance, WithParallel), SearchBatch, SearchRadius, Rerank, and Hybrid score blending.
  • Persistence — WriteTo / ReadFrom / WriteJSONTo / ReadJSONFrom, SaveAtomic (temp + fsync + rename). Structurally invalid gob/JSON is rejected and leaves existing state unchanged.
  • Metrics — ChebyshevDistance and HammingDistance, plus zero-alloc Chebyshev / Hamming.
  • Random projections options — NewRandomProjectionsOpts with WithSeed, 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 over vector.Vector. Own gob format; corrupt graphs rejected on load.
  • pkg/quantize — int8 scaling helpers and Int8Store.
  • CLI — go-vector index|query|bench in addition to demo|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-place AddIn / SubIn / ScaleIn / NormalizeIn.
  • Store.Search top-k heap is worst-at-root (correct eviction when k < n). v1.3 results matched only when k >= 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