PluginBench
Skill
Official
Pass
Audit score 90

mongodb-search-and-ai

mongodb/agent-skills

Implement and optimize Atlas Search, Vector Search, and Hybrid Search for MongoDB applications.

What is mongodb-search-and-ai?

Guides MongoDB users through building full-text, semantic, and hybrid search solutions. Use this skill when you need to add search functionality—keyword matching with relevance scoring, semantic similarity via embeddings, or combined approaches—and want to create indexes, construct queries, and optimize performance using the MongoDB MCP server.

  • Recommend the right search type (lexical, vector, or hybrid) based on use case
  • Create and optimize Atlas Search indexes for full-text, fuzzy, and faceted search
  • Build Vector Search indexes for semantic similarity with embeddings
  • Combine multiple search approaches using Hybrid Search with rank or score fusion
  • Construct and refine aggregation pipelines for search queries
  • Inspect schemas, existing indexes, and cluster configuration before making changes

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 (M10 or higher for Atlas Search; M0 for Vector Search with Automated Embedding)
  • MongoDB MCP server configured and connected
  • Existing MongoDB collection with text or vector data
  • For Vector Search: pre-generated embeddings or Voyage AI API key for Automated Embedding
Claude Code
Cursor
Windsurf
Cline

How to use mongodb-search-and-ai

  1. 1.Describe your search use case (keyword matching, semantic similarity, or both)
  2. 2.The skill will inspect your collection schema and existing indexes
  3. 3.Receive a recommendation for the appropriate search type and index configuration
  4. 4.Review and approve the proposed index before creation
  5. 5.Execute search queries and refine them based on results

Use cases

Good for
  • Implement autocomplete and typeahead for product catalogs with fuzzy matching
  • Build semantic search for finding similar documents or items by meaning
  • Create a RAG (Retrieval-Augmented Generation) system with vector embeddings
  • Combine keyword filtering with semantic similarity (e.g., 'find action movies similar to X')
  • Add multi-field text search with language-specific analysis and relevance scoring
Who it's for
  • MongoDB developers building search features
  • Backend engineers implementing RAG or AI agent memory systems
  • Data engineers optimizing search performance on Atlas clusters
  • Teams migrating from regex or $text operators to production search

mongodb-search-and-ai FAQ

When should I use Atlas Search vs. Vector Search?

Use Atlas Search for keyword matching, fuzzy search, autocomplete, and faceted filtering. Use Vector Search for semantic similarity based on embeddings. Use Hybrid Search when you need both together.

Do I need to generate embeddings myself for Vector Search?

No. MongoDB's Automated Embedding (with Voyage AI) generates and manages embeddings automatically. Use it for quick setup with text data. Bring your own embeddings if you need a specific model or non-text data.

Why shouldn't I use $regex or $text for search?

Both lack relevance scoring, fuzzy matching, and language-aware tokenization. Atlas Search provides all three and scales better for production search workloads.

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

The skill will provide the complete index configuration JSON so you can create it via the MongoDB Atlas UI or share it with an admin.

Can I combine multiple search approaches in one query?

Yes, using Hybrid Search. You can merge lexical and vector pipelines with $rankFusion (rank-based) or $scoreFusion (score-based) to combine relevance signals.

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.
  6. Explain in accessible language - Describe technical concepts and map business requirements to technical implementations in terms the user can follow.

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?
  • Are they searching by free text, or by similarity to an existing item (e.g. "given movie A, find similar movies")?
  • Do they need exact matching, fuzzy matching, or semantic similarity?
  • Do they need filters (price ranges, categories, dates)?
  • Do they need autocomplete/typeahead functionality?
  • Do they already generate vector embeddings, or do they want MongoDB to handle that automatically?

2. Determine Search Type and Consult the Reference File

Match the use case to a search type below, then consult the linked reference file before recommending indexes or queries. Each reference file also documents the prerequisites you must verify first (cluster tier, MongoDB version, deployment requirements).

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

→ Consult both references/lexical-search-indexing.md (index) and references/lexical-search-querying.md (query).

Automated Embedding (Semantic search, no embedding code): Use when users need:

  • Semantic / vector search without writing embedding code
  • No existing vector pipeline or embedding infrastructure
  • Quick setup: MongoDB auto-generates and manages embeddings using Voyage AI models
  • Text data already stored in Atlas that they want to search by meaning
  • RAG or AI agent memory with minimal setup

→ Consult references/automated-embedding.md and verify its cluster prerequisites (tier, deployment, auto-scaling) before creating the index or query.

Vector Search (Semantic, bring your own embeddings): Use when users need:

  • Semantic similarity with their own pre-generated embeddings
  • A specific embedding model not provided by Voyage AI
  • Image, audio, or multimodal embeddings (Automated Embedding is text-only)
  • Self-managed MongoDB without Voyage AI API key configured
  • Vector search with views

→ Consult references/vector-search.md.

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

→ Consult references/hybrid-search.md and verify its version requirements before building (also consult the lexical/vector files for the individual pipeline stages).

3. 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. Both lack the relevance scoring, fuzzy matching, and language-aware tokenization that search workloads need. If a user asks for either, 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

Related skills

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

MOmongodb-atlas-stream-processing logo

mongodb-atlas-stream-processing

Official
mongodb/agent-skills

Manage MongoDB Atlas Stream Processing pipelines, connections, and workspaces via MCP tools.

3.0k installs
MOmongodb-connection logo

mongodb-connection

Official
mongodb/agent-skills

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

4.6k installsAudited
MOmongodb-mcp-setup logo

mongodb-mcp-setup

Official
mongodb/agent-skills

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

3.6k installs
MOmongodb-natural-language-querying logo

mongodb-natural-language-querying

Official
mongodb/agent-skills

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

4.2k 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