Help us improve
Share bugs, ideas, or general feedback.
From llm-application-dev
Implements efficient similarity search with vector databases for semantic search, nearest neighbor queries, and RAG retrieval.
npx claudepluginhub wshobson/agents --plugin llm-application-devHow this skill is triggered — by the user, by Claude, or both
Slash command
/llm-application-dev: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.
Implements efficient similarity search patterns with vector databases for semantic search, RAG retrieval, recommendation engines, nearest neighbor queries, and scaling to millions of vectors.
<!-- AUTO-GENERATED by export-plugins.py — DO NOT EDIT -->
Provides patterns and Python templates for similarity search with vector databases, including metrics, indexes, and Pinecone implementation. Use for semantic search, RAG, recommendations, and scaling.
Share bugs, ideas, or general feedback.
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.