Click canvas to set query point
Graph edges (per layer)
Query / greedy path
HNSW top-k result
Brute-force scan (all points)
Every production RAG pipeline leans on an approximate nearest-neighbor index so retrieval stays fast as the knowledge base grows into the millions of chunks. This 2D build implements a real Hierarchical Navigable Small World graph — the same algorithm inside FAISS, Pinecone and Weaviate, and the same construction and search code as this simulator's 3D counterpart — over a synthetic 2D embedding space, laid out as separate horizontal layers so the sparse top layer and dense bottom layer are directly visible. Click anywhere to drop a query point and watch the greedy search descend layer by layer, then compare its actual measured distance-computation count against a real brute-force linear scan of every point, live, for every query you run.