HY

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.zip

Installs 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.
176 chars✓ has a “when” trigger
Advanced

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

You give it
Query string and search index configuration
You get back
Ranked search results from fused methods

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

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

When not to use it

  • Simple, single-keyword search applications
  • Systems lacking any vector embedding capability
  • Small datasets requiring low-latency exact matches

Prerequisites

Search index supporting vector and keyword fields

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.

SkillInstallsUpdatedSafetyDifficulty
hybrid-search-implementation (this skill)82moNo flagsAdvanced
vector-database-engineer84moNo flagsAdvanced
pgvector-semantic-search44moNo flagsIntermediate
sql-optimization-patterns642moNo flagsAdvanced

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

846

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.

423

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.

64220

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.

32190

postgres-patterns

affaan-m

PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.

20119

postgresql-table-design

wshobson

Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features

30109

Search skills

Search the agent skills registry