DiskANN, or Disk-based Approximate Nearest Neighbor, is a graph-based ANN algorithm designed to overcome the memory limitations of in-memory indexes like HNSW. By storing the majority of the vector index on an SSD and only caching a small, navigable subset in RAM, it achieves a favorable ANN recall trade-off while dramatically reducing the hardware cost required to search massive, billion-scale vector datasets.
Glossary
DiskANN

What is DiskANN?
DiskANN is a graph-based approximate nearest neighbor (ANN) search algorithm that stores its vector index on solid-state drives (SSDs) rather than RAM, enabling cost-effective, low-latency search over billion-scale datasets.
The algorithm constructs a graph index on the SSD and uses a small set of entry points cached in memory to initiate the search. During a query, DiskANN performs a beam search, strategically issuing a minimal number of parallel SSD reads to fetch the next set of candidate vectors. This architecture makes it a foundational technology for building economically viable, large-scale semantic indexing pipelines and vector database infrastructure.
Key Features of DiskANN
DiskANN is a graph-based approximate nearest neighbor search algorithm that fundamentally re-architects the relationship between storage and memory, enabling billion-scale vector search directly from commodity SSDs.
SSD-Resident Index Architecture
Unlike in-memory algorithms like HNSW, DiskANN stores the Vamana graph index on solid-state drives, accessing only a tiny fraction of the graph during search. It exploits the high random-read IOPS of modern NVMe SSDs while minimizing the performance penalty of disk I/O. The algorithm intelligently caches only the most frequently traversed graph nodes in RAM, using a beam search that overlaps computation with asynchronous disk reads to hide latency. This design decouples dataset size from expensive DRAM capacity.
Vamana Graph Construction
DiskANN builds a directed graph named Vamana with a crucial property: the graph diameter is small and the out-degree of each node is bounded, ensuring fast traversal. Construction uses a greedy search with a pruning strategy that eliminates edges to nodes that are already reachable via shorter paths. This creates a navigable structure where the longest path between any two points is logarithmic relative to the dataset size. The pruning parameter, alpha, controls the graph density and directly tunes the recall-latency trade-off.
Product Quantization Compression
To minimize storage footprint and I/O cost, DiskANN compresses the full-precision vectors stored on disk using Product Quantization (PQ). The original high-dimensional vector is split into sub-vectors, and each is independently quantized to a codebook. During search, distances are computed using asymmetric distance computation against the PQ codes, avoiding the need to decompress the full vector. This achieves a typical compression ratio of 8x to 32x with a negligible impact on recall, enabling billion-scale datasets to fit on a single server's SSDs.
Beam Search with Disk-Aware Caching
DiskANN's search uses a beam search that maintains a frontier of candidate nodes. It issues asynchronous read requests for the graph neighbors of frontier nodes, overlapping I/O with distance computation. A small, dynamic LRU cache in RAM holds the graph adjacency lists of frequently visited nodes, absorbing the locality inherent in the search traversal. This cache-aware design ensures that the algorithm saturates the SSD's queue depth without blocking on individual reads, achieving sub-millisecond latency per query on billion-scale datasets.
Freshness via Incremental Insertions
Unlike static indexes that require costly full rebuilds, DiskANN supports incremental insertion of new vectors directly into the Vamana graph. The algorithm performs a beam search to locate the neighborhood for the new point, then updates the graph edges using the same pruning strategy from construction. This allows the index to stay current with streaming data without blocking queries. Deletions are handled via a lazy tombstone mechanism, marking nodes as invalid and reclaiming space during periodic consolidation.
Filtered Search Integration
DiskANN natively supports predicate-based filtering during ANN search, combining vector similarity with structured metadata constraints. The algorithm applies filters during the beam search traversal, skipping graph nodes that do not match the predicate before computing distances. This avoids the post-filtering pitfall where a query returns zero results. The implementation handles complex boolean expressions on document tags, timestamps, and categorical attributes, enabling use cases like searching within a specific date range or product category.
DiskANN vs. HNSW vs. FAISS
Architectural and operational comparison of three leading approximate nearest neighbor search algorithms for billion-scale vector retrieval.
| Feature | DiskANN | HNSW | FAISS |
|---|---|---|---|
Primary Storage Medium | SSD (Solid-State Drive) | RAM (In-Memory) | RAM / GPU Memory |
Index Build Time | Hours (Vamana graph construction) | Minutes to hours | Minutes (GPU-accelerated) |
Memory Footprint | Minimal (< 64 GB for billion-scale) | High (index fully in RAM) | High (index fully in RAM/VRAM) |
Billion-Scale Search | |||
Incremental Index Updates | |||
Query Latency (P99) | < 10 ms | < 1 ms | < 5 ms |
Recall@10 (Typical) |
|
|
|
Hardware Cost Profile | Low (commodity SSD) | High (large RAM servers) | High (GPU instances) |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Explore the core mechanisms, performance trade-offs, and architectural benefits of Microsoft's DiskANN algorithm for cost-effective, billion-scale vector search.
DiskANN is a graph-based Approximate Nearest Neighbor (ANN) search algorithm specifically architected to store the vector index on Solid-State Drives (SSDs) rather than in expensive main memory (RAM). It works by constructing a Vamana graph, a directed graph where nodes represent vectors and edges represent neighbor relationships. During search, DiskANN navigates this graph using a beam search, but critically, it minimizes random reads by caching the graph's adjacency lists in a compressed format and performing only a few sequential SSD reads per query. This design leverages the high throughput of modern NVMe SSDs to achieve low-latency, high-recall search over billion-scale datasets at a fraction of the hardware cost of an in-memory solution like HNSW.
Related Terms
Core concepts and adjacent technologies that define the DiskANN architecture and its role in high-performance, cost-effective vector search.
Vamana Indexing Algorithm
The foundational graph construction algorithm behind DiskANN. Vamana builds a directed graph with a constant out-degree and a long-range edge property, ensuring the graph diameter remains small. This allows a greedy search to converge in logarithmic steps. The key innovation is the pruning strategy: during construction, the algorithm connects a new node to its nearest neighbors but then prunes redundant short-range links, preserving long-range shortcuts that enable fast navigation across the entire dataset. This graph structure is what makes DiskANN's SSD-resident index viable.
SSD-Resident Index Layout
Unlike in-memory ANN algorithms like HNSW, DiskANN stores the full graph index on an NVMe SSD, with only a small cache of frequently accessed nodes in RAM. The index is laid out sequentially on disk to maximize sequential read throughput rather than random I/O. A compressed representation of vector data is stored alongside the graph edges, minimizing the bytes read per hop. This design enables searching billion-scale datasets on a single commodity machine without requiring terabytes of expensive RAM.
PQ Compression for Disk I/O
DiskANN uses Product Quantization (PQ) to compress the full-precision vectors stored on the SSD. The original high-dimensional vector is split into sub-vectors, each quantized to a codebook. During search, only the compact PQ codes are read from disk to compute approximate distances. This drastically reduces the I/O cost per distance computation. The full-precision vector is only accessed for the final candidate re-ranking step, ensuring high recall while keeping disk bandwidth requirements low.
Beam Search with Backtracking
DiskANN employs a beam search strategy over the Vamana graph. Starting from a fixed entry point, the algorithm maintains a beam of the W closest candidates found so far. At each step, it expands the best unexplored candidate, reading its neighbors from the SSD. A critical optimization is backtracking: if the search reaches a local minimum, the algorithm can revisit previously skipped nodes. This balances exploration and exploitation, achieving high recall with a bounded number of expensive disk reads.
Memory-Mapped Caching Layer
To mitigate SSD latency, DiskANN maintains a hotspot-aware cache of graph nodes in main memory. Frequently traversed nodes—typically those near the entry point or in dense clusters—are cached using a memory-mapped file mechanism. The caching policy is not a simple LRU; it is informed by the graph structure itself, prioritizing nodes with high out-degree and those on critical navigation paths. This hybrid RAM/SSD architecture is the core of DiskANN's cost-performance trade-off.
Freshness via Incremental Indexing
DiskANN supports incremental insertion without a full index rebuild. New vectors are inserted directly into the Vamana graph by finding their nearest neighbors and updating edges, with a background process periodically re-optimizing local graph regions. This is critical for production retrieval pipelines where data is continuously ingested. Combined with a log-structured merge (LSM) tree approach for deletions, DiskANN maintains query performance even as the index mutates, avoiding the downtime associated with batch-only indexing.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us