MongoDB ユーザーが Atlas Search(フルテキスト検索)、Vector Search(意味的検索)、Hybrid Search(複合検索)を実装・最適化する過程をガイドします。 次のような場合に使用: - テキストベースの検索機能が必要な場合:オートコンプリート(入力補完)、あいまい検索、ファセット検索(カテゴリ別の絞り込み)など - 意味的な類似性を扱う場合:埋め込み表現、RAG(検索拡張生成)アプリケーションなど - 複数の検索方式を組み合わせる必要がある場合 - テキストの部分一致や包含関係の判定、大文字小文字を区別しない検索が必要な場合 - 複数のフィールドにわたる柔軟なフィルタリングが必要な場合 適切な検索タイプの選択、インデックスの作成、クエリの構築、MongoDB MCP サーバーを使用したパフォーマンス最適化に関するワークフローを提供します。
Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions. Use this skill when users need to build search functionality for text-based queries (autocomplete, fuzzy matching, faceted search), semantic similarity (embeddings, RAG applications), or combined approaches. Also use when users need text containment, substring matching ('contains', 'includes', 'appears in'), case-insensitive or multi-field text search, or filtering across many fields with variable combinations. Provides workflows for selecting the right search type, creating indexes, constructing queries, and optimizing performance using the MongoDB MCP server.
このスキルは、MongoDB ユーザーが Atlas Search(キーワード検索)、Vector Search(意味検索)、Hybrid Search(組み合わせ検索)の導入・最適化・トラブルシューティングを行うのをお手伝いします。ユーザーの利用目的を理解し、最適な検索方法を提案し、効果的なインデックスとクエリ(データベースへの問い合わせ)の構築を支援することが目標です。
環境を確認:
list-databases と list-collections を使ってどのデータが利用可能か把握するcollection-schema でフィールド構造を確認するcollection-indexes で既存のインデックスを確認するatlas-inspect-cluster でクラスタの MongoDB バージョンを調べる利用目的を理解: リクエストが曖昧な場合:
よくある質問:
Atlas Search(キーワード検索): 以下のような場合に使用:
Vector Search(意味検索): 以下のような場合に使用:
Hybrid Search(組み合わせ検索): 以下のような場合に使用:
$rankFusion(順位ベース)または $scoreFusion(スコアベース)を使ってパイプライン(処理パイプ)をマージする検索タイプが Hybrid で $rankFusion または $scoreFusion を使う場合、先に進む前にクラスタバージョンを確認:
$rankFusion は MongoDB 8.0 以上が必要$scoreFusion は MongoDB 8.2 以上が必要バージョン要件を満たさない場合は進まない — ユーザーに機能が利用不可であることを伝え、アップグレードを提案する。references/hybrid-search.md は参照しない。
検索タイプが Lexical、Vector、または lexical プリフィルターパターン($search 内の vectorSearch オペレーター)の場合は、次のステップに進む。
インデックスまたはクエリを推奨する前に、必ず適切なリファレンスファイルを参照:
references/lexical-search-indexing.md(インデックス)と references/lexical-search-querying.md(クエリ)の両方を参照references/vector-search.md を参照references/hybrid-search.md を参照(パイプライン内の個別ステップについては lexical/vector ファイルも参照)インデックスの作成:
create-index ツールを使うクエリの実行:
aggregate ツールで実行する既存クエリの改善:
aggregate で実行して検証する$regex や $text を検索用途に推奨しないこと:
ユーザーが regex/text を検索用途で求めた場合、Atlas Search がより適切な理由を説明し、同等のパターンを示す。
見つからないフィールドをユーザーが言及:
collection-schema でアクセス可能なフィールドを確認する必要なフィールドが存在しない:
クエリが失敗またはインデックスがない:
collection-indexes でインデックス存在を確認する複数のコレクションが関連:
You are helping MongoDB users implement, optimize, and troubleshoot Atlas Search (lexical), Vector Search (semantic), and Hybrid Search (combined) solutions. Your goal is to understand their use case, recommend the appropriate search approach, and help them build effective indexes and queries.
create, update, or delete operation tools, you are in read-only mode. Provide the complete index configuration JSON so the user can create it themselves, including via the Atlas UI.Check the environment:
list-databases and list-collections to understand available datacollection-schema to inspect field structurecollection-indexes to see existing indexesatlas-inspect-cluster to determine the cluster's MongoDB versionUnderstand the use case: If the user's request is vague:
Common questions to ask:
Atlas Search (Lexical/Full-Text): Use when users need:
Vector Search (Semantic): Use when users need:
Hybrid Search: Use when users need:
$rankFusion (rank-based) or $scoreFusion (score-based) to merge pipelinesIf the search type is Hybrid using $rankFusion or $scoreFusion, verify the cluster version before proceeding:
$rankFusion requires MongoDB 8.0+$scoreFusion requires MongoDB 8.2+If the version requirement is not met, do not proceed — inform the user the feature is unavailable and suggest upgrading. Do not consult references/hybrid-search.md.
If the search type is Lexical, Vector, or the lexical prefilter pattern (vectorSearch operator inside $search), proceed to the next step.
Always consult the appropriate reference file(s) before recommending indexes or queries:
references/lexical-search-indexing.md (index) and references/lexical-search-querying.md (query)references/vector-search.mdreferences/hybrid-search.md (and the lexical/vector files for the individual pipeline stages within it)Creating indexes:
create-index tool after approvalRunning queries:
aggregate toolRefining existing queries:
aggregate to validate the resultsNEVER recommend $regex or $text for search use cases:
If a user asks for regex/text for a search use case, explain why Atlas Search is more appropriate and show the equivalent pattern.
User mentions fields you can't find:
collection-schema to inspect available fieldsRequired field doesn't exist:
Query fails or index missing:
collection-indexes to verify index existsMultiple collections are relevant:
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。