> Explore Qdrant's agent skills catalog at https://skills.qdrant.tech/
> Search the documentation at https://search.qdrant.tech/md/documentation?q=your+query+here
> Use this file for an index of the main pages: https://qdrant.tech/llms.txt

# PiPNN: Build Your Qdrant Index Up to 8x Faster

By Clelia Bertelli, November 27, 2026

## TL;DR

PiPNN is a new way to build the HNSW graph in Qdrant, available in v1.20.1 behind a feature flag. On three datasets of about 1M vectors it builds the graph **5 to 8 times faster** than the default builder, reaches **equal or slightly higher recall@10** (by 0.3 to 0.7 percentage points), and serves queries at **the same speed or slightly faster** at matched recall.

![PiPNN in three steps: points split into two overlapping groups, all pairs compared inside a group, and the best edges kept to form one graph.](/blog/pipnn-faster-index-builds/overview.png)

*PiPNN in three steps: split the points into overlapping groups, compare all pairs inside each group, and keep only the best edges of each point, which joins the groups through the points they share (in red). Positions are illustrative.*


## Why Index Build Time Matters

Swapping an embedding model, changing a vector datatype, or adding a new vector field all mean building a fresh HNSW index, and on a large collection that rebuild can keep your next experiment waiting for hours. The effect is easy to see at the top end: a full HNSW build of a 1 billion vector dataset takes about 2.5 to 3 hours even on a machine with 288 vCPUs and 2.2 TB of RAM, while most real workloads run on far smaller machines. A faster builder shortens every one of those experiments.

