Question:

What is a vector database?

A vector database is a database designed to store and search embeddings. Where a regular database searches for exact matches, a vector database searches for similarity.

When you store data in a regular database, you query it by value: find the row where the ID equals 42, or where the name equals “Alice”. That works well for structured data, but it breaks down when you want to search by meaning. A vector database works differently. You store embeddings, and when you query it, you provide another embedding and ask for the closest matches. The database returns results that are semantically similar, not just textually identical.

This makes vector databases the backbone of RAG systems. When a user asks a question, the system converts it to an embedding, searches the vector database for the most relevant document chunks, and passes those chunks to the AI as context. The AI can then answer based on your actual data.

Some of the most widely used vector databases are Pinecone, Weaviate, and Chroma. PostgreSQL can also handle vector search through the pgvector extension, which is a popular choice if you already have Postgres and don’t want to add another service.

My experience with vector databases comes from building a RAG proof of concept at my current company. We used one to store embeddings of our internal data model examples so the AI could quickly find the most relevant ones at query time. It’s one of those technologies that sounds complicated but clicks once you see it in action.

You might also like