Presenters

Source

Supercharging Your Development Workflow with MongoDB’s Intelligent Tools 🚀

Hey tech enthusiasts! 👋 Gagik Amaryan, a Senior Software Engineer, recently shared some seriously exciting insights at dotlocal in London about how we can drastically improve our development process. He’s not just talking about coding; he’s talking about productive development, and he’s making a bold claim: productive development with MongoDB is largely solved. Intrigued? You should be! Let’s dive into how MongoDB’s developer and AI tools can supercharge your applications at every stage.

From Local Development to Cloud Nirvana ✨

Gagik’s journey began with a personal project: building an application to search through the Modern Museum of Art’s (MoMA) collection. He wanted to go beyond basic full-text search and leverage the power of semantic search to find artworks related to abstract concepts like “AI.” Imagine typing “AI” and not just getting results with the word “AI,” but also discovering artworks about machines, brains, and intuition – that’s the magic of semantic search! 💡

This wasn’t just about a cool idea; it was about using cutting-edge tools. Gagik highlighted how he’s been using agentic tools and developer tools from MongoDB to achieve this. He even shared a real-world challenge he faced with a new feature and how he used the MongoDB Query Optimizer skill to tackle performance issues.

At the heart of this revolution are the MongoDB MCP Server and MongoDB Agent Skills, which are making waves in the development landscape.

Setting Up Your Smarter Development Environment 🛠️

Gagik walked us through a typical developer workflow:

  1. Environment Setup: This is where the magic begins! To iterate quickly and safely, especially when working with AI tools, a local Atlas cluster is a game-changer. It’s a secure sandbox, free from production or staging data, allowing you to experiment without fear. You can even use tools like mongorestore or ask an AI agent to script data population. For Gagik’s project, this meant setting up Atlas Search and Atlas Vector Search locally.

    • The Challenge: Setting up all these components locally might sound daunting, but MongoDB makes it surprisingly easy.
    • The Solution: The Atlas CLI with a simple command like atlas local setup can get a cluster running on your machine in seconds! 💨
  2. Integrating AI and Developer Tools: The landscape has evolved. We’re now integrating coding agents into our workflow.

    • MongoDB MCP Server: This acts as a bridge, allowing tools like Cloud Code, Copilot CLI, Cursor, and CodeX to interact seamlessly with your MongoDB database. It enables them to run queries, optimize indexes, and more.

    • MongoDB Agent Skills: These are expert-written guides that help steer your AI agents, providing a more reliable way to work with MongoDB data.

    • Ease of Use: The integration is as simple as adding one-liners to your codebase. And for those who prefer a click-and-go experience, the MongoDB extension for VS Code and plugins for popular coding agents come bundled with the MCP server and agent skills. A few clicks are all it takes! 🖱️

    • Meta-Level Setup: For more complex setups, the MongoDB MCP Setup skill uses AI to configure AI integrations – a fascinating “meta” approach to modern development! You can even create local Atlas deployments using the MCP server and agents, allowing you to chat with an agent to manage your environment.

Coding with Confidence and Intelligence 🤖

Once the environment is set up, the real fun – coding – begins!

  • Agent-Assisted Development: With plugins like Cloud Code, you can easily connect to your local Atlas cluster and retrieve data. This is incredibly useful for writing new back-end queries, understanding your indexes, and learning about your Atlas clusters. The MCP server helps agents quickly grasp your database state and analyze queries using tools like explain.
  • Leveraging Documentation: MongoDB is also using its own tools to empower AI. They’ve added features to query MongoDB documentation using Atlas Vector Search, providing agents with reliable sources of information, far superior to random web searches. 📚

Tackling Performance Bottlenecks with AI ⚡

Gagik shared a personal experience of adding a new feature: a page for art categories with dynamic, semantically relevant thumbnails. He used a cheap AI model for the query, which worked but resulted in a slow load time – a frustrating spinner that took over 4 seconds to resolve! 🐌

  • The Problem: The initial query was inefficient, and while it produced results, the performance was unacceptable. Not everyone is a MongoDB expert, especially in the early stages of a prototype.
  • The Solution: MongoDB Query Optimizer Skill: Gagik simply asked the AI agent to “improve this thumbnails query.” The optimizer skill, developed by MongoDB experts, analyzed his codebase, identified the query on the embedded MoMA collection, and noticed an unused index on departments.
  • The Process: The skill provided aggregation optimization strategies and anti-patterns as context. The AI agent then proposed changes, including a distinct operation to handle duplicates.
  • The Outcome: After some AI-induced quirks (like a funny Unicode quotation mark error that the AI fixed itself!), the optimized query ran. The agent claimed a 95% reduction in work, and Gagik observed a noticeable improvement: the page loaded in about half a second – up to four times quicker than the naive solution! 🤯

Gagik wisely cautioned that AI tools won’t magically optimize every query by 4x, but even a 10% improvement in speed or productivity is a significant win, especially given how easy these tools are to integrate.

Productionizing with Confidence: CI and Cloud Agents ☁️

Getting your application ready for production involves robust testing and a consistent environment.

  • CI/CD Integration: Replicating your local setup in CI environments is crucial. MongoDB makes this easy with the MongoDB Atlas local Docker image, requiring just a few lines of code in GitHub Actions or other CI platforms. This ensures that issues are caught early and your CI environment mirrors your local development setup.
  • Cloud Agent Workflows: The MongoDB MCP server can also be integrated with cloud agents (like GitHub cloud agents), extending the benefits of these tools beyond your local laptop. This allows you to run agentic workflows and get better context for your agents from anywhere.
    • Example: Gagik demonstrated how a cloud agent, without him needing his laptop, could access his GitHub codebase and generate a report on existing MongoDB indexes. 📡

The Takeaway: A Smarter, Faster Development Future 🌟

Gagik’s presentation painted a clear picture of the future of development:

  • Effortless Setup: Local Atlas environments and MCP server/agent skill integrations are achieved with just a few CLI commands or AI prompts.
  • Reliable Coding: Agents powered by the MCP server and skills create a more robust coding experience.
  • Optimized Performance: The Query Optimizer skill helps solve performance issues efficiently.
  • Seamless Production: CI workflows are easily synchronized with local environments.
  • Ubiquitous Intelligence: Cloud agents enable agentic workflows anywhere, anytime.

The journey from local setup to cloud deployment is now more streamlined and intelligent than ever before. By embracing these tools, developers can focus on building innovative applications with greater speed, confidence, and efficiency.

Questions from the Audience:

A key question arose about using the optimization tools for analyzing existing databases and understanding index usefulness. Gagik confirmed that the tools can be used for this purpose. The MCP server acts as a client for your database, much like Compass or the Shell, allowing you to analyze your existing workloads and index structures without needing any extra components installed on the database itself. It’s all about gaining deeper insights into your data and its performance.

Kudos to Gagik for an inspiring session that truly shows how far developer productivity has come! 🎉

Appendix