IT lexicon › Database › Vector index

Vector index

Database På svenska → Updated: 2026-07-30

An index for fast similarity search among high-dimensional vectors (embeddings) — "find the 10 nearest neighbors". The foundation for semantic search, recommendations, and RAG in AI systems. Since exact search is too slow, approximate methods (ANN) are used.

Problem: with millions of 1536-dimensional embeddings, an exact nearest-neighbor search (comparing against all) is untenable. ANN indexes (Approximate Nearest Neighbor) trade a bit of accuracy for enormous speed. Two main families: graph-based (HNSW — fast, memory-hungry) and cluster-based (IVF/IVFFlat — less memory, a bit slower). Distance metrics: cosine, L2, inner product. Use case: semantic search, "similar products", RAG pipelines that fetch relevant context for an LLM. Implemented in pgvector (Postgres), specialized vector databases (Pinecone, Milvus, Qdrant, Weaviate), and libraries (FAISS). One of the fastest-growing database categories due to the AI boom.

← Back to the lexicon