PluginBench
Skill
Pass
Audit score 90

mongodb-search-and-ai

mongodb/agent-skills

Implement Atlas Search, Vector Search, and Hybrid Search for MongoDB with guided indexing and query optimization.

What is mongodb-search-and-ai?

Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions. Use this skill when building search functionality for text queries, semantic similarity, or combined approaches, including autocomplete, fuzzy matching, faceted search, and RAG applications.

  • Recommends the right search type (lexical, vector, or hybrid) based on use case
  • Inspects existing MongoDB schemas and indexes to inform decisions
  • Creates and optimizes search indexes with explicit approval workflow
  • Constructs and validates aggregation pipelines for search queries
  • Handles read-only scenarios by providing index configuration JSON for manual creation
  • Validates MongoDB version requirements for advanced features like rank/score fusion

How to install mongodb-search-and-ai

npx skills add https://github.com/mongodb/agent-skills --skill mongodb-search-and-ai
Prerequisites
  • MongoDB Atlas cluster with Search or Vector Search enabled
  • MongoDB MCP server connection configured
  • Existing MongoDB collection with data to index
Claude Code
Cursor
Windsurf
Cline

How to use mongodb-search-and-ai

  1. 1.Describe your search use case (keywords, semantic similarity, filters, autocomplete)
  2. 2.Allow the skill to inspect your collection schema and existing indexes
  3. 3.Review the recommended search type and index configuration
  4. 4.Approve index creation or receive JSON configuration for manual setup via Atlas UI
  5. 5.Test the generated aggregation pipeline query against your data
  6. 6.Refine and optimize based on results and performance metrics

Use cases

Good for
  • Building autocomplete and typeahead functionality with fuzzy matching
  • Implementing semantic search for RAG applications using vector embeddings
  • Creating hybrid search combining keyword filtering with semantic similarity
  • Adding faceted search with multiple field filters and relevance scoring
  • Optimizing full-text search across variable field combinations
Who it's for
  • MongoDB developers building search features
  • Backend engineers implementing RAG or semantic search
  • Database architects optimizing search performance
  • Teams migrating from regex/$text operators to Atlas Search

mongodb-search-and-ai FAQ

When should I use Atlas Search vs Vector Search?

Use Atlas Search for keyword matching, fuzzy matching, autocomplete, and faceted filtering. Use Vector Search for semantic similarity, natural language understanding, and RAG applications. Use Hybrid Search when you need both approaches combined.

What if I don't have permission to create indexes?

The skill operates in read-only mode and provides complete index configuration JSON that you can create manually through the MongoDB Atlas UI or with appropriate credentials.

Can I use $regex or $text for search?

No. These operators lack relevance scoring, fuzzy matching, and language-aware tokenization. Atlas Search is the recommended approach for production search workloads.

What MongoDB versions support Hybrid Search with rank/score fusion?

$rankFusion requires MongoDB 8.0+, and $scoreFusion requires MongoDB 8.2+. The skill verifies your cluster version before recommending these features.

How do I optimize search performance?

The skill inspects your schema and existing indexes, recommends appropriate configurations, and helps construct efficient aggregation pipelines tailored to your specific use case.

Full instructions (SKILL.md)

Source of truth, from mongodb/agent-skills.


name: mongodb-search-and-ai description: | 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. license: Apache-2.0 metadata: version: "1.0.0"

MongoDB Search and AI Recommendations Skill

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.

Core Principles

  1. Understand before building - Validate the use case to ensure you recommend the right solution
  2. Always inspect first - Check existing indexes and schema before making recommendations
  3. Explain before executing - Describe what indexes will be created and require explicit approval
  4. Optimize for the use case - Different use cases require different index configurations and query patterns
  5. Handle read-only scenarios - If you do not have access to 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.

Workflow

1. Discovery Phase

Check the environment:

  • Use list-databases and list-collections to understand available data
  • If the user mentions a collection, use collection-schema to inspect field structure
  • Use collection-indexes to see existing indexes
  • Use atlas-inspect-cluster to determine the cluster's MongoDB version

Understand the use case: If the user's request is vague:

  • Ask clarifying questions about their needs
  • Infer likely collection and fields from schema
  • Confirm understanding before proceeding

Common questions to ask:

  • What are users searching for? (products, movies, documents, etc.)
  • What fields contain the searchable content?
  • Do they need exact matching, fuzzy matching, or semantic similarity?
  • Do they need filters (price ranges, categories, dates)?
  • Do they need autocomplete/typeahead functionality?

