wshobson avatar

Similarity Search Patterns

Solid patterns for building semantic search systems with vector databases like Pinecone and Qdrant. Covers the essentials you actually need: distance metrics, indexing strategies, batch operations, and hybrid search with reranking. The templates handle real production concerns like quantization for memory efficiency, filtering, and proper batching. One thing I appreciate is it doesn't oversell approximate search accuracy, giving you realistic recall expectations for different index types. If you're building RAG systems or recommendation engines, this gives you working code that scales beyond toy datasets.

skills.sh installs
11K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill similarity-search-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Similarity Search Patterns

Patterns for implementing efficient similarity search in production systems.

When to Use This Skill

  • Building semantic search systems
  • Implementing RAG retrieval
  • Creating recommendation engines
  • Optimizing search latency
  • Scaling to millions of vectors
  • Combining semantic and keyword search

Core Concepts

1. Distance Metrics

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

2. Index Types

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
AI & Agent Building, Debugging

More from wshobson/agents

All 174
1google avatargemini-agents-apigoogle/skillsManages custom Agent resources on Gemini Enterprise Agent Platform. Use when the user wants to programmatically create, configure, list, update, or delete state10.4Kskills.sh installs
2cursor avatardeslopcursor/pluginsRemove AI-generated code slop and clean up code style10.2Kskills.sh installs
3agricidaniel avatarseo-auditagricidaniel/claude-seoFull website SEO audit with parallel subagent delegation. Crawls up to 500 pages, detects business type, delegates to up to 15 specialists (8 always + 7 conditi8.8Kskills.sh installs
4anthropics avatarhook-developmentanthropics/claude-plugins-officialThis skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", 7.5Kskills.sh installs
5alibaba avataropen-code-reviewalibaba/open-code-reviewPerforms AI-powered code review on Git changes using the `ocr` CLI from alibaba/open-code-review. Use when the user asks to review code, review a pull request, 7.3Kskills.sh installs
6alpic-ai avatarchatgpt-app-builderalpic-ai/skybridgeGuide developers through creating and updating ChatGPT apps. Covers the full lifecycle: brainstorming ideas against UX guidelines, bootstrapping projects, imple7.2Kskills.sh installs