hybrid-search-implementation

Combine vector similarity with keyword matching to improve document retrieval.

6|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/kmshihab7878/claude-code-setup --skill hybrid-search-implementation-kmshihab7878
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hybrid-search-implementation
Source: https://github.com/kmshihab7878/claude-code-setup/tree/main/skills/hybrid-search-implementation
Command: npx skills add https://github.com/kmshihab7878/claude-code-setup --skill hybrid-search-implementation-kmshihab7878

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hybrid search implementation closes the gap between semantic vector recall and exact-match keyword precision by combining both retrieval approaches to surface more relevant documents and reduce missed matches in RAG and search applications.

Core Features & Use Cases

  • Fusion strategies: Reciprocal Rank Fusion (RRF), linear score interpolation, and cascade approaches for balancing vector and keyword signals.
  • Reranking and validation: Cross-encoder reranking templates and logging of both vector and keyword scores to improve quality and debuggability.
  • Integration examples: Production-ready templates for Postgres+pgvector, Elasticsearch dense vectors, and a modular Hybrid RAG pipeline for embedder, vector store, keyword store, and reranker.
  • Use cases: Enterprise search for domain-specific vocabularies, RAG retrieval for knowledge-heavy LLM prompts, and scenarios where names, codes, or exact phrases must not be missed by semantic retrieval.

Quick Start

Run a hybrid search combining vector similarity and BM25 keyword matching and return the top 10 fused results for the query "how to reset user password".

Frequently Asked Questions about hybrid-search-implementation

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

FAQPage Schema
What is hybrid search and how does it improve RAG retrieval?

Hybrid search improves RAG retrieval by combining semantic vector similarity with keyword matching, increasing recall and precision to surface more relevant documents and reduce missed exact-term matches.

How do I combine vector similarity and BM25 keyword matching in Elasticsearch?

You can combine dense vector similarity and BM25 keyword matching using fusion strategies like Reciprocal Rank Fusion (RRF) or linear score interpolation, supported by production-ready Elasticsearch integration templates.

Does this hybrid search approach work with Postgres and pgvector?

Yes, the hybrid search implementation includes production-ready templates for Postgres and pgvector, allowing you to fuse vector similarity scores with keyword matching results directly within your database.

When should I use cross-encoder reranking in a hybrid search pipeline?

Use cross-encoder reranking after initial vector and keyword retrieval to validate and reorder candidate documents, improving search quality and debuggability by logging both vector and keyword scores.

Why does semantic vector search miss exact phrase matches in enterprise search?

Semantic vector search misses exact matches because it prioritizes conceptual similarity over lexical precision, making hybrid search necessary to catch domain-specific vocabularies, names, codes, or exact phrases.