[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"glossary-ann-search::en":3,"gloss-cluster-ann-search::en":20,"gloss-next-ann-search::en":9},{"slug":4,"category":5,"name":6,"definition":7,"meta_desc":8,"faq":9,"schema_markup":9,"related":10},"ann-search","data-infra","ANN Search","Approximate Nearest Neighbor (ANN) search is the algorithmic approach nearly all production vector databases use to answer \"which stored vectors are most similar to this query vector?\" quickly, by deliberately accepting a small, tunable chance of missing the mathematically exact best matches in exchange for orders-of-magnitude faster search. The alternative — exact nearest neighbor (kNN) search via brute-force comparison — guarantees perfect results but scales linearly with dataset size, meaning a search over 10 million vectors takes roughly 10× longer than one over 1 million. ANN algorithms break that linear relationship. Why it matters for AI\u002FSaaS builders: ANN search is the reason RAG and semantic search products can return results in tens of milliseconds instead of seconds, which is the difference between a usable chat interface and one that feels broken. Every major vector database — Pinecone, Weaviate, Qdrant, Milvus, pgvector, Chroma — is, at its core, an ANN search engine with a data-management layer wrapped around it. How it works: the two dominant ANN families are graph-based (HNSW, used by most modern systems) and cluster-based (IVF variants, used by pgvector's IVFFlat and Meta's FAISS). Both work by narrowing the search space before comparing vectors directly — HNSW navigates a pre-built proximity graph, IVF narrows to the nearest cluster centroids first. The quality of an ANN system is measured by recall@k (what fraction of the true top-k nearest neighbors were actually returned) versus queries-per-second, and every ANN index exposes tuning knobs to move along that curve: search more candidates for better recall at the cost of latency, or fewer for speed. Most production systems target 95%+ recall, which in practice is indistinguishable from exact search for retrieval-augmented generation, since the LLM is fault-tolerant to occasionally getting the 6th-best passage instead of the 5th-best. Worked example: a fintech SaaS building fraud-similarity detection compares each new transaction's embedding against 50 million historical transaction embeddings. Exact kNN would take ~4 seconds per lookup — far too slow for a real-time approval flow. Deploying an HNSW-backed ANN index cuts that to ~15ms per query at 97% recall, letting the fraud check run inline during checkout without adding perceptible latency for legitimate customers. Crucially, the 3% of true nearest neighbors the ANN index occasionally misses turns out not to matter for the product outcome — the system flags a transaction as suspicious based on aggregate similarity signals from the top 20 matches, not any single exact match, so the small accuracy trade-off is invisible at the business-logic layer while the latency win is what makes real-time fraud scoring possible at all.","Approximate Nearest Neighbor (ANN) search finds vectors \"close enough\" to a query fast, trading a small accuracy loss for massive speed gains at scale.",null,[11,14,17],{"slug":12,"name":13},"cosine-similarity","Cosine Similarity",{"slug":15,"name":16},"embedding-index","Embedding Index",{"slug":18,"name":19},"vector-store","Vector Store",[21,25,28,31,35,38,41,44,47,51,54,57],{"slug":22,"category":5,"name":23,"updated_at":24},"acid","ACID","2026-08-24T02:46:37+00:00",{"slug":26,"category":5,"name":27,"updated_at":24},"backpressure","Backpressure",{"slug":29,"category":5,"name":30,"updated_at":24},"batch-processing","Batch Processing",{"slug":32,"category":5,"name":33,"updated_at":34},"bm25","BM25","2026-08-24T02:46:38+00:00",{"slug":36,"category":5,"name":37,"updated_at":24},"cache","Cache",{"slug":39,"category":5,"name":40,"updated_at":24},"cap-theorem","CAP Theorem",{"slug":42,"category":5,"name":43,"updated_at":24},"change-data-capture","Change Data Capture (CDC)",{"slug":45,"category":5,"name":46,"updated_at":24},"chroma","Chroma",{"slug":48,"category":5,"name":49,"updated_at":50},"chunk-overlap","Chunk Overlap","2026-08-24T03:30:02+00:00",{"slug":52,"category":5,"name":53,"updated_at":24},"columnar-storage","Columnar Storage",{"slug":55,"category":5,"name":56,"updated_at":24},"connection-pooling","Connection Pooling",{"slug":12,"category":5,"name":13,"updated_at":24}]