NEW
Also known as: ANN Search
Algorithms that efficiently retrieve near neighbors in high-dimensional spaces by trading exactness for speed and memory efficiency.
DESCRIPTION
Approximate nearest neighbor (ANN) methods enable scalable similarity search over high-dimensional vectors, common in retrieval, recommendation, and semantic search. Techniques include graph-based indexes (HNSW), inverted files with product quantization (IVF-PQ), and tree-based or hashing approaches. ANN sacrifices exact recall to achieve significant latency and memory gains. Libraries and systems like FAISS, Annoy, ScaNN, and modern vector databases operationalize ANN at scale. Proper index choice, distance metrics, and recall–latency trade-offs are critical for production.
ALTERNATIVE DEFINITIONS
Wikipedia
Approximate nearest neighbor (ANN) search aims to return points that are close to the query point, but not necessarily the closest, allowing faster search in high dimensions.
Highlights the speed–accuracy trade-off central to ANN.
FAISS
Faiss is a library for efficient similarity search and clustering of dense vectors.
Vendor-neutral phrasing adopted widely in ANN contexts.
Milvus
Milvus is an open-source vector database that provides scalable approximate nearest neighbor search for AI applications.
Emphasizes database-level scalability for ANN.
RELATED TERMS
Vector Database FAISS HNSW Annoy ScaNN IVF-PQ Cosine Similarity Embeddings KD-Tree Semantic Search
COMPETING TERMS
Exact Nearest Neighbor Search
RELATIONS
- Broader: Search
KNOWLEDGE AREAS
AI Data Engineering Data Services Real-time & Streaming Data Data Storage & Operations
TARGET AUDIENCE
AI Engineer Data Engineer Software Developer MLOps Engineer Data Architect
EXTERNAL SOURCES
- Wikipedia - Nearest neighbor search
- FAISS - Library for vector similarity search
- Spotify Annoy - Annoy ANN index library
- Google Research ScaNN - ScaNN ANN search library
- Milvus - Vector database ANN documentation
TOP QUESTIONS
Why use approximate nearest neighbor search?
ANN dramatically reduces latency and memory in high-dimensional search, enabling real-time retrieval at web scale.
Category: Relevancy
What are popular ANN index structures?
HNSW (graph-based), IVF-PQ (quantization), Annoy (trees), and ScaNN (optimized hybrids) are widely used.
Category: Overview
How do you measure ANN quality?
Recall@k and latency are common metrics; production deployments balance recall with throughput and cost.
Category: Validation
Which distance metrics are typical for ANN?
Cosine similarity, inner product, and Euclidean distance are most common, depending on embedding training.
Category: Requirements
What is IVF-PQ?
Inverted file with product quantization partitions the space and compresses vectors, accelerating search with limited memory.
Category: Definition
When is ANN inappropriate?
If exact matches are mandatory or the dataset is tiny, exact search may suffice and simplify operations.
Category: Risk
How do vector databases use ANN?
They integrate ANN indexes with storage, filtering, and APIs to support scalable semantic retrieval.
Category: Application
How does dimensionality affect ANN?
Higher dimensions exacerbate the curse of dimensionality, making specialized indexes and quantization essential.
Category: Concept
What are hot topics in ANN?
Hybrid dense–sparse retrieval, GPU-accelerated search, and adaptive indexes for dynamic data are active areas.
Category: Topic