Native embedding storage with HNSW + DiskANN hybrid indexing, SIMD acceleration, tiered cloud storage, and sub-millisecond search latency.
// Create index (128 dims, L2 distance) db, _ := vecgo.Open(ctx, vecgo.Local("./data"), vecgo.Create(128, vecgo.MetricL2)) defer db.Close() rec := vecgo.NewRecord(embedding). WithMetadata("category", metadata.String("tech")). WithPayload([]byte(`{"title": "Hello World"}`)). Build() id, _ := db.InsertRecord(ctx, rec) db.Commit(ctx) // Durable after commit results, _ := db.Search(ctx, query, 10) for _, r := range results { fmt.Printf("ID: %d, Score: %.4f\n", r.ID, r.Score) }
The sweet spot between embedded libraries and full database systems
Runtime-detected AVX-512, AVX2, NEON, and SVE2 for blazing-fast distance calculations.
HNSW + DiskANN/Vamana with FreshDiskANN for real-time updates without rebuilding.
PQ, OPQ, SQ8, Binary, RaBitQ, and INT4 for 4-32× memory reduction with minimal recall loss.
Hot data in memory, warm on SSD, cold on S3/MinIO with automatic tiering.
Query historical snapshots with MVCC-style versioning and point-in-time recovery.
Combine vector similarity with BM25 text search and metadata filtering.
Euclidean, Cosine, Inner Product, and Hamming with automatic optimization.
OpenTelemetry tracing and metrics for production monitoring.
Append-only versioned commits with atomic segments — no WAL complexity.
Vecgo uses an LSM-tree inspired design with HNSW for hot data and DiskANN for cold data, providing optimal performance across all access patterns.
Optimize for your workload: latency, throughput, or recall
| Parameter | Default | When to Increase | When to Decrease |
|---|---|---|---|
M (HNSW edges) |
16 | Higher recall needed, larger datasets | Memory constrained, small datasets |
EfConstruction |
200 | Build once, query often | Faster indexing priority |
EfSearch |
100 | Higher recall (0.99+) | Lower latency priority |
R (DiskANN degree) |
64 | Disk-based, high recall | Faster build, less disk I/O |
L (DiskANN search list) |
100 | Better recall at query time | Minimize SSD reads |
PQ.M (subquantizers) |
dims/4 | Better compression vs recall tradeoff | Memory less constrained |
Commit-oriented durability with no WAL complexity — simpler code, fewer moving parts.
Requires Go 1.24+ (64-bit)
go get github.com/hupe1980/vecgo
Apache License 2.0
Free for commercial use, modification, and distribution.
Check out the examples and start building with Vecgo today.
View Examples →