Vector Search
Finding the most similar items in a database by comparing their vector (embedding) representations using distance metrics like cosine similarity.
How It Works
Data (text, images, etc.) is converted to embedding vectors and indexed in a vector database. At query time, the search query is also embedded, and the database returns the nearest vectors using approximate nearest neighbor (ANN) algorithms.
ANN Algorithms
HNSW (Hierarchical Navigable Small World): The most popular algorithm, offering excellent speed-accuracy tradeoff. IVF (Inverted File Index): Clusters vectors for faster search. Product Quantization: Compresses vectors to reduce memory.
Vector Databases
Pinecone, Weaviate, Qdrant, Milvus, Chroma (lightweight), and pgvector (PostgreSQL extension). These provide optimized storage, indexing, and querying of high-dimensional vectors at scale.