hybrid-search-implementation
Implementation patterns for combining vector and keyword search in RAG systems.
Install
mkdir -p .claude/skills/hybrid-search-implementation && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/455" && unzip -o skill.zip -d .claude/skills/hybrid-search-implementation && rm skill.zipInstalls to .claude/skills/hybrid-search-implementation
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Combine vector and keyword search for improved retrieval. Use when implementing RAG systems, building search engines, or when neither approach alone provides sufficient recall.Key capabilities
- →Implement Reciprocal Rank Fusion (RRF)
- →Tune hybrid search weights
- →Combine vector and keyword retrieval
- →Debug hybrid search ranking results
How it works
It merges candidates from independent vector and keyword searches using specific mathematical fusion algorithms to finalize result order.
Inputs & outputs
When to use hybrid-search-implementation
- →Building a RAG pipeline for documentation
- →Improving recall in search-heavy applications
- →Combining semantic search with exact term matching
- →Tuning hybrid search rankings
About this skill
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
| 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
When not to use it
- →Simple, single-keyword search applications
- →Systems lacking any vector embedding capability
- →Small datasets requiring low-latency exact matches
Prerequisites
Limitations
- →Requires tuning to balance vector and keyword weightings
- →Increases computational overhead compared to single-method search
- →Performance depends on the quality of underlying vector embeddings
How it compares
It provides a framework for integrating two search modalities rather than relying on a single search engine's default behavior.
Compared to similar skills
hybrid-search-implementation side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| hybrid-search-implementation (this skill) | 8 | 2mo | No flags | Advanced |
| vector-database-engineer | 8 | 4mo | No flags | Advanced |
| pgvector-semantic-search | 4 | 4mo | No flags | Intermediate |
| sql-optimization-patterns | 64 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by wshobson
View all by wshobson →You might also like
vector-database-engineer
sickn33
Expert in vector databases, embedding strategies, and semantic search implementation. Masters Pinecone, Weaviate, Qdrant, Milvus, and pgvector for RAG applications, recommendation systems, and similar
pgvector-semantic-search
timescale
Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. **Trigger when user asks to:** - Store or search vector embeddings in PostgreSQL - Set up semantic search, similarity search, or nearest neighbor search - Create HNSW or IVFFlat indexes for vectors - Implement RAG (Retrieval Augmented Generation) with PostgreSQL - Optimize pgvector performance, recall, or memory usage - Use binary quantization for large vector datasets **Keywords:** pgvector, embeddings, semantic search, vector similarity, HNSW, IVFFlat, halfvec, cosine distance, nearest neighbor, RAG, LLM, AI search Covers: halfvec storage, HNSW index configuration (m, ef_construction, ef_search), quantization strategies, filtered search, bulk loading, and performance tuning.
sql-optimization-patterns
wshobson
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.
drizzle-orm
EpicenterHQ
Drizzle ORM patterns for type branding and custom types. Use when working with Drizzle column definitions, branded types, or custom type conversions.
postgres-patterns
affaan-m
PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.
postgresql-table-design
wshobson
Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features