What is Vector database?

Also called vector store, vector search, embedding database, pgvector.

AI and LLMs. Reviewed 21 October 2026.

Definition

A vector database stores embeddings, lists of numbers that represent the meaning of text or images, and finds the entries closest to a query. It powers semantic search and the retrieval step of RAG, either as a dedicated service or as an extension to Postgres.

How vector search works

An embedding model turns a passage into a vector, typically several hundred to a few thousand numbers. Passages with similar meaning land close together, so "cancel my plan" sits near "how do I end my subscription" even with no words in common. A vector database stores those vectors and answers one question quickly: which stored items are nearest to this one, by cosine distance or a similar measure.

Comparing a query against every row gives exact results and is fine for thousands of rows. Beyond that, an approximate index does the work. pgvector, the common Postgres extension, offers HNSW, a layered graph with a better speed-to-recall tradeoff at the cost of memory and build time, and IVFFlat, which builds faster and uses less memory but searches less well.

When you need a separate one

For most products, you do not. If the app already runs on Postgres, pgvector keeps embeddings in the same database as the records they describe. That means one backup, one permission model, and the ability to filter by account, date or document type in the same SQL query as the similarity search. Supabase's documentation puts it bluntly: the best vector database is the database you already have.

A dedicated vector service starts to make sense at very large scale, with heavy query volume across hundreds of millions of vectors, or when a team wants managed features it would rather not run itself. Those are real needs. They are rarely day-one needs for an MVP.

The pitfall: approximate means approximate

Adding an HNSW or IVFFlat index switches pgvector from exact to approximate search, and its documentation is clear that results can then differ. Usually that is fine. It bites when a vector search is combined with a strict filter, such as one customer's documents out of thousands. pgvector applies the filter after scanning the index, so the query can return far fewer rows than you asked for. Recent versions offer iterative index scans to compensate, but you have to turn them on.

Test retrieval with your real filters and realistic volumes, not a demo table. And record which embedding model produced each vector. Changing models means re-embedding the whole corpus, because vectors from different models cannot be compared.

What it does to a quote

A vector store is a component of the $1,150 AI build or the $490 chatbot, not a separate purchase. The default is pgvector in the Postgres you already run, which adds no new vendor bill. If scale or a compliance rule calls for a dedicated vector service, the written quote names it, with its running cost, before work starts.

Questions

Do we need a vector database for a chatbot?

Only if the bot retrieves from a corpus too large to put in the prompt. A small help center can often skip retrieval entirely. When search is needed, a vector column in the Postgres database you already have is usually enough to start.

What happens when we switch embedding models?

Every stored vector must be regenerated with the new model, because vectors from different models live in different spaces. Budget for a re-embedding run and keep the source text alongside the vectors, so switching is a batch job rather than a migration project.

Sources

  1. pgvector: open-source vector similarity search for Postgres, pgvector (GitHub)
  2. AI & Vectors, Supabase Docs

From $490 USDWritten quote in 48 hours