Stop Adding a Vector Database to Everything
Stop adding a vector database to everything. Postgres can already do most of this job.
I see a new database added to early products that barely have search, let alone a retrieval problem. It happens because the tutorial started there, not because the product needed it.
Full text search handles most basic search. If you actually need embeddings, pgvector lives in the same database you are already running.
Another service means another bill, another backup, and another thing that can go down. I would add a separate vector database when Postgres is clearly the bottleneck, not on day one.
You do not need a specialised AI database to try an AI feature. You need a clear use case and a place to store the data you already have.
Start with the job, not the tool
Before I reach for embeddings, I ask what the person is trying to do.
If they are looking up a record they can name, that is ordinary search, or even a simple filter. If they are searching inside notes, articles or tickets for words they already know, that is full text search. If they are asking a question whose answer lives in a set of documents, and the wording will not match the wording in those documents, then embeddings might help.
A lot of "we need a vector database" work is the first two jobs wearing the third job's clothes. A search box that matches titles and body text will take you a long way. So will a good index and a schema you can query.
I would rather ship that first, see where it fails, and only then add similarity search. The failure is useful. It tells you whether you have a ranking problem, a content problem, or a real semantic gap.
Postgres already has search
If the product already uses Postgres, full text search is close at hand. You can store a tsvector, index it, and query it with tsquery. For many apps, that is enough to find a record, a post or a help article.
A typical shape looks like this:
ALTER TABLE articles
ADD COLUMN body_tsv tsvector
GENERATED ALWAYS AS (to_tsvector('english', coalesce(title, '') || ' ' || coalesce(body, ''))) STORED;
CREATE INDEX articles_body_tsv_idx ON articles USING GIN (body_tsv);
SELECT id, title
FROM articles
WHERE body_tsv @@ websearch_to_tsquery('english', $1)
ORDER BY ts_rank(body_tsv, websearch_to_tsquery('english', $1)) DESC
LIMIT 20;
This is not a complete search product. It will not solve every typo or every vague question. It will handle a large share of "find me the thing that mentions this." It also keeps the data in the same place as the rest of the app, with the same backups and the same transactions.
I would start here, then look at ranking, typo handling and filters. I would not start by syncing every row into another system.
When you actually need embeddings
Sometimes word matching is not enough. The person asks for "how we handle failed payments", and the article is titled "Stripe webhooks and subscription state." The words do not line up, but the meaning does.
That is a fair case for embeddings. Even then, I would try pgvector in Postgres before I add a new database.
The shape is straightforward: store a vector next to the row, index it, and search by distance. A simplified query looks like this:
CREATE EXTENSION IF NOT EXISTS vector;
ALTER TABLE articles
ADD COLUMN embedding vector(1536);
CREATE INDEX articles_embedding_idx
ON articles USING ivfflat (embedding vector_l2_ops)
WITH (lists = 100);
SELECT id, title
FROM articles
ORDER BY embedding <-> $1
LIMIT 10;
The exact index type and settings depend on the size of the table and the model you use. The important part is the architecture: the embedding lives with the article. You do not have a second source of truth to keep in sync every time a row changes.
I treat the model that creates the embedding as just another dependency. I cap what I send it, I store the result, and I update the vector when the source text changes. I do not need a new database to do that.
When a dedicated vector database makes sense
I would add one when Postgres is clearly the bottleneck, not when the first tutorial mentions it.
That might mean the vector workload is crowding out the rest of the database, or the dataset is large enough that a specialised engine is actually doing better, or the team already has a serious retrieval problem and the operations cost is justified.
Until then, a second store is another bill, another backup, another credential, and another way for search to drift from the records in Postgres. Early products do not need that kind of extra moving part.
This is the same rule I use for backends and for microservices. Start with the system you already have. Split only when the current tool is the thing that is failing.
What I take from this
Postgres can already do a lot. Full text search covers most basic cases. If you need embeddings, try pgvector first, in the same database.
Add a new service when Postgres is the bottleneck, not on day one. The simplest search setup that still works for your users is usually the right one.
If you are adding search or retrieval to a product and want help keeping it in Postgres, get in touch.
Keep reading