From wshobson-similarity-search-patterns
Implements efficient similarity search with vector databases for semantic search, RAG retrieval, and recommendation engines.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wshobson-similarity-search-patterns:similarity-search-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Patterns for implementing efficient similarity search in production systems.
Patterns for implementing efficient similarity search in production systems.
| Metric | Formula | Best For | | ------------------ | ------------------ | --------------------- | --- | -------------- | | Cosine | 1 - (A·B)/(‖A‖‖B‖) | Normalized embeddings | | Euclidean (L2) | √Σ(a-b)² | Raw embeddings | | Dot Product | A·B | Magnitude matters | | Manhattan (L1) | Σ | a-b | | Sparse vectors |
┌─────────────────────────────────────────────────┐
│ Index Types │
├─────────────┬───────────────┬───────────────────┤
│ Flat │ HNSW │ IVF+PQ │
│ (Exact) │ (Graph-based) │ (Quantized) │
├─────────────┼───────────────┼───────────────────┤
│ O(n) search │ O(log n) │ O(√n) │
│ 100% recall │ ~95-99% │ ~90-95% │
│ Small data │ Medium-Large │ Very Large │
└─────────────┴───────────────┴───────────────────┘
Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.
npx claudepluginhub aiskillstore/marketplace --plugin wshobson-similarity-search-patterns2plugins reuse this skill
First indexed Jun 3, 2026
Implements efficient similarity search with vector databases for semantic search, RAG retrieval, and recommendation engines.
Implements efficient similarity search with vector databases for semantic search, nearest neighbor queries, and RAG retrieval.
Implements efficient similarity search with vector databases for semantic search, nearest neighbor queries, and retrieval optimization.