hybrid-search-implementation
by wshobsonhybrid-search-implementation lets you combine vector and keyword search to boost recall in RAG systems and search engines. Ideal when neither method alone is enough.
Overview
What is hybrid-search-implementation?
The hybrid-search-implementation skill provides practical patterns for combining vector (semantic) search and keyword (exact match) search. This hybrid approach is essential for backend developers building retrieval-augmented generation (RAG) systems, custom search engines, or any application where neither vector nor keyword search alone delivers sufficient recall or precision.
Who should use this skill?
- Backend developers working on information retrieval, RAG, or search engine projects
- Teams needing to improve recall for queries with both semantic and specific keyword requirements
- Projects where domain-specific vocabulary or exact identifiers (names, codes) are important
What problems does it solve?
- Pure vector search can miss results that only match via keywords
- Keyword search alone may not capture semantic meaning
- Hybrid search increases the chance of finding relevant results by fusing both approaches
How to Use
Installation Steps
-
Install the skill using the Agent Skills CLI:
npx skills add https://github.com/wshobson/agents --skill hybrid-search-implementation -
Review the main documentation and code examples in
SKILL.mdwithin the skill directory. This file outlines the architecture, fusion methods, and Python code templates.
Core Concepts and Architecture
-
Hybrid Search Architecture:
- The query is run through both vector and keyword search engines.
- Candidate results from both are combined using a fusion method.
- The final ranked list is returned to the user or downstream system.
-
Fusion Methods Supported:
- Reciprocal Rank Fusion (RRF): General-purpose, easy to implement.
- Linear Fusion: Weighted sum of scores for tunable balance.
- Cross-encoder Reranking: Uses a neural model for highest quality results.
- Cascade: Filters with one method, then reranks with another for efficiency.
Example Usage
- Use the provided Python template for Reciprocal Rank Fusion to combine ranked lists from your vector and keyword search engines.
- Adapt the code to your backend stack and data sources as needed.
File Structure and Guidance
- Start with
SKILL.mdfor a conceptual overview and code templates. - Check for additional context in
README.md,AGENTS.md, and supporting folders if present. - Integrate the workflow into your own repository and backend, customizing as required for your use case.
FAQ
When should I use hybrid-search-implementation?
Use this skill when you need to improve recall in RAG systems or search engines, especially for queries that require both semantic understanding and exact keyword matching. It's particularly useful in domains with specialized vocabulary or identifiers.
What programming language is supported?
The provided templates and examples are in Python, making it suitable for Python-based backend projects.
Does this skill provide a full search engine?
No, hybrid-search-implementation provides patterns and code templates for combining existing vector and keyword search systems. You will need to integrate it with your own search infrastructure.
Where can I find the main code and documentation?
The primary documentation and code templates are in the SKILL.md file. Use the Files tab to explore the full directory structure and supporting scripts.
Is this skill suitable for frontend or UI projects?
No, this skill is focused on backend development and information retrieval logic. It is not intended for frontend or UI implementation.
