본문으로 건너뛰기
Skillpedia
머신러닝41k · #6726

similarity-search-patterns

하는 일

이 도구는 '비슷한 항목'을 찾는 것처럼 대규모 데이터셋에서 비슷한 정보를 찾도록 돕습니다. 이를 빠르고 효율적으로 하기 위해 고급 기법을 사용합니다.

사용하는 경우

  • ✓질의의 의미를 이해하는 검색 시스템을 만들고 싶을 때.
  • ✓문서를 바탕으로 질문에 답하는 시스템을 만들 때.
  • ✓상품이나 콘텐츠에 대한 개인화 추천을 만들 때.

스킬 링크

https://github.com/wshobson/agents/blob/main/plugins/llm-application-dev/skills/similarity-search-patterns/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/llm-application-dev/skills/similarity-search-patterns/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“비건 요리에 관한 이 글과 비슷한 문서를 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

내부적으로 데이터를 숫자(벡터)로 바꾸고, 수학적 방법으로 어떤 숫자들이 서로 가장 가까운지 계산합니다. 매우 빠른 검색을 위해 이 숫자들을 특별한 색인으로 정리합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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 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
자주 묻는 질문

'거리 지표'란 무엇인가요?

두 숫자 집합(벡터)이 서로 얼마나 '멀리' 또는 '가까이' 있는지 측정하는 수학 공식입니다. 비슷한 정보를 찾는 데 도움을 줍니다.

'색인 유형'이란 무엇인가요?

숫자 데이터를 정리해 검색을 더 빠르게 하는 다양한 방식입니다. 어떤 것은 더 정확하고, 어떤 것은 더 빠르며, 데이터 크기에 따라 알맞은 방식이 다릅니다.

'하이브리드 검색'이란 무엇인가요?

의미 기반(시맨틱) 검색과 정확한 키워드 검색을 결합하는 것입니다. 의미상 관련 있으면서 입력한 단어도 포함된 결과를 찾을 수 있습니다.

상세 정보

작성자의 원본 설명

Implement efficient similarity search with vector databases. Use when building semantic search, implementing nearest neighbor queries, or optimizing retrieval performance.

repo: wshobson/agents

인기도

GitHub 스타
41k
순위
#6726
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