Choosing a vector store, and when you do not need one
Vector search is a feature of your database before it is a category of product. For most retrieval systems, the extension you already have is sufficient — and the decision that actually affects answer quality is hybrid search and metadata filtering, not which index algorithm you picked.
The vector database market grew quickly enough that adopting one became the default first step in building retrieval. It is worth resisting that default long enough to ask whether the system needs a separate datastore at all, because a second datastore brings synchronisation, consistency and operational cost that a Postgres extension does not.
Start with the database you already run
If you run PostgreSQL, pgvector gives you vector similarity search inside the database that already holds your documents, your tenancy model and your access control. That co-location is worth more than most benchmark differences.
The single strongest argument for this approach is that tenant isolation, row-level security, joins to your domain tables and your existing backup and recovery all apply automatically. A separate vector store means reimplementing each of those.
What a dedicated vector database genuinely buys
Those are real advantages at real scale. They are not advantages for a corpus of fifty thousand chunks, where the honest comparison is one datastore against two.
Metadata filtering is the decision that bites
Almost every production retrieval system needs filtered search: this tenant's documents, this date range, this document type. How a store implements that filter matters far more than its raw similarity throughput.
- Post-filtering retrieves the top K by similarity, then discards non-matching rows. If the tenant's documents are not in the global top K, the result is empty — a severe correctness failure in multi-tenant systems.
- Pre-filtering restricts the candidate set before similarity search. Correct, and what you want.
- Query with a filter, not by retrieving broadly and filtering in application code — that pattern silently loses relevant results.
- Test filtered recall explicitly with a tenant whose documents are not globally most similar; this is where post-filtering systems fail.
Hybrid search improves answers more than index choice
Dense embeddings capture meaning and are weak on exact tokens — product codes, error identifiers, names, acronyms. Keyword search is the opposite. Combining them fixes a category of failure that no amount of embedding tuning will.
That is roughly thirty lines of SQL against the database you already run, and it typically produces a larger improvement in answer quality than switching vector stores would.
Chunking affects quality more than storage does
Retrieval quality is largely decided before anything is stored. A well-chosen chunking strategy in pgvector beats a poor one in the most sophisticated vector database available.
- Split on document structure — headings, sections — rather than at fixed character counts that cut mid-sentence
- Overlap adjacent chunks modestly so a fact spanning a boundary is retrievable from either side
- Keep a chunk's heading path in its text, so an isolated chunk still carries its context
- Store the document title and section in metadata, and include them in what you pass to the model
- Match chunk size to the question shape: specific factual questions favour smaller chunks, synthesis favours larger
A defensible order of work
- Build retrieval on pgvector, or whatever your primary database offers.
- Get chunking right, measured against an evaluation set rather than by inspection.
- Add hybrid search. This is usually the largest single quality gain available.
- Add reranking if evaluation still shows relevant passages ranked below irrelevant ones.
- Only then consider a dedicated vector store, and only if a measured constraint — corpus size, query latency under load, contention with transactional traffic — justifies the second datastore.
Most systems never reach step five, and the ones that do arrive there with a clear measurement showing why, rather than a preference formed before the first document was indexed.
Questions
Is pgvector good enough for production RAG?
For most systems, yes. It handles low millions of vectors on adequate hardware, and it keeps embeddings alongside your documents, tenancy model and access control — which removes synchronisation and reimplementation work entirely. A dedicated store starts earning its cost beyond roughly ten million vectors, or where vector query load genuinely competes with transactional traffic.
HNSW or IVFFlat?
HNSW for most cases: better recall and query performance, at the cost of slower index builds and higher memory. IVFFlat suits situations where build time or memory is the binding constraint and you can accept somewhat lower recall. Either way, match the index operator class to the distance metric your embeddings actually use.
Why does my retrieval return nothing for some tenants?
Almost certainly post-filtering. The store retrieves the globally most similar chunks and then discards those not matching the tenant filter — so a tenant with few documents can end up with nothing. The fix is pre-filtered search, where the filter restricts candidates before similarity ranking, which is what a WHERE clause in pgvector does naturally.
What improves retrieval quality most?
Chunking strategy and hybrid search, in that order — both usually ahead of any change of vector store. Dense embeddings alone handle exact tokens like product codes and error identifiers badly, and combining them with keyword search fixes a failure class that embedding tuning cannot.