Skip to main content
Meilisearch stores and searches vector embeddings using a disk-backed approximate nearest neighbor (ANN) approach inspired by DiskANN, Microsoft’s research on graph-based vector search that scales beyond RAM. The implementation lives in Hannoy, Meilisearch’s purpose-built vector store library introduced in v1.29.

What is DiskANN?

DiskANN is a family of techniques for building graph-based vector indexes that live on disk rather than entirely in memory. Traditional vector search engines (like FAISS or HNSWlib) require the full index to fit in RAM, which becomes expensive or impossible at scale. DiskANN’s key insight is that careful disk layout, combined with graph-based navigation, can achieve near in-memory search speeds while storing data on SSD. Meilisearch builds on this approach by combining HNSW (Hierarchical Navigable Small World) graph navigation with LMDB persistence, giving you fast vector search without RAM limitations.

Hannoy: Meilisearch’s DiskANN implementation

Hannoy implements the core DiskANN principles with HNSW as the graph structure and LMDB as the storage backend. It replaced Arroy, Meilisearch’s previous vector store based on hyperplane trees (k-d trees).

Why Hannoy replaced Arroy

While Arroy worked well for lower dimensions, it had limitations: Hannoy addresses all these issues using a graph-based approach.

Performance improvements

Benchmarks on 1 million documents show dramatic improvements:

768-dimensional embeddings

1536-dimensional (quantized)

Real-world impact: One customer’s indexing time dropped from 2 months to 6 seconds.

How it works

HNSW graph navigation

Hannoy organizes vectors into a hierarchical graph structure:
Search process:
  1. Enter at the top layer (sparse, enables fast navigation)
  2. Greedily navigate toward the query vector
  3. Descend to the next layer at each local minimum
  4. Return nearest neighbors from the bottom layer
This “small world” property, where any vector can reach any other through few hops, enables efficient search without checking every vector.

Disk-backed storage with LMDB

Following the DiskANN philosophy, Hannoy stores the graph structure in LMDB rather than in RAM:
  • Disk-backed: Handle datasets larger than available RAM
  • Memory-mapped: OS manages caching automatically
  • Concurrent reads: Multiple search threads simultaneously
  • ~200 bytes overhead per vector for graph edges
This is the key advantage over in-memory-only solutions. Your dataset size is limited by disk space, not RAM.

Incremental updates

Unlike tree-based approaches requiring rebalancing, Hannoy handles updates efficiently: Insertions:
  • New vectors added to an in-memory temporary index
  • When threshold reached, merges with disk index using streaming operations
  • Only ~1% of vectors need re-indexing during merge
Deletions:
  • Uses DiskANN-style deletion policy
  • Patches neighboring links to maintain graph connectivity
  • No tombstones or graph gaps

Quantization support

Binary quantization reduces storage and improves speed for high-dimensional embeddings: Quantized vectors use Hamming distance for extremely fast comparisons.

Distance metrics

Hannoy integrates with Meilisearch’s filtering using RoaringBitmaps:
The filter is evaluated first, then HNSW search operates only on matching documents.

Multiple embedders

Configure different embedders for different use cases:
Each embedder maintains its own HNSW graph.

Configuration

Memory prefetching: Reduce cold-start latency by preloading graph structure:
This can reduce initial search latency by several milliseconds.

Next steps