MongoDB ユーザーが Atlas Search(全文検索)、Vector Search(意味的検索)、Hybrid Search(組み合わせ検索)を実装・最適化する際のガイドです。 次のような場合に使用: - テキストベースの検索機能を構築する必要がある場合 - オートコンプリート(入力補助)、あいまい検索、ファセット検索(カテゴリ別絞込) - 意味的な類似性を扱う場合 - 埋め込み表現やRAG応用(生成AIに外部知識を統合する手法) - テキスト照合機能が必要な場合 - 部分文字列の検索、大文字小文字を区別しない検索、複数フィールドの同時検索 - 様々な条件の組み合わせで多くのフィールドをフィルタリングする場合 このスキルは、適切な検索タイプの選択、インデックスの作成、クエリの構築、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 prefilter パターン(vectorSearch オペレータを $search 内で使用)の場合は、次のステップに進みます。
インデックスまたはクエリを推奨する前に、常に適切なリファレンスファイルを確認:
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 による自動翻訳です。