Similarity Search Patterns

SkillSearch

similarity-search-patterns is a skill that helps an agent implement efficient similarity search with vector databases. It is used when building semantic search, implementing nearest neighbor queries, or optimizing retrieval performance. The skill guides the agent through patterns for storing and querying vectors so that similar items are found quickly.

Use Similarity Search Patterns in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Similarity Search Patterns and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the Similarity Search Patterns skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Have a vector database available and know how to connect to it.

Similarity Search PatternsStart free

What your AI can do with it

  • Build semantic search over a vector database
  • Implement nearest neighbor queries
  • Optimize retrieval performance
  • Store and query vector embeddings
  • Apply similarity search patterns to a dataset

Getting started

  1. Have a vector database available and know how to connect to it.
  2. Add the skill to your agent's configuration.
  3. Provide the agent with your data or embeddings to index.
  4. Ask the agent to build or optimize a similarity search query.

What this skill tells your AI

The instructions your AI receives, as published by foryourhealth111-pixel/vibe-skills in bundled/skills/similarity-search-patterns/SKILL.md and read by ahel’s review.

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

┌─────────────────────────────────────────────────┐
│                 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        │
└─────────────┴───────────────┴───────────────────┘

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

  • Use appropriate index - HNSW for most cases
  • Tune parameters - ef_search, nprobe for recall/speed
  • Implement hybrid search - Combine with keyword search
  • Monitor recall - Measure search quality
  • Pre-filter when possible - Reduce search space

Don'ts

  • Don't skip evaluation - Measure before optimizing
  • Don't over-index - Start with flat, scale up
  • Don't ignore latency - P99 matters for UX
  • Don't forget costs - Vector storage adds up

Signals

GitHub stars
4k
Forks
308
Last commit
Aug 2026

Questions

What kind of tool is similarity-search-patterns?
It is a skill that helps an agent implement efficient similarity search with vector databases, covering semantic search, nearest neighbor queries, and retrieval performance.
When should I use this skill?
Use it when building semantic search, implementing nearest neighbor queries, or optimizing retrieval performance.
Does it work with any vector database?
The skill is about patterns for similarity search with vector databases. It does not name specific databases, so you need to have one available and know how to connect to it.
Do I need to provide my own embeddings?
The skill helps with storing and querying vectors. You need to provide the data or embeddings that will be indexed for search.
Advanced
Item type
skill
Key
similarity-search-patterns
Source
github.com/foryourhealth111-pixel/vibe-skills