RAG & Chatbots
Vector Databases Explained: Does Your Business Need One?
Updated Muhammad Taha6 min read
A vector database stores text or images as lists of numbers called embeddings and finds items by similarity of meaning instead of exact words. It is the part that lets an AI assistant search your documents and pull out the passages relevant to a question. Most chatbots built on company data use one.
Key takeaways
- An embedding is a numeric representation of meaning. Texts about the same thing have similar numbers, even with different wording.
- A vector database finds the stored items whose embeddings are closest to the embedding of a question.
- It is the retrieval layer in retrieval-augmented generation (RAG): it finds the passages, and the language model writes the answer from them.
- Many businesses do not need a separate product. PostgreSQL with the pgvector extension handles a large number of use cases.
- Answer quality depends more on how documents are prepared and split than on which database you choose.
The problem vector search solves
Traditional search matches words. Search a policy library for "time off after having a baby" and a keyword engine looks for those words. If the document says "parental leave", it may not be found. People describe things in many ways, and documents use only one of them.
Vector search matches meaning. The question and the document are each converted into an embedding, and the system finds documents whose embeddings sit near the question's. "Time off after having a baby" and "parental leave" land close together, so the right policy is returned even though they share no words.
What an embedding is
An embedding model reads a piece of text and outputs a long list of numbers, often several hundred to a few thousand. You can think of the list as coordinates on a map with a very large number of dimensions. Texts with related meaning are placed near one another on that map. Texts about unrelated things are far apart.
Nobody sets these coordinates by hand. The embedding model learned them from large amounts of text. Your job is only to run your content through the model once and store the results.
How a vector database works, step by step
- Prepare the content. Documents are cleaned and split into chunks, usually a few paragraphs each, so that each chunk covers one idea.
- Embed each chunk. An embedding model converts every chunk into a vector.
- Store vectors with metadata. Each vector is saved with the original text and labels such as source document, date, department and access level.
- Build an index. The database organises vectors so that near neighbours can be found quickly without comparing against every item.
- Embed the question. When someone asks something, the same embedding model converts the question into a vector.
- Find the nearest chunks. The database returns the most similar chunks, filtered by metadata, for example only documents this user may see.
- Hand them to the language model. The model writes an answer using those chunks and cites where each came from.
Steps five to seven are retrieval-augmented generation. For the complete picture, read what is RAG.
Vector database, keyword search and relational database compared
| Relational database | Keyword search | Vector database | |
|---|---|---|---|
| Finds by | Exact values and conditions | Matching words | Similar meaning |
| Good for | Orders, customers, stock, accounts | Product codes, names, exact phrases | Questions in natural language over documents |
| Weak at | Free text | Synonyms and paraphrase | Exact identifiers, counting and totals |
| Example query | Invoices over a value this month | Documents containing "SKU-4471" | "What is our policy on late deliveries?" |
These are complementary. A good assistant often uses hybrid search, combining keyword and vector results, because a question may contain both a concept and an exact code. For totals and records, the agent should query the relational database directly, as described in chat with your ERP.
Do you need a dedicated vector database?
There are three practical routes:
- Vector search in a database you already run. PostgreSQL with pgvector is the common example. One system to operate, your documents sit beside your other data, and it copes with a substantial number of vectors. This is the sensible default for most small and mid-sized projects.
- A managed vector database. Services such as Pinecone, or managed versions of Qdrant, Weaviate and Milvus. Suited to very large collections, heavy query loads or teams that want no infrastructure work.
- A self-hosted open-source vector database. Qdrant, Weaviate, Milvus or Chroma on your own servers. Useful when data must stay in your environment and you have the engineering capacity.
Choose on scale, where data must reside, the filtering you need and who will operate it. For a few thousand to a few hundred thousand chunks, differences between products are rarely what limits quality.
What actually decides answer quality
- Clean source documents. Outdated and contradictory files produce outdated and contradictory answers. Audit the content first.
- Chunking. Chunks that are too small lose context. Chunks that are too large bury the answer. Splitting along headings and sections usually beats fixed character counts.
- Metadata. Dates, document type and ownership let you filter to current, authoritative sources.
- Access control. Permissions must be applied at retrieval, so an employee never receives a chunk from a document they could not open.
- Reranking. A second pass that reorders retrieved chunks by relevance before they reach the model often improves answers noticeably.
- Refreshing. When a document changes, its chunks must be re-embedded. Without a sync process, the index drifts from reality.
When retrieval returns the wrong passage, the model answers from the wrong passage. That is a leading cause of incorrect answers, discussed in why AI chatbots hallucinate.
Where businesses use vector databases
- A support chatbot that answers from help articles and policies. See building a chatbot on your company data.
- An internal knowledge assistant for staff questions about procedures and HR rules.
- Search across contracts, proposals or past projects by topic.
- Matching: similar support tickets, duplicate records, related products.
- Long-term memory for AI agents, covered in AI agent memory explained.
Related guides
- How to Build an AI SaaS Product: From Idea to Paying Customers
- LLM API Cost Control for SaaS: Caching, Routing and Limits That Protect Your Margin
- Internal Knowledge Assistants: Give Your Team Instant Answers
- AI Receptionist for Small Business: What It Does and Whether You Need One
- Service: AI Chatbots and Knowledge Assistants
Frequently asked questions
Is a vector database the same as training the AI on my data?
No. Nothing is trained. Your documents are stored and searched, and relevant passages are shown to the model at the moment of the question. Updating knowledge means updating documents, not retraining. The difference is explained in RAG vs fine-tuning.
Is my data safe in a vector database?
It is as safe as where you host it and how you control access. An embedding is derived from your text, and the original text is normally stored beside it, so treat the vector store with the same care as the source documents.
How much data do I need?
There is no minimum. A few dozen well-written documents can support a useful assistant. Quality and currency matter more than volume.
Sources and further reading
Primary documentation and research behind this guide.
- Pinecone: What is a vector database
- pgvector: vector search for PostgreSQL
- Lewis et al.: Retrieval-Augmented Generation for knowledge-intensive NLP tasks
A vector database is one part of a system that answers from your own knowledge. Growmerz builds AI chatbots and knowledge assistants with the retrieval, access control and testing that make the answers dependable. Book a free AI audit to plan yours.