2. Determine Search Type

Atlas Search (Lexical/Full-Text): Use when users need:

  • Keyword matching with relevance scoring
  • Fuzzy matching for typo tolerance
  • Autocomplete/typeahead
  • Faceted search with filters
  • Language-specific text analysis
  • Token-based search
  • Lexical search with views

Vector Search (Semantic): Use when users need:

  • Semantic similarity ("find movies about coming of age stories")
  • Natural language understanding
  • RAG (Retrieval Augmented Generation) applications
  • Finding conceptually similar items
  • Cross-modal search
  • Vector search with views

Hybrid Search: Use when users need:

  • Combining multiple search approaches (e.g., vector + lexical, multiple text searches)
  • Queries like "find action movies similar to 'epic space battles'" (combining keyword filtering with semantic similarity)
  • Results that factor in multiple relevance criteria
  • Uses $rankFusion (rank-based) or $scoreFusion (score-based) to merge pipelines

3. Version Check (Hybrid Search only)

If 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.

4. Consult Reference Files

Always consult the appropriate reference file(s) before recommending indexes or queries:

  • Lexical: consult both references/lexical-search-indexing.md (index) and references/lexical-search-querying.md (query)
  • Vector: consult references/vector-search.md
  • Hybrid: consult references/hybrid-search.md (and the lexical/vector files for the individual pipeline stages within it)

5. Execution and Validation

Creating indexes:

  1. Explain the index configuration in plain language
  2. Show the JSON structure
  3. Ask what the user wants to name the index
  4. Get explicit approval: "Should I create this index?"
  5. Use MCP's create-index tool after approval
  6. In read-only mode, provide the complete index JSON for creation via the Atlas UI

Running queries:

  1. Show the aggregation pipeline
  2. Execute using MCP's aggregate tool
  3. Present results clearly

Refining existing queries:

  1. Ask the user to share their current query
  2. Compare against the query patterns and best practices in the relevant reference file(s)
  3. Propose specific improvements with before/after examples
  4. Run the revised query with aggregate to validate the results

Anti-Patterns to Avoid

NEVER recommend $regex or $text for search use cases:

  • $regex: Not designed for full-text search. Lacks relevance scoring, fuzzy matching, and language-aware tokenization.
  • $text: Legacy operator that doesn't scale well for search workloads.

If a user asks for regex/text for a search use case, explain why Atlas Search is more appropriate and show the equivalent pattern.

Handling Edge Cases

User mentions fields you can't find:

  • Use collection-schema to inspect available fields
  • Suggest alternatives or ask for clarification

Required field doesn't exist:

  • Explain what needs to be added and how (e.g., embedding field for vector search)

Query fails or index missing:

  • Use collection-indexes to verify index exists
  • If missing, explain index needs to be created first

Multiple collections are relevant:

  • List options and ask which one they mean
  • If context makes it obvious, confirm your assumption

Remember

  • Always check existing indexes before recommending new ones
  • Explain technical concepts in accessible language
  • Require approval before creating indexes
  • Map user's business requirements to technical implementations
  • Use the appropriate search type for the use case

Related skills

More from mongodb/agent-skills and the wider catalog.

MOmongodb-atlas-stream-processing logo

mongodb-atlas-stream-processing

mongodb/agent-skills

Manages MongoDB Atlas Stream Processing (ASP) workflows. Handles workspace provisioning, data source/sink connections, processor lifecycle operations, debugging diagnostics, and tier sizing. Supports Kafka, Atlas clusters, S3, HTTPS, and Lambda integrations for streaming data workloads and event processing. NOT for general MongoDB queries or Atlas cluster management. Requires MongoDB MCP Server with Atlas API credentials.

1.2k installs
MOmongodb-connection logo

mongodb-connection

mongodb/agent-skills

Optimize MongoDB client connection configuration for pools, timeouts, and patterns across all driver languages.

2.2k installsAudited
MOmongodb-mcp-setup logo

mongodb-mcp-setup

mongodb/agent-skills

Configure MongoDB MCP server authentication and access control for agentic clients.

1.8k installs
MOmongodb-natural-language-querying logo

mongodb-natural-language-querying

mongodb/agent-skills

Generate MongoDB read-only queries and aggregation pipelines from natural language descriptions.

2.0k installsAudited
BD

bdd-feature-generator

moxa/sw

Agent skill from moxa/sw.

1.2k installs
AEaesthetic logo

aesthetic

mrgoonie/claudekit-skills

Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

633 installs