What a vector database is
A vector database stores embeddings, the lists of numbers that represent text, images or audio, and returns the stored items closest to a query. Wikipedia (retrieved 5 December 2026) gives three names for it: “A vector database, vector store or vector search engine is a database that stores and retrieves embeddings of data in vector space.” Google Cloud describes the job in three verbs: “A vector database is any database that allows you to store, index, and query vector embeddings, or numerical representations of unstructured data, such as text, images, or audio.”
Vendors add their own features to the definition. Pinecone, which sells a vector database, writes: “A vector database indexes and stores vector embeddings for fast retrieval and similarity search, with capabilities like CRUD operations, metadata filtering, horizontal scaling, and serverless.” OpenAI uses the term vector store for the hosted indexes behind its Retrieval API: “The Retrieval API is powered by vector stores, which serve as indices for your data.”
A vector database stores and searches embeddings, and a model creates them. Elastic's documentation lists as the first prerequisite for a kNN search: “Your data must be vectorized.” It offers several routes, among them semantic_text, which has Elastic generate the embeddings automatically, and vectors generated outside the deployment. What an embedding is and how distance between two of them is measured is covered in the entry on embeddings.
From similarity search to vector databases
The methods used in vector databases are described in research on nearest neighbour search. The table lists seven papers in order of their first arXiv version.
| Date and paper | What it describes |
|---|---|
| 30 Mar 2016, Malkov and Yashunin (HNSW) | Approximate nearest neighbour search on layered proximity graphs |
| 28 Feb 2017, Johnson, Douze and Jégou | Similarity search on GPUs, including compressed search with product quantization |
| 15 Jul 2018, Aumüller et al. (ANN-Benchmarks) | A common tool for comparing approximate nearest neighbour algorithms |
| 27 Aug 2019, Guo et al. | Quantization for inner product search over large databases |
| 22 May 2020, Lewis et al. (RAG) | A language model that retrieves passages from a vector index of Wikipedia |
| 20 May 2021, Singh et al. (FreshDiskANN) | Graph indexes that accept updates without a full rebuild |
| 16 Jan 2024, Douze et al. (The Faiss library) | The design of Faiss, a library for vector similarity search |
Dates of the first arXiv versions, retrieved 5 December 2026.
The 2017 paper opens with the problem itself: “Similarity search finds application in specialized database systems handling complex data such as images or videos, which are typically represented by high-dimensional features and require specific indexing structures.” The 2020 RAG paper used such an index as the memory of a language model, “a dense vector index of Wikipedia, accessed with a pre-trained neural retriever”. By 2024 the Faiss authors could start their abstract with the term: “Vector databases typically manage large collections of embedding vectors.”
How a vector database works
IBM Think (retrieved 5 December 2026) writes that “vector databases rely on three core functions”: storing, indexing and searching.
Storing. Each item is a vector. IBM: “Each has a fixed number of dimensions and is typically stored alongside metadata such as title, source, timestamp or category, which can be queried through metadata filters.” Because the vectors are computed once, at write time, IBM notes that “vector databases can retrieve similar vector embeddings without recomputing representations at query time.”
Indexing. An index arranges the vectors so that a query does not have to compare itself with every stored item. The next section describes the main kinds.
Searching. The query is turned into a vector and compared with the stored ones. Elastic's documentation describes the operation: “A k-nearest neighbor (kNN) search finds the k nearest vectors to a query vector using a similarity metric such as cosine or L2 norm.” It sets one condition: “Query vectors must have the same dimension and be created with the same model as the document vectors.”
This operation is what vector search means in practice. In Elastic's words: “In Elasticsearch, kNN is the primary way to query dense_vector fields after you store embeddings.” How vector search relates to semantic search, the goal of matching meaning, is explained in the entry on semantic search.
Two paths, one model
Data
text, images or audio
Model
creates the embeddings; the same one for stored items and queries
Vector + metadata
e.g. title, source, category
Index
arranged so a query need not check every item
Query
Query vector
Nearest matches
returned with their metadata
Exact and approximate search
The simplest search compares the query with every stored vector. Elastic writes about this exact search: “It scores every matching document, which guarantees accurate results but does not scale well for large datasets.” The pgvector extension for Postgres starts here: “By default, pgvector performs exact nearest neighbor search, which provides perfect recall.” In this entry, recall means the share of the true nearest neighbours that a search returns.
Approximate nearest neighbour (ANN) search gives up some recall for speed. The pgvector README puts it in one sentence: “You can add an index to use approximate nearest neighbor search, which trades some recall for speed.” It also warns: “Unlike typical indexes, you will see different results for queries after adding an approximate index.” The Wikipedia article on nearest neighbour search gives the reason the trade is often accepted: “in many cases, an approximate nearest neighbor is almost as good as the exact one”, provided that “the distance measure accurately captures the notion of user quality”.
| Method | How it works |
|---|---|
| Exact (flat) | Compares the query with every vector. Full recall, but the work grows with the data |
| HNSW | Layered graph search. In pgvector faster than IVFFlat at the same recall, but slower to build and larger in memory |
| IVF (IVFFlat in pgvector) | Splits the vectors into lists and searches only the lists closest to the query |
| Quantization | Stores compressed vectors and searches in the compressed form |
| LSH | Maps vectors that are close to each other into the same bucket with high probability |
Sources: Elastic and pgvector documentation (exact search, HNSW, IVF); Malkov and Yashunin, 2016 (HNSW); Johnson, Douze and Jégou, 2017, and Guo et al., 2019 (quantization); Wikipedia, “Nearest neighbor search” (LSH). Retrieved 5 December 2026.
The HNSW paper describes a “multi-layer structure consisting from hierarchical set of proximity graphs (layers) for nested subsets of the stored elements”, and its abstract claims “a logarithmic complexity scaling”. The pgvector README says about the two index types it offers: “An HNSW index creates a multilayer graph.” and “An IVFFlat index divides vectors into lists, and then searches a subset of those lists that are closest to the query vector.” The 2017 GPU paper proposes designs “for brute-force, approximate and compressed-domain search based on product quantization”. Some systems switch between methods. Weaviate's documentation says: “The dynamic index can even start off as a flat index and then dynamically switch to the HNSW index as it scales past a threshold.”
Filtering and hybrid queries
A query can combine similarity with conditions, for example only documents from one source or one year. Google Cloud writes: “Advanced vector databases combine these SQL predicates with vector similarity to execute powerful, hybrid queries.” Wikipedia lists more combinations: “Vector retrieval can be combined with metadata filtering, lexical or sparse retrieval, graph-based retrieval, and multimodal retrieval to support a range of filtered and hybrid retrieval workflows.”
With an approximate index, the order matters. The pgvector README says: “With approximate indexes, filtering is applied after the index is scanned.” It gives a worked example: if a condition matches 10 percent of the rows, HNSW with its default search setting of 40 candidates returns only 4 matching rows on average. The README offers iterative index scans for cases that need more rows. The numbers are the README's own calculation, not a measurement.
Kinds of systems
Vector search comes in several forms: as a library, as a dedicated database, as an extension of an existing database and as a feature of a search engine. Pinecone describes the difference between an index and a database from its side: “Vector databases have the capabilities of a traditional database that are absent in standalone vector indexes and the specialization of dealing with vector embeddings, which traditional scalar-based databases lack.” The table lists examples in alphabetical order, each with its own description.
| System | Description |
|---|---|
| Chroma (database) | “store embeddings with metadata, search with dense and sparse vectors, filter by metadata, and retrieve across text, images, and more” |
| Elasticsearch (search engine) | kNN search over dense_vector fields |
| Faiss (library) | “dedicated to vector similarity search, a core functionality of vector databases” |
| Milvus (database) | “a vector database for storing embeddings and searching them together with structured metadata” |
| pgvector (Postgres extension) | “Open-source vector similarity search for Postgres” |
| Pinecone (managed database) | Indexing and storage of vector embeddings with metadata filtering and horizontal scaling |
Sources: Chroma, Elastic, Milvus, pgvector and Pinecone documentation; Douze et al., “The Faiss library” (16 January 2024); Wikipedia, “Vector database”, list of implementations (kind of system). Retrieved 5 December 2026. The list is not a ranking.
Azure notes that other databases offer it too: “Many modern relational, NoSQL, and search databases now also offer vector search capabilities.”
Vector database and relational database
IBM describes the strength of the older kind: “Traditional relational databases excel at managing structured and semi-structured datasets within defined schemas.” Wikipedia sets the two side by side: “Vector databases typically implement approximate nearest neighbor algorithms so users can search for records semantically similar to a given input, unlike traditional databases which primarily look up records by exact match.”
| Question | Relational | Vector |
|---|---|---|
| What is stored | Rows in a defined schema | Vectors with metadata |
| How a query matches | Exact values | Nearest vectors |
| Main strength | Transactions, structure | Similarity search |
Sources: IBM Think, Wikipedia and Azure, retrieved 5 December 2026.
The two kinds overlap. Azure writes about relational and other databases that added vector search: “Even so, transactional processing and structured data management remain their primary strengths.” The pgvector README invites the other route: “Store your vectors with the rest of your data.”
What vector databases are used for
Wikipedia lists the uses: “Use-cases for vector databases include similarity search, semantic search, multi-modal search, recommendations engines, object detection, and retrieval-augmented generation (RAG).” For the last of these, the same encyclopedia states: “The retrieval component of a RAG can be any search system, but is most often implemented as a vector database.” How retrieval and the language model work together is explained in the entry on retrieval-augmented generation. Splitting documents into passages before they are embedded is described in the entry on content chunking.
Limits
Different results. An approximate index can miss true neighbours, and pgvector warns that results change once such an index is added. A filter applied after the index scan can return fewer rows than requested, as the example above shows.
Updates. Aditi Singh and co-authors wrote in their FreshDiskANN paper of 20 May 2021 that “existing graph algorithms for ANNS support only static indices that cannot reflect real-time changes to the corpus”. They described the practice at the time: “the current industry practice for manifesting updates into such indices is to periodically re-build these indices, which can be prohibitively expensive.”
Build time and memory. For HNSW, the pgvector README names the cost of its speed: it “has slower build times and uses more memory” than IVFFlat.
High dimensions. The Wikipedia article on nearest neighbour search states that “there is no general-purpose exact solution for NNS in high-dimensional Euclidean space using polynomial preprocessing and polylogarithmic search time”.
Changing the model. Elastic requires query vectors created with the same model as the stored vectors. Qdrant's documentation spells out the consequence: “Switching models requires re-embedding all vectors in your collection, which can take time.”
Source
- Wikipedia, “Vector database”. Source for the names, uses, hybrid retrieval and the comparison with traditional databases (retrieved 2026-12-05): https://en.wikipedia.org/wiki/Vector_database
- Wikipedia, “Nearest neighbor search”. Source for approximate search and high dimensions (retrieved 2026-12-05): https://en.wikipedia.org/wiki/Nearest_neighbor_search
- Google Cloud, “What is a vector database & how does it work?”. Source for the definition and hybrid queries (retrieved 2026-12-05): https://cloud.google.com/discover/what-is-a-vector-database
- IBM Think, “What Is a Vector Database?”. Source for the three core functions, metadata and relational databases (retrieved 2026-12-05): https://www.ibm.com/think/topics/vector-database
- Pinecone, “What is a Vector Database & How Does it Work? Use Cases + Examples”. Source for Pinecone's definition and the difference from standalone indexes (retrieved 2026-12-05): https://www.pinecone.io/learn/vector-database/
- Microsoft Azure, “What is a vector database?”. Source for vector search in other databases and their strengths (retrieved 2026-12-05): https://azure.microsoft.com/en-us/resources/cloud-computing-dictionary/what-is-vector-database
- Elastic Docs, “kNN search in Elasticsearch”. Source for kNN, exact search, vectorized data and the same-model rule (retrieved 2026-12-05): https://www.elastic.co/docs/solutions/search/vector/knn
- pgvector, README. Source for exact search by default, HNSW, IVFFlat and filtering (retrieved 2026-12-05): https://github.com/pgvector/pgvector
- OpenAI API documentation, “Retrieval”. Source for vector stores (retrieved 2026-12-05): https://developers.openai.com/api/docs/guides/retrieval
- Weaviate Documentation, “Vector Indexing”. Source for the dynamic index (retrieved 2026-12-05): https://docs.weaviate.io/weaviate/concepts/vector-index
- Chroma Docs, “Introduction”. Source for Chroma's description (retrieved 2026-12-05): https://docs.trychroma.com/docs/overview/introduction
- Milvus Documentation, “What is Milvus”. Source for Milvus's description (retrieved 2026-12-05): https://milvus.io/docs/overview.md
- Qdrant documentation, “Migrate to a New Embedding Model”. Source for re-embedding after a model switch (retrieved 2026-12-05): https://qdrant.tech/documentation/tutorials-operations/embedding-model-migration/
- Malkov and Yashunin, “Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs” (arXiv 1603.09320, 30 March 2016). Source for HNSW (retrieved 2026-12-05): https://arxiv.org/abs/1603.09320
- Johnson, Douze and Jégou, “Billion-scale similarity search with GPUs” (arXiv 1702.08734, 28 February 2017). Source for similarity search in database systems and product quantization (retrieved 2026-12-05): https://arxiv.org/abs/1702.08734
- Aumüller et al., “ANN-Benchmarks: A Benchmarking Tool for Approximate Nearest Neighbor Algorithms” (arXiv 1807.05614, 15 July 2018). Source for the benchmarking tool (retrieved 2026-12-05): https://arxiv.org/abs/1807.05614
- Guo et al., “Accelerating Large-Scale Inference with Anisotropic Vector Quantization” (arXiv 1908.10396, 27 August 2019). Source for quantization (retrieved 2026-12-05): https://arxiv.org/abs/1908.10396
- Lewis et al., “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks” (arXiv 2005.11401, 22 May 2020). Source for the vector index of Wikipedia (retrieved 2026-12-05): https://arxiv.org/abs/2005.11401
- Singh et al., “FreshDiskANN: A Fast and Accurate Graph-Based ANN Index for Streaming Similarity Search” (arXiv 2105.09613, 20 May 2021). Source for updates to graph indexes (retrieved 2026-12-05): https://arxiv.org/abs/2105.09613
- Douze et al., “The Faiss library” (arXiv 2401.08281, 16 January 2024). Source for Faiss and vector databases (retrieved 2026-12-05): https://arxiv.org/abs/2401.08281
Frequently asked questions
What is a vector database?
A vector database stores embeddings, the numerical representations of text, images or audio, and returns the stored items closest to a query vector. It usually indexes the vectors for approximate nearest neighbour search and keeps metadata for filtering.
Is SQL a vector database?
SQL is a query language, not a database. A relational database can add vector search: pgvector, for example, describes itself as open-source vector similarity search for Postgres. Azure (retrieved 5 December 2026) notes that many relational, NoSQL and search databases now offer vector search.
Is MongoDB a vector database?
Wikipedia's list of vector database implementations, retrieved 5 December 2026, includes MongoDB Atlas, the managed service. The list names Atlas, not every edition of MongoDB.
Do you need a vector database?
Elastic's documentation (retrieved 5 December 2026) says that exact, brute-force kNN search is best for small datasets, pre-filtered subsets, or when precise scoring is needed without approximate indexing. pgvector performs exact nearest neighbour search by default, which provides perfect recall.
Are vector databases obsolete?
Other systems now offer the function too. Azure writes (retrieved 5 December 2026) that many modern relational, NoSQL and search databases now also offer vector search capabilities, alongside dedicated vector databases.
Is a vector store the same as a vector database?
Wikipedia lists vector database, vector store and vector search engine as names for the same kind of system. OpenAI calls the hosted indexes behind its Retrieval API vector stores.