Hybrid Search Implementation

by wshobson46891e7e60daNo licenseListed Oct 8, 2026Updated Oct 8, 2026

Combine vector and keyword search for improved retrieval. Use when implementing RAG systems, building search engines, or when neither approach alone provides sufficient recall.

Instructions onlyAI & Agents
AI-generated overview

Patterns for combining vector similarity and keyword search in retrieval systems.

What it does
This skill provides guidance on hybrid search architectures that combine vector similarity with keyword-based search. It covers fusion methods such as Reciprocal Rank Fusion, linear weighted scoring, cross-encoder reranking, and cascade filtering, along with best practices for tuning and evaluation. It points to a reference file containing templates and worked examples.
When to use it
Use it when implementing RAG systems or search engines where neither pure vector nor pure keyword search gives sufficient recall. It is also relevant for queries containing specific terms such as names or codes, and for domain-specific vocabulary.
Requirements
No scripts or tools are required; it is an instructions-only skill. It references a companion file, references/details.md, for templates and worked examples.

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

Source and attribution

Source:wshobson/agentsinplugins/llm-application-dev/skills/hybrid-search-implementationat commit46891e7

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal