What is a vector database?
A vector database is a database that stores numeric vectors representing content such as text, images or audio and quickly finds the records closest in meaning to a query. It searches by semantic similarity rather than keyword match. The retrieval layer of a RAG-based knowledge assistant is usually a vector database.
Definition
A vector database is a database that stores numeric vectors representing content such as text, images or audio and quickly finds the records closest in meaning to a query.
How does a vector database work?
Each piece of content is turned into an array of hundreds or thousands of numbers by an embedding model. Content with similar meaning ends up with vectors close to each other. When a question arrives, it is embedded too, and the database finds the nearest vectors. Comparing every vector one by one would be slow across millions of records, so approximate nearest neighbour (ANN) indexes such as HNSW are used. Records also carry fields such as date, document type or access rights, which act as filters during search.
When should you use one?
For question answering over company documents with RAG, finding similar support tickets or products, recommendation systems and duplicate detection. Options include pgvector (PostgreSQL and Supabase), Qdrant, Weaviate, Milvus and Pinecone.
What to watch for
Vectors are derived from the original text, so vectors of documents containing personal data should be treated as personal data too, and the text chunks stored alongside them must be protected. You can host the database in an EU region or in a data centre in Türkiye if GDPR or KVKK, Türkiye’s data protection law, calls for it. For non-English content, retrieval quality depends most on the choice of embedding model.
Related terms
- EmbeddingAn embedding is a fixed-length array of numbers (a vector) that represents the meaning of a word, sentence, document or image, so that similar content ends up close together.
- RAG (Retrieval-Augmented Generation)RAG (Retrieval-Augmented Generation) is an AI architecture that lets a language model retrieve relevant passages from a chosen document collection, such as a company's own documents, and use them as context before it writes an answer.
- LLM (Large Language Model)An LLM (large language model) is an AI model trained on very large amounts of text that answers questions, summarises, translates and writes by predicting what text should come next.
Frequently asked questions
Do I need a separate vector database?
Often not. If you already run PostgreSQL, the pgvector extension is enough for many mid-sized projects and keeps data in one place. For very large volumes or specialised filtering, a dedicated option such as Qdrant may be worth it.
Does a vector database replace keyword search?
Not entirely. For exact matches such as product codes or invoice numbers, keyword search is better. Hybrid search that combines both usually gives the best results.
Let’s talk about your transformation
Tell us which work repeats every week. We will tell you honestly whether it is worth automating.
How we start
- A free first callWe pin down the problem and the goal together.
- A 2-week discovery sprintWe look at the data, the process and the tools, and decide where to start.
- A written proposalScope, architecture and timeline, in writing.