We’re thrilled to introduce the MongoDB Plugin for Genkit, designed to accelerate your AI-powered applications with advanced search and database tooling—all within the Genkit ecosystem. Whether you're building chatbots, intelligent assistants, or recommendation engines, this plugin brings together MongoDB’s cutting-edge search capabilities and Genkit’s AI workflows, enabling seamless vector, full-text, and hybrid search with zero hassle.
The MongoDB Plugin for Genkit offers an integrated, developer-first experience:
- Vector search: Unlock semantic understanding across your data using embeddings.
- Full-text search: Support fuzzy matching, synonyms, and keyword precision via MongoDB Atlas Search.
- Hybrid search: Combine vector and text search with MongoDB’s $rankFusion for unbeatable relevance.
- Production-ready features: Built-in retry policies, batch indexing, and robust configuration options ensure reliability.
With this plugin, MongoDB becomes a first-class citizen in your Genkit projects, standardizing how AI applications interact with complex data and indexes.
Why does this matter?
Designed for real-world robustness, the platform includes built-in retry policies, batch indexing, customizable fields, and full support for multimodal data that allows you to tailor your AI applications to deliver precise, context-aware results by effortlessly switching between semantic, fuzzy text, or hybrid search modes. You can stay within Genkit using any supported embedder, such as Gemini or Vertex AI, while MongoDB handles both embedding storage and document management. The plugin also streamlines CRUD operations and search index management with a well-defined API, ensuring a smooth and reliable integration.
Features of the MongoDB Genkit connector
As noted, the MongoDB Genkit connector's features include vector search, text search, hybrid search, multimodal support, and crud and index management tools.
With a few lines of code in your genkit() configuration, you can add the plugin, which allows you to mix and match retrieval types to fit different features and user needs. The framework—which leverages Genkit's developer UI and logging tools—helps you focus on building AI experiences rather than infrastructure. This is particularly useful for real-world RAG (retrieval-augmented generation) to reduce hallucinations and improve answer quality by fusing semantic intent with keyword search, as well as for AI-driven assistants and smart product search to provide highly relevant and confident results.
Get started with MongoDB Genkit connector
Install the plugin quickly via npm:
Configure MongoDB in your Genkit setup:
With this setup, you’re ready to index documents, run vector, text, or hybrid searches, and manage your database—all through a unified API
Powerful search modes
The MongoDB Plugin for Genkit introduces three distinct search modes that cater to different use cases: vector search, text search, and hybrid search.
- Vector search allows for semantic searches using embeddings, helping you find content that is contextually related, even if it doesn’t match exact keywords.
- Text search offers robust full-text search with fuzzy matching, keyword precision, and synonym support, perfect for handling more traditional query types.
- Hybrid search combines the best of both worlds, allowing you to blend semantic and keyword search for more relevant results.
With these modes, you can fine-tune the search experience to meet the specific needs of your application, whether it's context-driven exploration or precise keyword matching.
Vector search
Use embeddings to find semantically related content across your collections:
Text search
Search your data with fuzzy matching and keyword precision:
Hybrid search
Combine vector and text search for optimal results with weighted fusion:
Indexing documents at scale
With MongoDB’s Atlas Search, you can efficiently index large volumes of documents without compromising on performance. The plugin supports batch indexing, allowing you to index documents, images, and other multimodal data in configurable batches. Whether you're dealing with thousands of text articles, product images, or complex documents, the plugin's built-in retry logic ensures reliable indexing even under heavy loads.
This approach optimizes both speed and accuracy, making it ideal for large-scale applications. Plus, with customizable options for embedding fields, metadata, and data types, you can fine-tune the indexing process to fit your specific needs, ensuring that your data is both well-structured and easily searchable.
CRUD and index management tools
The MongoDB Plugin for Genkit streamlines database management by providing robust tools for performing CRUD (create, read, update, delete) operations directly within Genkit workflows. This allows you to seamlessly manage your data without leaving the Genkit environment. Whether you're adding new documents, retrieving existing ones by ID, or updating and deleting records, the plugin provides simple and efficient methods for interacting with your MongoDB collections.
In addition to CRUD operations, the plugin also offers tools for managing search indexes, such as creating, listing, or dropping indexes on your collections. These operations are fully integrated into your Genkit setup, ensuring a consistent, efficient experience for handling both data and search indexes with minimal effort.
Similarly, create, list, or drop search indexes programmatically:
Multimodal support: Beyond text
The MongoDB Plugin for Genkit extends its powerful search capabilities to not just text but also images and documents, enabling a richer, more diverse AI experience. With multimodal embeddings, you can index and search not only textual data but also visual content, such as images or PDFs, unlocking new opportunities for AI-driven applications. Whether you’re analyzing product images, extracting text from scanned documents, or performing image similarity searches, the plugin allows you to seamlessly integrate and query multimodal data.
This feature broadens the scope of AI applications, from visual search engines to document analysis tools, offering a comprehensive solution for developers seeking to leverage both text and non-textual data in their projects.
Search images semantically:
Explore the test application
To fully experience the capabilities of the MongoDB Plugin for Genkit, the test application provides a hands-on environment where you can explore all of its powerful features in action. The test app includes interactive demonstrations of vector, text, and hybrid search, as well as CRUD operations and multimodal document support. It also showcases advanced configurations like configurable retry policies and batch indexing, helping you fine-tune performance and reliability.
By navigating through the app, you’ll see how MongoDB integrates seamlessly with Genkit’s AI workflows, allowing you to quickly prototype and experiment with various search strategies and document management techniques. Dive into the repo and start testing the plugin today to see how it can enhance your AI projects.
Next Steps
To get started, visit our GitHub resources: