Vector databases explained: Pinecone, Weaviate, pgvector and more
A vector database stores embeddings, numerical representations of text, images or other data, and finds the items most similar in meaning to a query. It is the search engine behind most RAG systems and AI assistants that answer from your documents. Popular options include managed services such as Pinecone, open-source databases such as Weaviate and Qdrant, and pgvector, an extension that adds vector search to PostgreSQL. Many teams start with pgvector if they already use Postgres.
What is a vector database?
Traditional search matches words. Ask for “cancel my subscription” and a keyword search may miss a passage titled “ending your annual plan”. Vector search matches meaning. An embedding model converts each piece of text into a vector, a long list of numbers, so that passages with similar meaning sit close together. A vector database stores those vectors and quickly finds the ones nearest to the vector of a query. That is the retrieval step in retrieval-augmented generation (RAG).
What are the main options?
| Option | Type | Strengths | Consider if |
|---|---|---|---|
| pgvector | PostgreSQL extension | Vectors beside your existing data, SQL filters | You already run Postgres |
| Pinecone | Managed cloud service | No servers to run, scales easily | You want a fully managed service |
| Weaviate | Open source, with cloud option | Hybrid search, modules, self-hostable | You want open source and flexibility |
| Qdrant | Open source, with cloud option | Fast filtering, efficient storage | You need strong filtering and self-hosting |
| Built into platforms | Search services in cloud or app platforms | Fewer moving parts | Your stack already offers it |
Other databases, including MongoDB, Elasticsearch and Redis, also support vector search, so check what your team already uses before adding a new system.
How do you choose one?
- Scale: how many chunks today, and in a year?
- Hosting: managed service, your cloud or on-premise?
- Filtering: do you need to filter by user, team, date or document type?
- Hybrid search: do you need keyword and vector search together?
- Cost: storage, queries and the team time to run it
- Data rules: where must the data live?
Do you need a separate vector database?
What does a real setup look like?
A SaaS company wants its support assistant to answer from 2,000 help articles and product docs. It already runs PostgreSQL, so it adds the pgvector extension and a table holding each chunk’s text, embedding, article title, product area and last-updated date. A nightly job re-embeds changed articles. When a customer asks a question, the app embeds it, runs a similarity search filtered to the customer’s product, and passes the top five chunks to the language model. The whole setup lives in the existing database, uses existing backups and needs no new vendor. If volumes grow to tens of millions of chunks or latency becomes a problem, the team can move the vectors to a dedicated database later.
What does it cost?
Costs come from three places: creating embeddings, storing vectors and running queries. Embedding is usually cheap per document but adds up when you re-index often. Managed services charge for storage and usage; self-hosted options cost server time and maintenance. For most business knowledge bases, the vector store is a small part of the total cost compared with language-model calls, which our guide to cutting LLM API costs covers.
What about security and permissions?
- Store permission metadata with each chunk and filter every query by the user’s access
- Keep vectors of sensitive documents in the same region and controls as the originals
- Remember that embeddings can leak information, so protect them like the source text
- Delete vectors when the source document is deleted
What matters more than the database?
- The quality and freshness of the content you index
- How you split documents into chunks
- The embedding model you choose, and using the same one for queries
- Adding metadata such as title, date and permissions
- Testing retrieval with real questions before launch
Retrieval quality is covered in our RAG guide.
Start simple, measure retrieval quality on real questions and only add a specialised system when your scale or requirements clearly call for it.
Document which embedding model and chunk settings you used, because changing either later means re-indexing everything.
Plan regular re-indexing so search results stay in step with your latest documents.
Test a few embedding models on your own questions before committing; retrieval quality varies by language and domain.
How UIUX Studio helps
We design retrieval systems for AI assistants, from choosing a vector store to chunking, permissions and evaluation. Talk to our product engineering team.
Frequently asked questions
What is a vector database?
A database that stores embeddings and finds items similar in meaning to a query.
What is pgvector?
An open-source PostgreSQL extension that adds vector storage and similarity search.
Is Pinecone better than pgvector?
Not generally; Pinecone is managed and scales easily, pgvector is simpler if you already use Postgres.
Do I need a vector database for RAG?
Usually, though small projects can use simpler search.
What is an embedding?
A list of numbers that represents the meaning of text or other data.