Glossary

Vector Database

A vector database stores embeddings and finds the closest matches in milliseconds. Learn how vector search works and why AI apps and RAG depend on it.

A vector database is a system built to store embeddings, the numerical fingerprints of meaning, and to find the ones most similar to a query very quickly. Instead of matching exact words or values, it answers the question "what in here is closest in meaning to this?"

That makes it a core piece of many AI apps, especially chatbots that answer questions using a company's own documents.

Key takeaways

  • Ordinary databases look up exact matches. Vector databases look up nearest neighbors.
  • They use shortcuts called approximate search indexes to scan millions of vectors in milliseconds.
  • They come as dedicated products (such as Pinecone, Weaviate, Milvus and Qdrant) and as add-ons to existing databases (such as pgvector for PostgreSQL).

How does a vector database work?

The basic flow has three steps:

  1. Store. Each item, whether a paragraph, a product or an image, is converted into an embedding and saved along with an ID and some extra details, such as the date or the author.
  2. Index. The database organizes the vectors so it does not have to compare a query with every single one. Popular index types group similar vectors together or link them in a layered graph, so a search can jump quickly toward the right neighbourhood.
  3. Query. A new question is embedded the same way. The database returns the stored vectors that sit closest to it, often filtered by those extra details ("only documents from 2026").

The search is "approximate" because it trades a tiny bit of accuracy for a big gain in speed. For most apps, finding 98 of the true top 100 matches in a few milliseconds beats finding all 100 in several seconds.

An example

A bank wants an internal assistant that answers staff questions about its policies. It splits 5,000 policy pages into short chunks, embeds each one and loads them into a vector database. When an employee asks, "What's the limit for same-day international transfers?", the database finds the five most relevant chunks. The chatbot reads only those and writes an answer, citing the source pages. This pattern is retrieval-augmented generation, and it helps reduce hallucinations because the model works from real text.

Why do vector databases show up in the news?

They rose fast alongside generative AI, and several vendors raised large funding rounds. The current debate is whether companies need a separate vector product at all. General databases such as PostgreSQL and MongoDB have added vector search, and many teams now start there. Dedicated databases argue they still win on very large scale and speed. Ever-larger context windows also raise the question of how much retrieval apps will need, though cost keeps retrieval attractive.

Why It Matters

Anyone planning an AI assistant built on company documents should know that answer quality depends heavily on this layer. The chatbot can only work from the chunks retrieval hands it, so poor search means poor answers, however good the model is. For most teams, the sensible starting point is a database they already run, such as PostgreSQL with pgvector, moving to a dedicated product only when size or speed demands it. Be skeptical of any pitch that treats a separate system as mandatory from day one.

Frequently asked questions

Do I need a vector database to build a RAG chatbot?

Not always. For small collections, a simple library or a vector extension in a database you already use is often enough. Dedicated vector databases make more sense when you have millions of documents or need very fast, filtered search.

Is a vector database the same as a search engine?

They overlap. Traditional search engines match keywords, while vector databases match meaning. Many modern systems combine both, which is called hybrid search, to catch exact terms like product codes and looser, meaning-based matches.

Researched and written by The AI Telegraph staff and checked against primary sources. See our editorial policy. Spotted an error? Tell us.