Releases: BackendStack21/go-vector
Releases · BackendStack21/go-vector
v1.1.1 — Text Embedding, Persistence, CLI Demos
go-vector v1.1.1
Text embedding, disk persistence, and CLI demos — zero dependencies.
Text Embedding
Embedderinterface — swap backends without changing search codeRandomProjections— sparse Johnson-Lindenstrauss projection- Builds vocabulary from your corpus (
Fit) - Tokenizer: split on non-letter/digit, lowercase, min 2 chars
- Deterministic output (seed 42), L2-normalized
- Builds vocabulary from your corpus (
rp := vector.NewRandomProjections(256)
rp.Fit(corpus)
v, _ := rp.Embed("machine learning is fascinating")Disk Persistence
Store.Save(path)/Store.Load(path)— gob-encoded binaryStore.SaveJSON(path)/Store.LoadJSON(path)— human-readable JSON- Full roundtrip: IDs, vectors, metric all preserved
store.Save("/data/vectors.db")
restored.Load("/data/vectors.db")CLI Demos
go run ./cmd/go-vector demo — vector store search
go run ./cmd/go-vector embed — text embedding + similarity search
go run ./cmd/go-vector persist — save/load roundtrip
Stats
- 40 tests · 96.8% coverage · 0 dependencies
v1.1.0 — Text Embedding and Disk Persistence
go-vector v1.1.0
Text embedding and disk persistence — still zero dependencies.
Text Embedding
Embedderinterface — swap backends without changing search codeRandomProjections— sparse Johnson-Lindenstrauss projection- Builds vocabulary from your corpus (
Fit) - Tokenizer: split on non-letter/digit, lowercase, min 2 chars
- Deterministic output (seed 42), L2-normalized
- ~10µs per embed at 256 output dims
- Builds vocabulary from your corpus (
rp := vector.NewRandomProjections(256)
rp.Fit(corpus)
v, _ := rp.Embed("machine learning is fascinating")Disk Persistence
Store.Save(path)/Store.Load(path)— gob-encoded binaryStore.SaveJSON(path)/Store.LoadJSON(path)— human-readable JSON- Full roundtrip: IDs, vectors, metric all preserved
- ~60MB for 10K vectors at 1536d, ~200ms save/load
Stats
- 40 tests · 96.8% coverage · 0 dependencies
v1.0.1 — Security, Performance, Docs
go-vector v1.0.1
Security hardening, performance optimizations, and comprehensive documentation.
Security
- Documented float32 overflow limits (
MaxSafeDims = 1,000,000) - Formalized clone-safety guarantees — all store outputs are deep copies
- Thread-safety guidance for concurrent Store access
Performance
- Euclidean: inlined single-pass computation — 0 allocations (was
Sub+Norm, now one loop) - Cosine: single-pass computation — computes dot and both norms in one loop
- Comprehensive benchmark suite: 11 benchmarks at 768–1536 dimensions
- All distance functions verified zero-allocation
Docs
- Rewritten README with performance benchmarks table and security checklist
- GitHub Pages landing page under
/docs/— dark theme, four sections - Updated AGENTS.md with full conventions and performance rules
Stats
- 27 tests · 99.1% coverage · 0 dependencies
v1.0.0 — First Stable Release
go-vector v1.0.0
Zero-dependency vector similarity library for Go.
What's included
- Vector type — Dot, Norm, Normalize, Add, Sub, Scale, Equal, Clone
- Similarity metrics — Cosine Distance, Euclidean, Manhattan, Dot Product
- Vector Store — in-memory brute-force nearest-neighbor search with top-K
- 99% test coverage — 26 tests, zero dependencies
Quick start
go get github.com/BackendStack21/go-vector
import "github.com/BackendStack21/go-vector/pkg/vector"
store := vector.NewStore(vector.CosineDistance)
store.Add("cat", vector.Vector{1.0, 0.8, 0.1})
results := store.Search(vector.Vector{1.0, 0.9, 0.1}, 3)License
MIT