Embeddings and search concept
What is a vector database?
ReferenceWhat is a vector database? It is a database system that stores vectors—lists of numbers representing items—and retrieves items by comparing their vectors with a query vector. The comparison uses a distance or similarity measure to find nearby matches. Vector databases are used for similarity search, including searches where relevant items may use different words, and can be one part of a larger search or AI system.
Reviewed 2026-10-09
What it is
A vector is a list of numbers. An embedding is a vector used to represent an item, such as text, so a system can compare it with other represented items. A vector database stores vectors and provides searches that find nearby ones. The chosen distance or similarity measure determines how the system compares two vectors; closeness is a result of that calculation, not a judgment that an item is useful or true.
The name covers more than one kind of product. Some systems focus on vector search; other databases can add vector storage and search to their existing capabilities. For example, pgvector is a PostgreSQL extension that supports vector similarity search. So, “vector database” can describe either a purpose-built system or a database that provides vector search alongside other database features.
How it works
To search, a system represents the query as a vector and compares it with vectors already stored in the database. An embedding model can produce these representations. The database uses a distance measure—such as L2 distance or cosine distance—to rank nearby items. What counts as close depends on the vectors and the measure used, so the ranking reflects that setup.
A system can compare a query with every stored vector, or use an approximate nearest-neighbor index to search more quickly. In pgvector, for example, an approximate index trades some recall for speed and can return different results from an exact search. Systems may also apply filters to fields such as category. Those filters and index choices affect which records are eligible and which matches are returned.
Where it fits beside other search
A general-purpose database can support structured queries over fields and, in some cases, full-text search. PostgreSQL, for example, has text-search types for documents and queries, while pgvector adds vector similarity search to PostgreSQL. That makes “vector database versus regular database” an imperfect dividing line: some general-purpose databases can do both, and the relevant distinction is which search and data features a system provides.
Vector search compares representations; keyword search matches terms in text. Vector search can find related items even when their wording differs, if the representations capture that relationship. Keyword search is useful when particular words matter. A search system can combine vector and keyword methods, and may rerank the resulting candidates. These are retrieval choices to assess against the collection and the queries people actually use.
Common confusions
A vector database is not an embedding model. An embedding model produces a vector representation; a vector database stores vectors and searches among them. Nor does a similarity score establish that a result answers the question: it shows how the vectors compare under the chosen measure. A nearby result may still be a poor match for a reader’s purpose.
In retrieval-augmented generation (RAG), a vector database may help retrieve material, but retrieval is only one part of the system. The retrieved material may be irrelevant or incomplete; a generated answer may not faithfully use it or may be factually wrong; citations may not support the claims; and access permissions may not be enforced. RAG reduces some risks but does not guarantee a correct answer. Each of these failure points needs separate attention.
Questions people ask
Is a vector database different from a regular database?
It is a database system with vector storage and similarity search. Some general-purpose databases add those capabilities, so the difference depends on the system’s features.
Does a vector database create embeddings?
An embedding model can create the vectors. The database stores vectors and provides search over them; some systems may offer additional ways to create or manage embeddings.
What is approximate nearest-neighbor search?
It uses an index to find likely nearby vectors more quickly. In pgvector, approximate search trades some recall for speed and can return different results from exact search.
Does RAG make answers correct?
No. Retrieval quality, whether the answer uses retrieved material faithfully, factual correctness, citation support, and access permissions are separate concerns.
Learn more
- pgvector
See a PostgreSQL extension’s vector storage, distance measures, and exact and approximate nearest-neighbor search.
- Vector embeddings
Read how embeddings represent text as vectors and how distance relates to relatedness.
What changed
Sources
Part of Embeddings and search: Representations and retrieval methodsChoose a method for your collection