similarity-search-patterns
Implement efficient similarity search with vector databases.
Skill by foryourhealth111-pixel
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/foryourhealth111-pixel-similarity-search-patterns
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/similarity-search-patterns
What's inside
- Skill name
similarity-search-patterns- Description
- Implement efficient similarity search with vector databases. Use when building semantic search, implementing nearest neighbor queries, or optimizing retrieval performance.
- License
- Apache-2.0
- Instructions
- 555 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Agent Skills spec issues
- body: 555 lines (spec recommends under 500)
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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
```
┌─────────────────────────────────────────────────┐
│ 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
### Template 1: Pinecone Implementation
```python
from pinecone import Pinecone, ServerlessSpec
from typing import List, Dict, Optional
import hashlib
class PineconeVectorStore:
def __init__(
self,
api_key: str,
index_name: str,
dimension: int = 1536,
metric: str = "cosine"
):
self.pc = Pinecone(api_key=api_key)
# Create index if not exists
if index_name not in self.pc.list_indexes().names():
self.pc.create_index(
name=index_name,
dimension=dimension,
metric=metric,
spec=ServerlessSpec(cloud="aws", region="us-east-1")
)
self.index = self.pc.Index(index_name)
def upsert(
self,
vectors: List[Dict],
namespace: str = ""
) -> int:
"""
Upsert vectors.
vectors: [{"id": str, "values": List[float], "metadata": dict}]
"""
# Batch upsert
batch_size = 100
total = 0
for i in range(0, len(vectors), batch_size):
batch = vectors[i:i + batch_size]
self.index.upsert(vectors=batch, namespace=namespace)
total += len(batch)
return total
def search(
self,
query_vector: List[float],
top_k: int = 10,
namespace: str = "",
filter: Optional[Dict] = None,
include_metadata: bool = True
) -> List[Dict]:
"""Search for similar vectors."""
results = self.index.query(
vector=query_vector,
top_k=top_k,
namespace=namespace,
filter=filter,
include_metadata=include_metadata
)
return [
{
"id": match.id,
"score": match.score,
"metadata": match.metadata
}
for match in results.matches
]
def search_with_rerank(
self,
query: str,
query_vector: List[float],From foryourhealth111-pixel/Vibe-Skills, Apache-2.0.
More from foryourhealth111-pixel/Vibe-Skills
- 0.843score
prowler-docs
prowler-cloud
Prowler documentation style guide and writing standards.
SkillAFreshness: A★ 3.8KClaude Code - 0.744score
speckit-specify
github-spec-kit
Create or update feature specifications from natural language descriptions.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.741score
speckit-tasks
github-spec-kit
Break down implementation plans into actionable task lists.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.741score
speckit-plan
github-spec-kit
Generate technical implementation plans from feature specifications.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.741score
speckit-taskstoissues
github-spec-kit
Convert tasks from tasks.md into GitHub issues.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.741score
speckit-analyze
github-spec-kit
Perform cross-artifact consistency analysis across spec.md, plan.md, and tasks.md.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.741score
speckit-clarify
github-spec-kit
Structured clarification workflow for underspecified requirements.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.741score
speckit-checklist
github-spec-kit
Generate custom quality checklists for validating requirements completeness and clarity.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.741score
speckit-constitution
github-spec-kit
Create or update project governing principles and development guidelines.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.741score
speckit-implement
github-spec-kit
Execute all tasks from the task breakdown to build the feature.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.652score
astropy
foryourhealth111-pixel
Comprehensive Python library for astronomy and astrophysics.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.652score
doc
foryourhealth111-pixel
Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus…
SkillAFreshness: A★ 3.8KClaude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 3,764
- Forks
- 341
- Open issues
- 36
- Last commit (this folder)
- Feb 26, 2026 (8 months ago)
- Last release
- Oct 18, 2026 (10 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from foryourhealth111-pixel
- 0.652score
bio-database-evidence
foryourhealth111-pixel
Unified biological database evidence owner.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.652score
biopython
foryourhealth111-pixel
Primary retained Python toolkit for molecular biology sequence work.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.652score
generating-test-reports
foryourhealth111-pixel
Generate structured test reports with pass/fail rollups, coverage summaries, and test artifacts.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.652score
alpha-vantage
foryourhealth111-pixel
Access real-time and historical stock market data, forex rates, cryptocurrency prices, commodities, economic indicators, and 50+ technical indicators via the…
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.652score
astropy
foryourhealth111-pixel
Comprehensive Python library for astronomy and astrophysics.
SkillAFreshness: A★ 3.8KClaude Code +9 - 0.652score
datacommons-client
foryourhealth111-pixel
Work with Data Commons, a platform providing programmatic access to public statistical data from global sources.
SkillAFreshness: A★ 3.8KClaude Code +9
Cite this page
similarity-search-patterns skill. Agent Mart. https://agentmart.dev/skills/foryourhealth111-pixel-similarity-search-patterns (last updated 2026-10-24)