IICTPIICTP

Blog / Guides

Answers1 November 20265 min read

What is a vector database, and when do you need one?

A vector database stores embeddings, which are lists of numbers that represent the meaning of text, images or other data, and finds the ones closest to a query. It is the retrieval layer behind semantic search and many retrieval-augmented generation (RAG) systems.

In this post
  1. What is an embedding?
  2. How does the search work?
  3. Do you always need a dedicated vector database?
  4. What else matters besides the database?
  5. How do permissions work?
  6. How do you judge quality?
  7. Sources and further reading

What is an embedding?

A model turns a piece of content into a vector so that similar meanings sit close together. A search for “refund policy” can then find a passage titled “returns and money back” without sharing any words.

How does the search work?

The query is turned into a vector, and the database returns the nearest stored vectors. For large collections it uses approximate nearest-neighbour indexes, which trade a little recall for much better speed.

Do you always need a dedicated vector database?

Not always. For small or moderate collections, a vector extension in a database you already run can be enough, and it keeps data and permissions in one place. A dedicated system makes sense when scale, latency or filtering needs outgrow that.

What else matters besides the database?

How documents are split into chunks changes what can be found, and metadata filters limit results by owner, date or access rights. Hybrid search combines keyword and vector matching, and content must be re-indexed when it changes.

How do permissions work?

Retrieved text must respect who may see it. Store access rights with each chunk and filter on them at query time, or a user could be shown passages from documents they are not allowed to open.

How do you judge quality?

Build a small set of real questions with known good passages, and measure whether retrieval finds them. See RAG explained for how retrieval fits into a full system.

Sources and further reading

  1. pgvector. github.com/pgvector/pgvector (an example of a vector extension for an existing database).
  2. Lewis et al. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. arXiv:2005.11401.

IICTP is an independent technical credentialing body.

Keep reading

← All posts

Where do you stand?

Find the credential that fits the work you do.