[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"glossary-hnsw::en":3,"gloss-cluster-hnsw::en":26,"gloss-next-hnsw::en":9},{"slug":4,"category":5,"name":6,"definition":7,"meta_desc":8,"faq":9,"schema_markup":9,"related":10},"hnsw","data-infra","HNSW (Hierarchical Navigable Small World)","HNSW is the most widely used algorithm for approximate nearest-neighbor search — the core operation behind vector databases and semantic search. Given a query embedding, it finds the closest vectors among millions without scanning all of them. It builds a multi-layer graph where each vector links to its neighbors; search starts at a sparse top layer for coarse navigation and descends into denser layers to refine, giving near-logarithmic search time.\n\nWhy it matters for SaaS builders: HNSW is what makes RAG and semantic search feel instant at scale. It's the default index in Pinecone, Weaviate, Qdrant, Milvus, and pgvector.\n\nThe trade-offs live in two build parameters. M (links per node) and ef_construction control index quality; ef_search controls the accuracy\u002Fspeed trade-off at query time — higher values find more true neighbors but cost latency. Practical note: HNSW is memory-hungry because the graph lives in RAM, and deletes are handled as soft tombstones, so heavy churn eventually needs a rebuild. Tune ef_search against a labeled recall test rather than guessing.","HNSW is the most widely used approximate nearest-neighbour algorithm: a multi-layer graph that finds the closest vectors among millions without scanning them all.",null,[11,14,17,20,23],{"slug":12,"name":13},"ann-search","ANN Search",{"slug":15,"name":16},"cosine-similarity","Cosine Similarity",{"slug":18,"name":19},"embedding-index","Embedding Index",{"slug":21,"name":22},"semantic-search","Semantic Search",{"slug":24,"name":25},"vector-database","Vector Database",[27,31,32,35,38,42,45,48,51,54,58,61],{"slug":28,"category":5,"name":29,"updated_at":30},"acid","ACID","2026-08-24T02:46:37+00:00",{"slug":12,"category":5,"name":13,"updated_at":30},{"slug":33,"category":5,"name":34,"updated_at":30},"backpressure","Backpressure",{"slug":36,"category":5,"name":37,"updated_at":30},"batch-processing","Batch Processing",{"slug":39,"category":5,"name":40,"updated_at":41},"bm25","BM25","2026-08-24T02:46:38+00:00",{"slug":43,"category":5,"name":44,"updated_at":30},"cache","Cache",{"slug":46,"category":5,"name":47,"updated_at":30},"cap-theorem","CAP Theorem",{"slug":49,"category":5,"name":50,"updated_at":30},"change-data-capture","Change Data Capture (CDC)",{"slug":52,"category":5,"name":53,"updated_at":30},"chroma","Chroma",{"slug":55,"category":5,"name":56,"updated_at":57},"chunk-overlap","Chunk Overlap","2026-08-24T03:30:02+00:00",{"slug":59,"category":5,"name":60,"updated_at":30},"columnar-storage","Columnar Storage",{"slug":62,"category":5,"name":63,"updated_at":30},"connection-pooling","Connection Pooling"]