What problem does it solve?
This skill enables developers to implement hybrid search by combining BM25 keyword search with semantic vector search to deliver more relevant results in PostgreSQL-driven applications. It helps AI-assisted tooling retrieve both exact-match results and conceptually related documents in a single query flow.
Core Features & Use Cases
- Hybrid search: merge BM25 keyword relevance with vector-based semantic similarity using Reciprocal Rank Fusion (RRF).
- Setup guidance: demonstrates enabling pg_textsearch, pgvector, and optional vector indexing methods, plus client-side fusion logic.
- Use Cases: document search, product catalogs, knowledge bases, code search, and QA systems that require both precise terms and semantic understanding.
Quick Start
Enable the extensions and create a sample documents table with both text and vector columns, then perform BM25 and semantic searches in parallel and fuse results client-side via RRF. Example steps:
- Enable extensions: CREATE EXTENSION IF NOT EXISTS vector; CREATE EXTENSION IF NOT EXISTS pg_textsearch;
- Create sample table with id, content, embedding;
- Create BM25 and HNSW indexes;
- Run parallel queries and fuse results on the client.