What Are Embeddings and Vector Databases? A Plain Guide
A vector database is used to find information by meaning rather than by exact words. It stores embeddings, which are lists of numbers that represent what a piece of text, an image or another item is about. When someone asks a question, the system turns the question into an embedding too and retrieves the stored items closest in meaning. That retrieval step powers semantic search, recommendations and AI assistants that answer from your own documents.
What is an embedding, in plain terms?
An embedding is a numeric fingerprint of meaning. An embedding model reads a piece of content and produces a long list of numbers. Content with similar meaning produces similar lists, even when the wording is different.
That is the useful property. "How do I get my money back?" and "What is your refund policy?" share almost no words, yet their embeddings sit close together. A keyword search might miss the connection. An embedding-based search usually finds it.
You do not need to understand how the numbers are produced to make good decisions about them. What matters is that the system can compare two pieces of content and say how close they are in meaning.
What does a vector database actually do?
A vector database stores embeddings alongside a reference to the original content, plus useful details such as the document title, date, owner or access level. Its main job is to answer one question quickly: which stored items are closest in meaning to this new one?
Ordinary databases are built to match exact values, such as a customer ID or an order status. A vector database is built for similarity. Some teams use a dedicated vector database; others add vector search to a database they already run. Both can work, and the right choice depends on how much content you have, how it changes and what your team already maintains. If you are weighing general database choices, see PostgreSQL vs MongoDB for new products.
Where does a vector database fit into an AI feature?
Most AI features that use a vector database follow the same pattern:
| Step | What happens | Why it matters |
|---|---|---|
| Prepare content | Documents are cleaned and split into sensible passages | Poorly split content returns fragments that lack context |
| Create embeddings | Each passage is turned into an embedding | This makes the content searchable by meaning |
| Store | Embeddings and details are saved in the vector database | Details allow filtering by product, customer or permission |
| Search | A user's question is embedded and compared with stored passages | The closest passages are retrieved |
| Use the results | Results are shown directly or passed to a language model to write an answer | The answer is grounded in your content rather than the model's general knowledge |
The final step is the core of retrieval-augmented generation, often called RAG. If you are deciding between that and training a model on your data, read RAG vs fine-tuning: choosing the right approach.
Common uses include:
- Searching a help centre or internal knowledge base by meaning
- Answering staff or customer questions from policies, manuals and contracts
- Recommending similar products, articles or support tickets
- Grouping duplicate or related records
- Finding past cases that resemble a new one
What does a meaning-based search look like in practice?
Here is an illustrative example for a fictional software company with a help centre of a few hundred articles. The content and scores are made up to show the idea.
A customer types: "I was charged twice this month."
A keyword search looks for "charged" and "twice". The help centre has no article using those words, so it returns little of use.
With embeddings, the system turns the question into an embedding and compares it with every stored passage. It returns the closest matches:
| Rank | Retrieved passage (illustrative) | Why it is relevant |
|---|---|---|
| 1 | "Duplicate payments: what to do if your card was billed more than once" | Same meaning, different words |
| 2 | "How refunds are processed and when they appear on your statement" | The likely next step |
| 3 | "Understanding pending authorisations on your bank account" | A common cause of apparent double charges |
If the feature includes an AI assistant, those three passages are passed to a language model with an instruction to answer only from them. The customer gets a short answer explaining how to report a duplicate payment, with links to the source articles.
Notice two things. First, the quality of the answer depends on whether the right articles exist and are up to date. Second, filters matter: if the company served several regions with different billing rules, the search should only return passages for the customer's region.
Is your content ready for this?
Embeddings make good content findable. They do not fix missing, outdated or contradictory content. Before building, check that your source material is current, has a clear owner and carries the details you need for filtering, such as product line or access level. Our guide on whether your business data is ready for AI covers this in more depth.
When does a vector database not apply?
A vector database is not always the right tool.
- Exact lookups. Finding an invoice by number or a customer by email is a job for an ordinary database query.
- Small, stable content. If you have a handful of documents, a simpler approach may be enough.
- Structured questions. "What were last month's sales by region?" needs a query over your data, not a similarity search.
- Precise wording matters. Product codes, legal clause numbers and names often need keyword search. Many good systems combine keyword and meaning-based search.
What common mistakes should founders avoid?
Assuming the AI will find everything. Retrieval returns the closest matches, which are not necessarily correct ones. Test with real questions.
Ignoring permissions. If a staff member cannot open a document, the search should not surface its contents. Access rules must be applied at retrieval, not only in the interface. See data security in modern applications.
Forgetting updates and deletions. When a document changes or is removed, its embeddings must be updated or removed too, or the system will keep citing stale content.
Splitting content carelessly. Passages that are too short lose context; passages that are too long blur meaning. This needs testing on your own material.
Changing the embedding model without a plan. Embeddings from different models are not comparable. Switching usually means re-processing all content.
Skipping evaluation. Agree a set of test questions with expected answers before launch, and rerun it after changes. Our guide to evaluating AI feature output quality explains how.
What questions should you ask your build partner?
Use this checklist in your discussions:
- Which content will be searchable, and who owns keeping it current?
- How will documents be split into passages, and how was that tested?
- Which embedding model will be used, and what happens if we change it later?
- Will this run in a dedicated vector database or in a database we already use, and why?
- How are access permissions enforced during search?
- How are new, changed and deleted documents kept in sync?
- Will search combine keyword and meaning-based matching?
- Where is our data processed and stored, and does any of it leave our environment?
- How will retrieval quality be measured before and after launch?
- What are the ongoing costs for creating embeddings, storage and searching as content grows?
- How could we move to a different provider if needed?
Frequently asked questions
Do I need a vector database to build an AI chatbot?
Not always. If the chatbot must answer from your own documents, some form of meaning-based retrieval is usually needed, and a vector database is a common way to provide it. A chatbot that only handles a fixed set of tasks may not need one. For budgeting, see AI chatbot development cost.
Are embeddings the same as training a model on my data?
No. Creating embeddings does not change the language model. It makes your content searchable so relevant passages can be supplied to the model when needed.
Can embeddings work for images or other content?
Yes. Embedding models exist for images, audio and other content types, and some place text and images in the same space so a text query can find matching images. Suitability depends on your content and should be tested.
Is my data safe in a vector database?
It can be, with the same care as any other data store: access controls, encryption, clear retention rules and agreed hosting location. Embeddings are derived from your content, so treat them as sensitive whenever the source content is sensitive.
*Planning an AI feature that needs to search your own content? Start a conversation →*