All skills
wshobson avatar

/hybrid-search-implementation

@be57c0b
by Seth Hobsonwshobson/agents40k stars
4,281

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

Use this Skill: https://skilld.dev/gh/wshobson/agents/hybrid-search-implementation

This session only. Nothing lands on disk.

SKILL.md

≈52 tokens always: the name and description. ≈450 when used: this file. ≈4k more on demand in 1 file.

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

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides safe, high-quality reference implementation patterns and code templates for combining vector and keyword search (hybrid search) using various platforms including PostgreSQL, Elasticsearch, and custom pipelines. No security vulnerabilities, malicious intent, or suspicious behaviors were identified.

  • Socket16d

    1 alert: gptAnomaly

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at be57c0b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 4 months ago
  • hybrid-search
  • vector-search
  • keyword-search
  • rag
  • retrieval
  • search-ranking
  • fusion
  • reranking

README badge

README badge for wshobson/agents/hybrid-search-implementation

Combines vector similarity and keyword search for improved retrieval in RAG systems and search engines. Provides fusion methods (RRF, linear weighting, cross-encoder reranking, cascade filtering) to balance semantic understanding with exact term matching, handling domain-specific vocabulary and queries vector search alone would miss.

Generated from the current SKILL.md.

What fusion methods does this skill cover?
The skill covers RRF (Reciprocal Rank Fusion), linear weighted sum, cross-encoder reranking, and cascade filtering. RRF is recommended for general-purpose use without tuning.
Does this skill include concrete implementation templates?
Yes. Detailed templates and worked examples are in references/details.md within the skill.
What search libraries or frameworks does this integrate with?
The SKILL.md does not specify integration with particular search libraries or frameworks. It focuses on architectural patterns and fusion methods that can be applied across different search backends.
Can this improve vector-only search recall?
Yes. Combining vector search with keyword search improves recall by handling exact matches and domain-specific vocabulary that pure vector search may miss.

Generated from the current SKILL.md. These answers refresh after source changes.