PiPNN, short for Pick-in-Partitions Nearest Neighbors and based on a [2026 paper by Rubel et al.](https://arxiv.org/pdf/2602.21247), is the answer we decided to adopt to that bottleneck: it produces the same kind of graph as HNSW, so everything on the search side stays as it is, and only the way the graph gets built changes.

## What Changes Under the Hood

HNSW builds its graph by inserting points one at a time and searching the partially built graph for each new point's neighbors, which makes the build slow and heavily dependent on memory bandwidth. PiPNN instead splits the dataset into many small overlapping groups, compares every point with the other points in its group using fast matrix operations, and then prunes the resulting candidate edges into the final graph. Comparing small groups all at once keeps the CPU busy with arithmetic instead of waiting on memory, which is why the build gets so much faster on modern hardware.

## The Results

We built the same segment twice in Qdrant, once with the default HNSW builder and once with PiPNN, on three datasets of about 1M vectors, using `m = 16`, `ef_construct = 100`, and the default `ef = 100` at search time. The chart shows the build time on two machines, a Ryzen 5 9600X and an older Ryzen 9 5900XT, and the toggle switches between them.

**Index build time**
about 1M vectors per dataset, lower is better

| dataset | builder | build_s_9600x | build_s_5900xt | recall_at_10_9600x_5900xt |
| --- | --- | --- | --- | --- |
| glove-100 | HNSW | 38.4 | 63.3 | 80.51% / 80.90% |
| glove-100 | PiPNN | 6.9 | 9.9 | 81.22% / 81.22% |
| sift-128 | HNSW | 26.5 | 45.9 | 98.56% / 98.58% |
| sift-128 | PiPNN | 5.4 | 7.6 | 99.07% / 99.09% |
| cohere-1M | HNSW | 84.0 | 210.6 | 97.32% / 97.41% |
| cohere-1M | PiPNN | 16.2 | 26.5 | 97.83% / 97.83% |

_Ryzen 5 9600X: On the Ryzen 5 9600X, PiPNN builds the same segment 5.0x to 5.6x faster than HNSW, for example 16.2 s instead of 84.0 s on cohere-wiki-1M._

_Ryzen 9 5900XT: On the older Ryzen 9 5900XT the gap grows to 6.0x to 7.9x, with cohere-wiki-1M dropping from 210.6 s (about 3.5 minutes) to 26.5 s._


Faster builds usually cost search quality, but recall@10 here is higher than the HNSW baseline on every dataset and on both machines, by 0.3 to 0.7 percentage points (for example 97.83% against 97.32% on cohere-wiki-1M on the 9600X), which means you do not trade accuracy for the speedup.

## What About Query Speed?

A PiPNN graph makes a query score between 5% and 17% more vectors than an HNSW graph (for example 2,684 vs 2,291 on glove-100), so we also checked whether that costs latency. For each dataset we swept `ef` on both graphs, sent one query at a time, and compared the server-side latency at the same recall.

**Query latency at matched recall**
dataset @ recall target, server-side, lower is better

| dataset | builder | p50_ms | p95_ms |
| --- | --- | --- | --- |
| glove @ 0.90 | HNSW | 0.846 | 1.221 |
| glove @ 0.90 | PiPNN | 0.724 | 1.025 |
| sift @ 0.99 | HNSW | 0.527 | 0.693 |
| sift @ 0.99 | PiPNN | 0.421 | 0.547 |
| cohere @ 0.99 | HNSW | 1.053 | 1.546 |
| cohere @ 0.99 | PiPNN | 0.933 | 1.339 |

_Median (p50): Median latency at matched recall: PiPNN's graph answers 13% to 25% faster than HNSW's in these three cases, for example 0.421 ms against 0.527 ms on sift-128 at 0.99 recall._

_p95: 95th percentile latency at matched recall: PiPNN's graph answers 15% to 27% faster than HNSW's in these three cases, for example 0.547 ms against 0.693 ms on sift-128 at 0.99 recall._


Across every recall target we tested, PiPNN's graph answers between 1% slower and 28% faster than HNSW's, so despite scanning more vectors the query speed is on par with HNSW or slightly better.

## Who Benefits Most

PiPNN is designed for the case where index builds are your bottleneck: tens, hundreds, or thousands of millions of vectors, and workflows where you regularly re-embed, change a datatype, or add a vector field. It also helps at 100K to 1M vectors, as the numbers above show, although the absolute time saved is smaller there. 

For now it works for dense vectors with Cosine, Dot, or Euclid distance (optionally with scalar, binary, or TurboQuant quantization) and for from-scratch builds, and Qdrant falls back to HNSW for sparse vectors, multivectors, Manhattan distance, and product quantization.

## Try It

PiPNN is available from Qdrant v1.20.1 and is currently behind a feature flag, with no collection setting:

```yaml
feature_flags:
  pipnn_graph_building: true
```

You can also set `QDRANT__FEATURE_FLAGS__PIPNN_GRAPH_BUILDING=true`. Then fill a collection and let the optimizer build a segment of 30,000 points or more. 

To check that the flag took effect, set `log_level: DEBUG`, and the log will tell you when the main graph was built `with PiPNN` or why it was not. The resulting graph is a regular HNSW graph, so searching it works exactly as before.

We are working on a way to choose the indexing method directly from your application, so stay tuned for Qdrant v1.21, and let us know how PiPNN works for your data [on our Discord community](https://discord.gg/qdrant).

## Dive Deeper

For how PiPNN carves the dataset into overlapping groups, scores points inside each group, and prunes the candidate edges back to a graph, together with the full benchmark setup, read our technical deep dive: [Faster Indexing at Scale with PiPNN](https://qdrant.tech/articles/faster-indexing-at-scale-with-pipnn/index.md).

## About the Author

Clelia Bertelli

Clelia is a DevRel Engineer at Qdrant and previously worked as Open Source Engineer at LlamaIndex. Passionate about all things OSS, she's currently focusing on AI search performance and infrastructure. In her free time, she likes coding in python, go or rust, hiking and watching TV series.

[LinkedIn](https://www.linkedin.com/in/clelia-astra-bertelli-583904297/) | [X](https://x.com/itsclelia)
