hybrid-search-implementation

Implement hybrid search by fusing vector and keyword retrieval results.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Himanshu040604/codex-skills-setup --skill hybrid-search-implementation-himanshu040604
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hybrid-search-implementation
Source: https://github.com/Himanshu040604/codex-skills-setup/tree/main/assets/codex/skills/claude-import/skills/plugins/llm-application-dev%40claude-code-workflows/skills/hybrid-search-implementation
Command: npx skills add https://github.com/Himanshu040604/codex-skills-setup --skill hybrid-search-implementation-himanshu040604

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires asyncpg, numpy, elasticsearch, sentence-transformers, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enhances information retrieval by combining the strengths of vector similarity search and traditional keyword search, leading to more accurate and comprehensive search results.

Core Features & Use Cases

  • Hybrid Search Architectures: Implement strategies that fuse results from both vector and keyword search engines.
  • Fusion Methods: Utilize techniques like Reciprocal Rank Fusion (RRF), linear combination, or cross-encoder reranking to merge search outputs.
  • Use Case: Ideal for building robust Retrieval-Augmented Generation (RAG) systems, improving search engines, or when dealing with queries that benefit from both semantic understanding and exact term matching.

Quick Start

Implement a hybrid search using Reciprocal Rank Fusion with the provided Python templates.

Frequently Asked Questions about hybrid-search-implementation

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

FAQPage Schema
How do I combine vector similarity search with keyword search for RAG applications?

Hybrid search combines vector similarity and keyword search to improve retrieval accuracy. You can fuse outputs using Reciprocal Rank Fusion, linear combination, or cross-encoder reranking to capture both semantic understanding and exact term matching.

What is the best way to implement hybrid search using Elasticsearch and PostgreSQL?

Implement hybrid search by running vector and keyword queries simultaneously, then fusing outputs. This Skill provides templates for both PostgreSQL and Elasticsearch to execute combined retrieval and merge results using fusion techniques like RRF.

Can I use Reciprocal Rank Fusion to merge vector and keyword search results?

Yes, Reciprocal Rank Fusion (RRF) is supported. RRF merges vector and keyword search outputs by ranking documents based on their reciprocal ranks, providing a robust fusion method that requires no score calibration.

How does cross-encoder reranking improve hybrid search retrieval?

Cross-encoder reranking improves hybrid search by applying a secondary, fine-grained relevance model to the fused results. This approach re-evaluates query-document pairs to refine the final ranking beyond initial vector and keyword scores.

Do I need sentence-transformers and asyncpg to set up hybrid search with Python?

Yes, sentence-transformers generates the vector embeddings for semantic search, while asyncpg interfaces with PostgreSQL. Both are required dependencies for executing the Python-based hybrid search templates provided.