similarity-search-patterns

Detail distance metrics and index types for vector similarity search across Pinecone, Qdrant, pgvector, and Weaviate.

1|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/ccf/claude-code-ccf-marketplace --skill similarity-search-patterns-ccf
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: similarity-search-patterns
Source: https://github.com/ccf/claude-code-ccf-marketplace/tree/main/plugins/llm-application-dev/skills/similarity-search-patterns
Command: npx skills add https://github.com/ccf/claude-code-ccf-marketplace --skill similarity-search-patterns-ccf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides structured guidance for implementing efficient similarity search over vector embeddings to empower scalable semantic retrieval across large datasets.

Core Features & Use Cases

  • Distance metrics and index types: cosine, Euclidean, dot product, and index types like Flat, HNSW, IVF+PQ.
  • Cross-store templates: Pinecone, Qdrant, pgvector, and Weaviate with practical usage patterns.
  • Use Case: Build a search system that supports semantic search, RAG retrieval, and personalized recommendations at scale.

Quick Start

Use a small vector set to index documents in your selected vector store and perform a top-k similarity search to validate the workflow.

Frequently Asked Questions about similarity-search-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement similarity search for semantic retrieval at scale?▼

Similarity search over vector embeddings requires choosing the right distance metrics, such as cosine or Euclidean, and index types like HNSW or IVF+PQ to efficiently retrieve semantically similar items from millions of vectors.

What is the difference between cosine, Euclidean, and dot product distance metrics?▼

Distance metrics like cosine, Euclidean, and dot product measure vector similarity differently. Cosine focuses on angle, Euclidean measures straight-line distance, and dot product accounts for vector magnitude during similarity calculations.

Can I use pgvector or Qdrant for RAG retrieval workflows?▼

Yes, you can use pgvector or Qdrant for RAG retrieval workflows. The skill provides ready-to-adapt implementation templates for Pinecone, Qdrant, pgvector, and Weaviate to power semantic retrieval.

When should I use Flat index versus HNSW or IVF+PQ for vector embeddings?▼

Use a Flat index for exact similarity search on smaller vector sets, while HNSW and IVF+PQ index types are designed to optimize approximate nearest neighbor search across millions of vectors.

What's the best way to validate a semantic search workflow before processing millions of vectors?▼

The best way to validate a semantic search workflow is to index a small vector set in your chosen store and perform a top-k similarity search to ensure the distance metrics and retrieval process function correctly before scaling.