pgvector-search

Combine vector embeddings with BM25 keyword search using Reciprocal Rank Fusion.

3|Updated Dec 27, 2025
One-click install
npx skills add https://github.com/yonatangross/create-yg-app --skill pgvector-search
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pgvector-search
Source: https://github.com/yonatangross/create-yg-app/tree/main/.claude/skills/pgvector-search
Command: npx skills add https://github.com/yonatangross/create-yg-app --skill pgvector-search

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables production-grade hybrid search by combining semantic vector retrieval with keyword search (BM25) using Reciprocal Rank Fusion, providing fast and accurate results over large document collections.

Core Features & Use Cases

  • Hybrid semantic + keyword search with RRF to balance recall and precision across 1024-dim embeddings and text indexes.
  • Vector indexing with HNSW for scalable, low-latency retrieval on large corpora.
  • BM25 keyword search via precomputed tsvector and gin indexes for exact phrase matching.
  • Metadata boosting using section titles, document paths, and content types to improve relevance.
  • Use cases: enterprise docs, knowledge bases, API docs, code repositories, and product FAQs.

Quick Start

Run a sample hybrid search by providing a query and obtaining top results from the search endpoint.

Frequently Asked Questions about pgvector-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I combine semantic vector search with BM25 keyword search in PostgreSQL?

Hybrid search combines semantic vector embeddings with BM25 keyword search using Reciprocal Rank Fusion (RRF), balancing recall and precision by merging 1024-dim embedding similarity with exact phrase matching from tsvector indexes.

What is the best way to index large document collections for low-latency semantic search?

Using HNSW vector indexing with pgvector provides scalable, low-latency retrieval on large corpora, while metadata boosting on section titles and content types further improves search relevance for enterprise knowledge bases.

Do I need a precomputed tsvector column to enable BM25 keyword search?

Yes, a precomputed tsvector column with a GIN index is required to enable BM25 keyword search, allowing exact phrase matching that complements semantic vector retrieval during the Reciprocal Rank Fusion process.

Does pgvector support hybrid search for API documentation and code repositories?

Yes, pgvector supports hybrid search for API documentation and code repositories by applying HNSW vector indexing and metadata boosting to rank results across large-scale technical document collections.

How does Reciprocal Rank Fusion improve search precision over semantic search alone?

Reciprocal Rank Fusion improves precision by fusing semantic vector retrieval rankings with BM25 keyword search rankings, ensuring both conceptual relevance and exact term matching contribute to the final result ordering.