Skip to content
hybrid-search-implementation logo

Hybrid Search Implementation

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.

wshobson/agents10.3Kinstalls40.2Kstars

SKILL.md

Full skill instructions

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

More skills from wshobson

Comprehensive testing strategies for Python using pytest, fixtures, mocking, and test-driven development.

40.2K 34.6K
View

Profile and optimize Python code using cProfile, memory profilers, and performance best practices.

40.2K 34.4K
View

Comprehensive patterns for Next.js 14+ App Router, Server Components, and modern full-stack React development.

40.2K 31.5K
View
code-review-excellence logo
wshobson/agents

code-review-excellence

Systematic code review practices for constructive feedback, bug detection, and team knowledge sharing.

40.2K 29.4K
View
api-design-principles logo
wshobson/agents

api-design-principles

REST and GraphQL API design principles for building scalable, developer-friendly APIs.

40.2K 29.4K
View

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features

40.2K 26.9K
View

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features

40.2K 26.9K
View
fastapi-templates logo
wshobson/agents

fastapi-templates

Production-ready FastAPI project structure with async patterns, dependency injection, and layered architecture.

40.2K 25.2K
View
mobile-android-design logo
wshobson/agents

mobile-android-design

Material Design 3 and Jetpack Compose patterns for building modern, adaptive Android applications.

40.2K 23.7K
View
e2e-testing-patterns logo
wshobson/agents

e2e-testing-patterns

Comprehensive guide to building reliable, maintainable end-to-end test suites with Playwright and Cypress.

40.2K 23.6K
View
architecture-patterns logo
wshobson/agents

architecture-patterns

Implement proven backend architecture patterns for maintainable, testable, and scalable systems.

40.2K 23.3K
View
mobile-ios-design logo
wshobson/agents

mobile-ios-design

Native iOS app design with SwiftUI, Apple HIG compliance, and adaptive layouts for iPhone and iPad.

40.2K 22.9K
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View