mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-24 05:43:58 +00:00
- ruvector README: DiskANN section with quick start, PQ, persistence, batch insert, performance benchmarks, config reference, platforms - @ruvector/diskann README: standalone install + usage docs Co-Authored-By: claude-flow <ruv@ruv.net> |
||
|---|---|---|
| .. | ||
| false | ||
| package.json | ||
| README.md | ||
| test.js | ||
@ruvector/diskann
DiskANN/Vamana approximate nearest neighbor search — built in Rust, runs on all platforms.
Implements the Vamana graph algorithm from "DiskANN: Fast Accurate Billion-point Nearest Neighbor Search on a Single Node" (NeurIPS 2019).
Install
npm install @ruvector/diskann
Usage
const { DiskAnn } = require('@ruvector/diskann');
const index = new DiskAnn({ dim: 128 });
// Insert vectors
for (let i = 0; i < 1000; i++) {
const vec = new Float32Array(128);
for (let d = 0; d < 128; d++) vec[d] = Math.random();
index.insert(`vec-${i}`, vec);
}
// Build Vamana graph
index.build();
// Search
const query = new Float32Array(128).fill(0.5);
const results = index.search(query, 10);
console.log(results); // [{ id: 'vec-42', distance: 0.123 }, ...]
// Persist
index.save('./my-index');
const loaded = DiskAnn.load('./my-index');
Performance
| Metric | Value |
|---|---|
| Search latency | 55µs (5K vectors, 128d, k=10) |
| Recall@10 | 0.998 |
| Build | ~6s for 5K vectors |
API
See full documentation at github.com/ruvnet/ruvector.
License
MIT