Hybrid Search Implementation

作者 wshobson46891e7e60da无许可证收录于 2026年10月8日更新于 2026年10月8日

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

仅含说明AI & Agents
AI 生成的概览

用于在检索系统中结合向量相似度与关键词搜索的模式。

功能
该技能提供关于混合搜索架构的指导,将向量相似度与基于关键词的搜索相结合。内容涵盖融合方法,如倒数排名融合、线性加权评分、交叉编码器重排序和级联过滤,并给出调优与评估的最佳实践。它指向一个包含模板和完整示例的参考文件。
适用场景
适用于实现 RAG 系统或搜索引擎,且纯向量或纯关键词搜索都无法提供足够召回率的场景。也适用于包含名称、代码等特定词的查询,以及领域特定词汇的检索。
运行要求
无需脚本或工具,仅为说明性技能。它引用配套文件 references/details.md 以获取模板和完整示例。

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

来源与署名

来源:wshobson/agents位于plugins/llm-application-dev/skills/hybrid-search-implementation提交46891e7

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架