similarity-search-patterns
Build production similarity search with vector databases
متاح أيضًا من: wshobson
Vector similarity search is essential for semantic search and RAG systems but requires careful index selection and tuning. This skill provides ready-to-use patterns for Pinecone, Qdrant, pgvector, and Weaviate with hybrid search and reranking.
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "similarity-search-patterns". Set up Qdrant for 1 million product embeddings with 95% recall target
النتيجة المتوقعة:
- Collection created with HNSW index (m=16, ef_construct=64)
- Scalar quantization enabled (INT8) reducing memory by 4x
- Recommended search params: ef=128 for 95% recall at ~50ms P99
استخدام "similarity-search-patterns". Hybrid search for documents about 'machine learning optimization'
النتيجة المتوقعة:
- Vector search retrieves 20 semantically similar documents
- BM25 filters for exact term matches on 'optimization'
- Reranked results combine both signals with 0.6/0.4 weighting
التدقيق الأمني
آمنAll 31 static analysis findings are false positives. The scanner incorrectly flagged Markdown documentation syntax as executable code. Backticks are code fence markers, URLs are documentation links, and API key parameters represent secure credential handling. The skill contains Python code examples for vector database implementations with no security concerns.
درجة الجودة
ماذا يمكنك بناءه
RAG Application Builder
Implement retrieval-augmented generation with efficient vector search over document embeddings. Supports hybrid search combining semantic and keyword matching for accurate context retrieval.
Recommendation Engine Developer
Build nearest-neighbor recommendation systems using vector embeddings. Leverage HNSW indexing for sub-second queries over millions of items with configurable recall thresholds.
Search Platform Engineer
Deploy production similarity search infrastructure with PostgreSQL pgvector or managed services. Implement pre-filtering and reranking pipelines for enterprise search quality.
جرّب هذه الموجهات
I need to store and search document embeddings. Help me set up a Pinecone vector index with cosine similarity for 1536-dimensional embeddings. Include upsert and search functions with metadata filtering.
Create a hybrid search function that combines vector similarity with keyword matching using pgvector. Weight vector search at 0.7 and full-text search at 0.3. Include the SQL schema with HNSW index.
I have 50 vector search results but need better ranking. Show me how to rerank with a cross-encoder model. Include the sentence-transformers code and explain the tradeoff between latency and accuracy.
I have 10 million vectors and need P99 latency under 100ms with 95% recall. Recommend an index type and parameters for Qdrant. Explain ef_construct, nprobe, and quantization settings for my use case.
أفضل الممارسات
- Start with flat index for small datasets (under 100K vectors) and migrate to HNSW as data grows
- Always measure recall at your target latency before deploying approximate indexes
- Use metadata pre-filtering to reduce search space before vector comparison
تجنب
- Using approximate nearest neighbor indexes without measuring recall degradation
- Storing raw vectors without quantization when memory is constrained
- Querying without pre-filters causing full index scans on large collections
الأسئلة المتكررة
Which vector database should I choose for my project?
What is the difference between cosine similarity and dot product?
How do I improve search recall without sacrificing latency?
Can I update vectors after insertion?
What embedding dimension should I use?
How do I handle multilingual search?
تفاصيل المطور
المؤلف
sickn33الترخيص
MIT
المستودع
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/similarity-search-patternsمرجع
main
بنية الملفات