# Hybrid Search Implementation > Combine vector and keyword search for improved retrieval. Use when implementing RAG systems, building search engines, or when neither approach alone provides sufficient recall. Source: https://skillsagentes.com/skills/wshobson/agents/hybrid-search-implementation Repository: https://github.com/wshobson/agents Author: wshobson License: MIT Updated: hace 2 meses Context cost: 44 tok installed, 508 tok once triggered, 4.5k tok with every bundled file Bundle: 2 files, 18 KB Permissions requested: none declared ## Install ```bash npx -y skills add wshobson/agents --skill hybrid-search-implementation --agent claude-code ``` ## What it does - Combina búsqueda por similitud vectorial y búsqueda por palabras clave para mejorar el recall - Explica arquitecturas de fusión (RRF, lineal, cross-encoder, cascada) para combinar resultados - Remite a `references/details.md` para plantillas y ejemplos concretos - Da buenas prácticas: ajustar pesos empíricamente, usar RRF, añadir reranking, hacer A/B testing ## Use it when - Al construir sistemas RAG que necesitan mejor recall - Al combinar comprensión semántica con coincidencia exacta - Cuando las consultas incluyen términos específicos (nombres, códigos) - Cuando la búsqueda vectorial pura no encuentra coincidencias de palabras clave ## What triggers it - "Quiero implementar búsqueda híbrida vectorial y por palabras clave en mi RAG" - "¿Cómo combino resultados de búsqueda semántica y keyword search con RRF?" - "Ayúdame a mejorar el recall de mi motor de búsqueda con fusión de resultados" ## Files - SKILL.md — 2 KB - references/details.md — 16 KB ## SKILL.md Reproduced verbatim from wshobson/agents under MIT. This section is the upstream document and is in English. # 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 --- Skills Agentes — https://skillsagentes.com/skills/wshobson/agents/hybrid-search-implementation