@ruvector/diskann-wasm: browser/edge DiskANN via PQ-guided traversal + on-demand vector fetch
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.5k
- Forks
- 603
- Avg merge
- 23h 32m
- Merged PRs (30d)
- 59
Description
Capstone of the ruvector-diskann series (#673, #674, #675): bring DiskANN to wasm.
Today: @ruvector/diskann is napi-native with per-platform binaries. There's no wasm artifact, even though the repo has a strong *-wasm crate pattern (micro-hnsw-wasm and ~20 siblings) — and DiskANN is arguably the index whose architecture benefits most from wasm.
Why DiskANN specifically works in a browser: a tab can't hold a large index in RAM and has no mmap, but the DiskANN split maps cleanly onto what browsers do have —
- PQ codes + graph adjacency: small, live in wasm linear memory
- full-precision vectors: fetched on demand for final re-rank only, from OPFS or IndexedDB locally, or via HTTP range requests against a remote index shard
- distance kernels: SIMD128 (#675) for PQ tables and re-rank
With #673 (PQ-guided traversal, so hops never touch full vectors) and #674 (storage abstraction behind FlatVectors), the wasm crate is mostly a thin wasm-bindgen layer plus an async vector-fetch trait. That yields larger-than-RAM ANN inside a browser tab, which very few libraries offer, plus one artifact covering everything outside the napi platform matrix (Alpine, other ARM Linuxes, edge runtimes).
Optional second rung: WebGPU batch kernels for index build, PQ k-means training, and bulk re-rank. Single-query search should stay on CPU — dispatch overhead dominates at the 55µs search latencies in ADR-144 — but build-in-browser is where a compute backend genuinely changes what's possible (Vamana build is single-threaded today, and wasm threads via SharedArrayBuffer are painful to ship in npm). We have WGSL ports of our Metal kernels and would wire them behind a feature flag.
We'd like to build this incrementally as the issues above land, each PR additive and measured.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issues #673, #674, and #675, then compare the existing micro-hnsw-wasm and other *-wasm crate patterns. The proposed entry point is a wasm-bindgen layer around DiskANN with an async vector-fetch trait, supporting OPFS, IndexedDB, or HTTP range requests. Done means an incremental, measured wasm artifact for browser and edge use; WebGPU is explicitly optional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- ai, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100