Skip to main content

ADR-025: pgvector as Document Store

Status: Accepted Date: 2026-06-02 Authors: paulhumanity (with grazianognoll)

Contextโ€‹

RAGflow bundled the retrieval store with the RAG runtime. Migration off RAGflow forces a document-store decision.

Options comparedโ€‹

  • pgvector
  • Dedicated managed search service
  • Pinecone
  • Weaviate
  • Qdrant

Decisionโ€‹

Use pgvector on the existing humanwork Postgres instance. Use HNSW for ANN search. Hybrid retrieval, with BM25 via tsvector and dense retrieval via vector, is shipped natively by Haystack's PgvectorEmbeddingRetriever and PgvectorKeywordRetriever.

Whyโ€‹

pgvector has $0 incremental infrastructure cost, introduces no new vendor, supports hybrid retrieval out of the box, and provides sufficient scale for internal testing and early production.

Trade-offsโ€‹

Vector scaling is tied to Postgres scaling. This is mitigated by humanwork's existing Postgres capacity; revisit if QPS or document count exceeds an order-of-magnitude growth.