What is DiskANN?
DiskANN is an indexing and search system keeping a graph-based approximate nearest neighbour index and full vectors on SSD while holding only compressed vectors in memory, enabling low-latency search over billion-scale vector collections on a single machine.
Unlike Hierarchical Navigable Small World, which keeps the whole graph and vectors in main memory, costly for very large data, DiskANN keeps the main structure on SSD and uses compressed in-memory copies to steer search. It builds a graph called Vamana to reach targets in few disk reads.
- Topic
- Embeddings, document processing and RAG
- Also known as
- Vamana
- Origin
- Subramanya et al., 2019
How DiskANN works
- The Vamana graph links each point to a few neighbours giving short paths to distant regions.
- Graph and full vectors are written to SSD; compressed versions of vectors stay in memory.
- As a query walks the graph, direction comes from compressed vectors and needed nodes are read from SSD.
- Final candidates are reranked with full vectors from SSD.
In more detail
Product quantisation and SSD block alignment
DiskANN compresses vectors in RAM using Product Quantisation (PQ), which splits high-dimensional vectors into subspaces and stores compact centroid IDs so billions of codes fit within tens of gigabytes. On SSD, each node's full-precision vector and its Vamana adjacency list are stored contiguously within aligned 4 KB disk sectors, allowing a single asynchronous I/O read to fetch both the exact coordinates and the next candidate neighbours.
Beam search and asynchronous I/O batching
Rather than issuing one blocking SSD read per graph hop, DiskANN executes a beam search controlled by a search list size (L) and beam width (W). At each step, it batches up to W unvisited candidate nodes in parallel using asynchronous I/O (such as Linux io_uring or AIO), saturating NVMe queue depth while trading slightly higher IOPS for substantially lower tail latency.
Dynamic updates (FreshDiskANN) and filtered search
The original 2019 Vamana index is static, meaning additions and deletions degrade graph quality or require expensive full rebuilds. Later extensions such as FreshDiskANN support streaming insertions and tombstoned deletions with background consolidation, while Filtered-DiskANN incorporates metadata labels into graph construction so access-control or attribute filters do not collapse recall.
Commonly confused terms
| Term | How it differs |
|---|---|
| IVF-PQ | IVF-PQ partitions vector space into coarse clusters on disk or in RAM without graph traversal; DiskANN navigates a Vamana proximity graph using beam search and relies on PQ codes in memory solely to guide graph hops and avoid unnecessary disk reads. |
| Memory-mapped HNSW | Memory-mapped (mmap) HNSW relies on the OS page cache to swap RAM pages to disk, often suffering severe random-I/O thrashing; DiskANN co-locates adjacency lists with full vectors in aligned SSD sectors and uses beam search to bound disk round-trips explicitly. |
Why DiskANN matters for on-premises AI
As enterprise document archives grow, fitting the whole vector index in memory gets costly. The paper introducing the method reports indexing and searching a billion-point collection on one workstation with only 64 GB of memory and an inexpensive SSD, serving over 5,000 queries a second on 16 cores with under 3 milliseconds mean latency and over 95% 1-recall@1. This can lower hardware cost for large in-house indexes.
A public body makes a very large embedding collection from decades of scanned correspondence searchable on one server with a graph-based method keeping the index on SSD, buying a fast SSD instead of a memory upgrade.
Common questions
How does DiskANN differ from HNSW?
HNSW keeps the index in main memory. DiskANN keeps the main structure on SSD with only compressed vectors in memory, making very large collections cheaper.
Is an index on disk not slow?
The graph is built to reach targets in few disk reads, so latency can stay low; a fast SSD matters.
Related terms
- Hierarchical Navigable Small World
- Vector index
- Approximate nearest neighbour search
- Vector database
- Inverted File Index
- Product quantisation
Sources
- Subramanya et al., DiskANN: Fast Accurate Billion-point Nearest Neighbor Search on a Single Node, NeurIPS, 2019
- Malkov and Yashunin, Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs, 2016
In the glossary: Glossary, D to L