New to Claude Skills? Learn how to install them →

wshobson on GitHub

Hybrid Search Implementation

Free

Combine vector and keyword search for better retrieval.

by wshobson38.7k stars on wshobson/agents
1 views
Updated Jul 18, 2026
Get this skill

Free · Opens the source repo

What Hybrid Search Implementation does

The Hybrid Search Implementation skill provides a structured approach to integrating vector similarity search with traditional keyword-based search methods. This combination is particularly useful in scenarios where neither search technique alone yields satisfactory results. By leveraging both methods, users can enhance the recall of their search systems, making it ideal for applications such as Retrieval-Augmented Generation (RAG) systems and specialized search engines.

At its core, the hybrid search architecture functions by processing queries through both vector and keyword searches simultaneously. The results from these searches are then fused to produce a final set of results. The skill includes various fusion methods, such as Reciprocal Rank Fusion (RRF) for general purposes, linear combinations for tunable balances, and cross-encoders for high-quality reranking. Each method serves different needs, allowing developers to choose the most appropriate approach based on their specific requirements.

The skill also emphasizes best practices for implementation. Users are encouraged to tune weights empirically based on their datasets, utilize RRF for simplicity, and incorporate reranking to significantly improve search quality. Additionally, it highlights the importance of logging scores for debugging and conducting A/B tests to measure user impact effectively. The provided templates and detailed examples in the accompanying documentation serve as practical guides for implementing these strategies in real-world applications.

Overall, this skill is designed for developers and designers looking to build or enhance search functionalities that require a nuanced understanding of both semantic and exact matching. It is particularly beneficial in handling queries with specific terms or domain-specific vocabulary, ensuring that users receive the most relevant results based on their search criteria.

When to use it

Use this skill when developing RAG systems or search engines that need to combine semantic understanding with precise keyword matching.

When not to use it

This skill may not be suitable for simple search implementations where either vector or keyword search alone is sufficient.

What you can build with it

Building a RAG System

Implement a hybrid search to enhance the recall of a RAG system, ensuring users receive relevant results.

Domain-Specific Search Engine

Create a search engine that handles specific vocabulary effectively by combining vector and keyword search.

Improving User Query Handling

Use this skill to manage queries with specific terms, ensuring both semantic and exact matches are retrieved.

How to install Hybrid Search Implementation

View source

1. Install with the skills CLI

npx skills add wshobson/agents/hybrid-search-implementation --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by wshobson

Hybrid Search Implementation

Patterns for combining vector similarity and keyword-based search.

When to Use This Skill

  • Building RAG systems with improved recall
  • Combining semantic understanding with exact matching
  • Handling queries with specific terms (names, codes)
  • Improving search for domain-specific vocabulary
  • When pure vector search misses keyword matches

Core Concepts

1. Hybrid Search Architecture

Query → ┬─► Vector Search ──► Candidates ─┐
        │                                  │
        └─► Keyword Search ─► Candidates ─┴─► Fusion ─► Results

2. Fusion Methods

MethodDescriptionBest For
RRFReciprocal Rank FusionGeneral purpose
LinearWeighted sum of scoresTunable balance
Cross-encoderRerank with neural modelHighest quality
CascadeFilter then rerankEfficiency

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

  • Tune weights empirically - Test on your data
  • Use RRF for simplicity - Works well without tuning
  • Add reranking - Significant quality improvement
  • Log both scores - Helps with debugging
  • A/B test - Measure real user impact

Don'ts

  • Don't assume one size fits all - Different queries need different weights
  • Don't skip keyword search - Handles exact matches better
  • Don't over-fetch - Balance recall vs latency
  • Don't ignore edge cases - Empty results, single word queries

Frequently asked questions about Hybrid Search Implementation

Similar skills