published fresh until

pgvector or another vector database: which should my AI app use?

Summary Start with pgvector when it fits your Postgres workload, then measure recall and filtered result counts. Iterative scans can still stop at their limits; on pgvector 0.8.0+, enable them with SET hnsw.iterative_scan = strict_order;

Not for choosing a chunk size or splitter; see rag-chunking-recursive-512-beat-semantic-benchmark

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

As of November 2026, pgvector is a reasonable starting point when your app already uses Postgres; choose another store based on your workload. Its README makes clear that iterative scans can still stop before filling a filtered LIMIT.

Do first: measure filtered result counts and recall on your own questions, including scan-limit cases described in the README.

The problem

You are adding search or RAG to an app and have to pick where the embeddings live. Every vendor page says theirs is the fastest, and an agent will happily generate code for whichever you name first.

What the sources say

A r/LocalLLaMA post by u/Kaneki_Sana summarises a comparison article: standard HNSW indexing is fine for RAG systems under roughly 10M vectors; Turbopuffer is cheap at scale because it uses object storage; pgvector is "good for small scale and local experiments"; Chroma is light for notebooks and small servers. Note the post is a link to the author's own comparison blog, so treat the table as one opinion.

One commenter gives this decision rule: use pgvector until you have a very specific reason not to. A commenter added that most poor retrieval they have debugged traced back to chunking and document preprocessing, not the database, and that spinning up Postgres let them iterate quickly. Others pushed back with Vespa (strong at textual plus hybrid search), LanceDB (an embedded, SQLite-like option), FAISS or plain NumPy for in-process data, and a link arguing off-the-shelf vector databases are weak. One commenter warned that constant read/write workloads are shaky on some vector stores.

The pgvector README gives the facts you need to size the choice:

  • Two index types: HNSW (better speed/recall, slower build, more memory, can be created on an empty table) and IVFFlat (faster build, less memory, create after loading data).
  • hnsw.ef_search defaults to 40; raise it for recall (SET hnsw.ef_search = 100;, or SET LOCAL inside a transaction).
  • Filtering happens after the index scan, so a WHERE that matches 10% of rows returns about 4 rows at the default. On pgvector 0.8.0+, turn on iterative scans (SET hnsw.iterative_scan = strict_order; or relaxed_order) to scan further; they stop at hnsw.max_scan_tuples or ivfflat.max_probes, so a full LIMIT is not guaranteed (README).
  • Indexed vector columns go up to 2,000 dimensions, halfvec up to 4,000.
  • Hybrid search: combine with Postgres full-text search and merge with Reciprocal Rank Fusion or a cross-encoder.

How to put it to your agent

Suggested design: Add embeddings to our existing Postgres with pgvector. Store the vector next to the source row, create an HNSW index, and write one query that filters by tenant_id and orders by cosine distance. Enable iterative scans and measure whether filtered queries fill the limit within their scan limits. Add a full-text column and merge both result lists with Reciprocal Rank Fusion. Do not add a separate vector service.

When to leave pgvector

Move when you can name the reason: constant heavy writes that hurt your main database, very large multi-tenant filtered search, or a need for built-in text-plus-vector ranking at scale. Then compare Qdrant, Vespa, Turbopuffer or LanceDB on your own data with a small labelled query set.

Mistakes to check

  • Filtered queries silently returning fewer rows than LIMIT (default ef_search plus post-filtering).
  • Building an IVFFlat index on an empty table.
  • Choosing a store before measuring retrieval quality on your own questions.

Limits

The 10M figure and store-scale characterisations come from the post, not a pgvector capacity limit; commenters disagreed on details.

Sources

Started from a post by @Kaneki_Sana, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# pgvector or another vector database: which should my AI app use?
Summary: Start with pgvector when it fits your Postgres workload, then measure recall and filtered result counts. Iterative scans can still stop at their limits; on pgvector 0.8.0+, enable them with `SET hnsw.iterative_scan = strict_order;`
Copy for agent
get the whatworks thread vector-database-for-ai-app-pgvector-first and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread vector-database-for-ai-app-pgvector-first
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks