A reranker rereads the passages pgvector returns and reorders them by relevance. With bge-reranker-v2-m3 served by llama.cpp on CPU, reranking 20 candidates raised nDCG@10 from 0.805 to 0.850 on 300 Spanish MIRACL questions; handing it 50 improved nothing and cost 2.7 times more tokens.
This guide installs PostgreSQL 18.6 with pgvector 0.8.7 on Debian or Ubuntu from the PGDG repository, creates a dedicated role and database, tunes memory, builds an HNSW index and checks it with EXPLAIN. Version 0.8.7 fixes CVE-2026-103484, a buffer overflow in IVFFlat index builds.
pgvector matured in 2023-2024 with the HNSW index type and parallel construction that arrived in version 0.6. For projects already running PostgreSQL, a dedicated vector database is not needed in most cases: this guide explains when PostgreSQL is enough, how to configure the index, and where it starts to fall short.
pgvector turns PostgreSQL into a vector database without adding another service to the stack. With version 0.8.6 and PostgreSQL 18, HNSW reached 95.1% recall@10 at 1.15 ms on 99,000 real embeddings. SQL filters share the query with vector ranking, and iterative index scans stop a filter from returning fewer rows than requested.
13 min304
We use first- and third-party cookies to analyze site traffic. You can accept them, reject them, or configure your choice.
Learn more about cookies
Cookie preferences
NecessaryEssential for the site to work. Always on.
AnalyticsHelp us understand how the site is used (Google Analytics).