Hybrid Search Implementation

Hybrid Search Implementation

Teaches an AI agent to combine vector and keyword search with fusion methods like RRF and reranking for better retrieval in RAG and search systems.

Skill files2 files

references/

SKILL.md57 lines
1
---
2
name: hybrid-search-implementation
3
description: Combine vector and keyword search for improved retrieval. Use when implementing RAG systems, building search engines, or when neither approach alone provides sufficient recall.
4
---
5
6
# Hybrid Search Implementation
7
8
Patterns for combining vector similarity and keyword-based search.
9
10
## When to Use This Skill
11
12
- Building RAG systems with improved recall
13
- Combining semantic understanding with exact matching
14
- Handling queries with specific terms (names, codes)
15
- Improving search for domain-specific vocabulary
16
- When pure vector search misses keyword matches
17
18
## Core Concepts
19
20
### 1. Hybrid Search Architecture
21
22
```
23
Query → ┬─► Vector Search ──► Candidates ─┐
24
│ │
25
└─► Keyword Search ─► Candidates ─┴─► Fusion ─► Results
26
```
27
28
### 2. Fusion Methods
29
30
| Method | Description | Best For |
31
| ----------------- | ------------------------ | --------------- |
32
| **RRF** | Reciprocal Rank Fusion | General purpose |
33
| **Linear** | Weighted sum of scores | Tunable balance |
34
| **Cross-encoder** | Rerank with neural model | Highest quality |
35
| **Cascade** | Filter then rerank | Efficiency |
36
37
## Templates and detailed worked examples
38
39
Full template library and detailed worked examples live in `references/details.md`. Read that file when you need the concrete templates.
40
41
## Best Practices
42
43
### Do's
44
45
- **Tune weights empirically** - Test on your data
46
- **Use RRF for simplicity** - Works well without tuning
47
- **Add reranking** - Significant quality improvement
48
- **Log both scores** - Helps with debugging
49
- **A/B test** - Measure real user impact
50
51
### Don'ts
52
53
- **Don't assume one size fits all** - Different queries need different weights
54
- **Don't skip keyword search** - Handles exact matches better
55
- **Don't over-fetch** - Balance recall vs latency
56
- **Don't ignore edge cases** - Empty results, single word queries
57

© Seth Hobson · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…