What is a vector database and what is it used for in artificial intelligence?
Published on 2026-10-20 by frfrand
What is a vector database: embeddings, semantic search, its role in a RAG system, pgvector in PostgreSQL and its limits compared to a SQL query.

Short answer: A vector database allows storing and searching numerical representations of information to find similar items by meaning or characteristics. That's why it appears both when talking about intelligent search engines and AI applications.
The explanation sounds mathematical, but the idea is quite human: two sentences can mean almost the same thing even if they use different words.
The problem of searching only words
Imagine you have a thousand internal documents and someone asks: "How do I recover access to my account?".
A traditional search engine that relies on exact matches might search for the words "recover", "access", and "account". But your document might be titled "Password reset". The meaning is close, even if the words are not identical.
Semantic search attempts to recognize that closeness. To achieve this, it normally uses a model that transforms texts or other content into sets of numbers.
What is an embedding?
An embedding is a numerical representation created by a model. You can imagine it as a point in a space with many dimensions. You don't need to be able to draw those dimensions to understand their usefulness: items similar according to the model can end up represented with nearby numbers.
For example, "repairing a bicycle" and "fixing a bike" could produce relatively similar representations. This allows finding documents related to a question without requiring a literal match.
But be careful: similarity does not mean correctness. A model can also bring together texts that share context and, however, respond with different things.
What does the vector database do?
It stores those vectors and allows searching for nearby ones using similarity measures or algorithms.
In a document application, the flow could be:
- You split the manuals into useful fragments.
- You generate an embedding for each fragment.
- You store the vectors along with identifiers and metadata.
- When a question arrives, you generate its embedding.
- You search for similar fragments and return the most relevant results.
It is a common starting point for RAG systems, where a language model answers using information retrieved from documents. But the vector database does not write the answer: it performs a storage and search task.
Is it necessary to install a new database?
Not always. There are specialized engines, but also tools for vector search in databases you may already be using. PostgreSQL, for example, can incorporate extensions such as pgvector to store and query vectors.
That sounds attractive if you have relational data — users, permissions, projects — and need semantic searches within the same architecture.
The choice depends on volume, query type, available indexes, performance, and maintenance. It makes no sense to add another service just because the word "vector" appears in an AI presentation.
What about security?
Retrieved fragments must respect user permissions. If you search among private documents from one hundred clients, it is not enough to get the most similar vectors: you also have to limit results to what that person is authorized to see.
A poorly filtered semantic search can become an information leak. The AI should not receive private documents simply because its query is similar.
Three important limits
Embeddings can become outdated. If you changed a document and did not update its vector, the search engine might find old information.
Approximate search does not guarantee retrieving the best result. Some indexes prioritize speed and memory, accepting compromises in accuracy.
A semantic match does not verify facts. You can retrieve a very similar document but incorrect for the specific date or situation.
That is why it is often useful to combine traditional filters, keywords, similarity, and response validation.
How would it apply in ArduMaker?
In ArduMaker, PostgreSQL is installed on the VPS from the app catalog. If you want vector search there, pgvector is an extension that must be installed on that PostgreSQL and activated with CREATE EXTENSION vector; check beforehand that it is available for the version you have. For the model that drafts responses, ArduMaker's IA Router provides keys with spending limits to call models from different providers. This way you can build a searcher over your own documentation without confusing the search with the AI model that drafts the responses; the full process is in what is RAG.
Frequently asked questions
Do I need a vector database to do RAG?
Not always. With few documents it is enough to store the vectors in the database you already use (for example, PostgreSQL with pgvector) or even with keyword search. A specialized vector database starts to make sense with millions of fragments or demanding latency requirements. Combining both approaches is what is called hybrid RAG.
What is cosine similarity?
It is a way of measuring how similar two vectors are according to the angle they form, regardless of their length: the closer to 1, the more similar they are. It is one of the most used measures to compare text embeddings, along with Euclidean distance and the inner product.
In one sentence: vector databases are used to find similar information in its numerical representation. They are a retrieval tool, not a guarantee that an AI is right.
Sources: pgvector on GitHub · PostgreSQL Documentation · Introduction to Google embeddings.
