Hybrid Search Implementation
Seth HobsonCommunityCreated by Seth Hobson
- Skill
- Guidelines
- Data and AI
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to implementing hybrid search, which merges vector similarity with keyword-based retrieval. By combining these two methods, developers can achieve better recall, especially when handling domain-specific vocabulary, exact matches, or queries that pure semantic search might miss. The skill covers architectural patterns, fusion methods like Reciprocal Rank Fusion (RRF) and linear combination, and best practices for tuning and testing search performance.
What it does
- Defines the architecture for combining vector and keyword search results.
- Provides implementation templates for Reciprocal Rank Fusion (RRF).
- Offers logic for linear combination of search scores.
- Outlines database schema patterns for hybrid search using PostgreSQL.
- Suggests best practices for tuning weights and evaluating search quality.
- Provides guidance on when to use specific fusion methods like reranking or cascading.
When to use it
- When building RAG systems that require higher retrieval accuracy.
- When your current vector search fails to capture exact keyword matches.
- When dealing with domain-specific terminology or product codes.
- When you need to balance semantic understanding with precise term matching.
- When you want to improve search recall without relying on a single retrieval method.
Advantages
- Improves retrieval recall by leveraging both semantic and exact matching.
- Provides flexible fusion methods to suit different search requirements.
- Includes actionable templates for common database implementations.
- Encourages empirical tuning and A/B testing for optimal performance.
- Helps address edge cases where single-method search is insufficient.
Usage examples
- “How do I combine vector and keyword search results?”
- The skill provides a conceptual architecture and specific Python templates for Reciprocal Rank Fusion (RRF) and linear combination to merge ranked lists from different search methods.
- “What is the best way to implement hybrid search in PostgreSQL?”
- The skill includes a template for setting up a PostgreSQL schema with pgvector for vector search and GIN indexes for full-text search, enabling efficient hybrid queries.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/wshobson/hybrid-search-implementation/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip hybrid-search-implementation.zip -d .agents/skills
Documentation by Seth Hobson
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 ─► Results2. Fusion Methods
| Method | Description | Best For |
|---|---|---|
| RRF | Reciprocal Rank Fusion | General purpose |
| Linear | Weighted sum of scores | Tunable balance |
| Cross-encoder | Rerank with neural model | Highest quality |
| Cascade | Filter then rerank | Efficiency |
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
Files
- ATTRIBUTION.mdAdded by AutoGineer1022 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md2.0 KiB
- references/details.md15.8 KiB
SKILL.md
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 ─► Results2. Fusion Methods
| Method | Description | Best For |
|---|---|---|
| RRF | Reciprocal Rank Fusion | General purpose |
| Linear | Weighted sum of scores | Tunable balance |
| Cross-encoder | Rerank with neural model | Highest quality |
| Cascade | Filter then rerank | Efficiency |
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
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Seth Hobson
- Publisher
- Seth Hobson (Community)
- Source
- wshobson/agents · plugins/llm-application-dev/skills/hybrid-search-implementation · commit 4bde316
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Seth Hobson or Seth Hobson.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download hybrid-search-implementation.zip