What is a vector database, and do you need one?
What a vector database stores, in plain terms
A normal database finds rows that match exact values, such as a customer number or a date. A vector database finds items that are close in meaning. An embedding model converts each item into a long list of numbers, and items with similar meaning end up with similar lists.
Those lists are called vectors. The database keeps each vector beside the original text, the source file name and any labels you attach, such as language, department or effective date. When a user asks a question, the question is converted into a vector too, and the database returns the stored items whose vectors sit closest to it.
How a search by meaning works, step by step
Most business uses follow the same pipeline. It is the basis of the assistants that answer questions from company documents, and it is worth knowing before you ask a builder for one.
- Split each document into chunks, usually a few paragraphs each, so that an answer can point to one passage rather than a whole file.
- Send each chunk to an embedding model and store the resulting vector with the chunk text, a link to the source and its labels.
- When someone asks a question, convert the question with the same embedding model. Using a different model at this step breaks the search.
- Retrieve the closest few chunks, then pass only those chunks to a language model, which writes the answer and cites its sources.
When an existing database with a vector extension is enough
A dedicated vector database is one option, not the default. If your data already lives in Postgres, a vector extension such as pgvector lets you store embeddings in ordinary tables and search them with ordinary SQL.
An existing database is usually enough when the situation looks like this.
- Your records and your vectors need to be joined, for example a document search limited to the customers of one account.
- Your team already runs Postgres, knows its backup and access tools, and does not want another system to monitor.
- The collection is of a moderate size and query volume is steady, so one well-configured database can serve it.
- The search is part of a larger application, and one transaction should update a record and its embedding together.
What to check before you choose: filtering, permissions, updates and cost
Four questions decide most projects. Answer them on paper before you compare products, because each product answers them differently.
- Filtering. Can a search be limited by language, department, date or status before the closest matches are chosen? Filters applied after the search often return too few results, so test that case on purpose.
- Permissions. A user should only ever receive chunks they are allowed to read. Enforce this in the search layer, using the source system's access rules, not only by hiding results on the screen. A leaked chunk is a leaked document.
- Updates. When a document changes, its chunks must be split, embedded and replaced. When it is deleted, its vectors must be removed as well, or the assistant will keep quoting it.
- Cost. The main drivers are the number of chunks, the size of each vector set by the embedding model, the memory the index needs, the cost of re-embedding everything when you switch models, and the number of queries each day. Read the current pricing pages of your embedding and hosting providers, and estimate with a sample of your own documents.
Mistakes that cost time and trust
Most failed projects make one of these errors, and each is cheap to avoid at the start.
- Mixing embedding models in one collection. Vectors from different models cannot be compared, so switching models means embedding the whole collection again.
- Chunks that are too long to match a question precisely, or so short that each one lacks the context needed to make sense.
- Treating the similarity score as proof that an answer is right. A high score means the words are related, not that the passage answers the question.
- No deletion path for removed documents, so old policies keep appearing in answers.
- Testing only with easy questions. Keep a set of real questions, including ones the documents cannot answer, and check that the system admits when it does not know.
Where to check current details
Product features, index types, limits and pricing change over time, so this guide describes the mechanism rather than current figures. Read the pgvector project documentation for the extension, the pricing and limits pages of your database host, and the documentation of your embedding model provider.
Before you send any personal data to an outside service, read that provider's current data terms and confirm where its processing takes place.
How Hundred Seas helps
Hundred Seas is a product studio in Taipei. We build AI agents and AI CRM systems on Claude and OpenAI models, and we choose the model for each task on cost, speed, quality and where the client's data has to stay. Where a project needs search over the client's own documents, the storage choice is made together with that decision. We are a registered partner in Anthropic's Claude Partner Network and an OpenAI partner.
Our work begins with a scope step of about one week at a fixed price, which ends in a written plan, a clickable prototype and a firm quote. The build follows in weekly releases of working software over two to four weeks, and a monthly run plan keeps the system running and up to date afterwards.
Questions
- Do I need a vector database to build a company chatbot?
- Not always. A chatbot that answers from company documents needs a way to find the relevant passages, and a vector index is one common way to do that. If your data already lives in Postgres or another common database with a vector extension, that may be enough. Start with the simplest store that meets your permission and update needs, and move only when tests show a real limit.
- Is pgvector a real vector database?
- It is an extension that adds vector storage and similarity search to Postgres. For many business workloads it behaves like a vector database, because it stores embeddings, indexes them and returns the nearest matches. Whether it is the right choice depends on your scale, your speed targets and your team's skills. Check the pgvector documentation for the index types it supports today.
- Why does my search return results that look related but do not answer the question?
- Embedding similarity measures closeness in meaning, not whether a passage contains the answer. Common causes are chunks that are too broad, missing labels that would narrow the search, and questions that use different words from the source. Improve the chunking, add filters and test with real questions. A reranking step can also help, but it adds cost, so test it before you keep it.
- Can I switch embedding models later?
- You can, but plan for it. Vectors from one model cannot be compared with vectors from another, so every stored chunk must be embedded again and the index rebuilt. Keep the original text and labels in a store you control, so re-embedding never requires collecting or splitting your documents again. Test the new model on your question set before you switch.
- How do I stop users from seeing documents they should not access?
- Apply the source system's access rules at search time. Each chunk should carry the permission groups of its source document, and the search should filter by the requesting user's groups before any result reaches the language model. Hiding results only in the interface is not enough, because the text can still reach the model or appear in a logged query.