← All examples · Home

18. HNSW graph index (M7)

An HNSW graph links each vector to its near neighbors across layered "express lanes"; a query greedily descends the layers and beam-searches the bottom one, visiting O(log N) nodes instead of scanning all N. Unlike IVF there is no rebuild on append — inserts extend the graph incrementally — and it runs on the CPU in a Web Worker, so it works with or without WebGPU and on any metric. Tune efSearch to trade recall for speed.

ready.