Building an App with Code Agents and MongoDB / Overview of Building an App with Code Agents and MongoDB

6:42

Video Transcript (English)

Proof of concept apps are built quickly to validate an idea, with collections that weren't carefully designed and queries that were written to get the job done rather than to perform well. Getting from that point to something you'd confidently put in front of real users takes a lot of effort.

What's changed is how fast you can get there. AI coding agents can now take on the heavy lifting that used to take days.

But speed alone isn't the goal. The real skill is knowing how to work with these agents effectively: prompting them well, evaluating what they surface, and making decisions you can stand behind.

In this skill badge, you'll do exactly that. You'll take an e-commerce app that was built quickly and use MongoDB Agent Skills to evaluate, improve and build on it. As you do this, you’ll build the habit of reviewing, documenting, and defending your decisions along the way.

Let’s get started.

The app you'll be working with is an e-commerce store that sells tech equipment. It was vibe-coded in order to create a MVP quickly. The collections weren't carefully designed, queries were written for speed rather than performance, and there is an opportunity to implement an AI feature that will make it easier for customers to search for products. It works, but it's not ready for scale.

Your job is to change that. You'll use MongoDB Agent Skills to improve it step by step, making the kinds of decisions a developer would make when moving from "shipped" to "solid."

You have four tasks to complete in this skill badge, and each one builds on the last.

First you'll work with the MongoDB Schema Design agent skill to evaluate and improve the app's data model and schema design.

The team that vibe-coded the app created six collections: orders, order_items, users, brands, categories, and products. None of these were designed with access patterns or best practices in mind.

You'll use the MongoDB Schema Design agent skill to analyze the current schema and propose alternatives. Schema design rarely has one correct answer, but you'll want to watch out for anti-patterns like unbounded arrays and bloated documents, and think carefully about where to embed or reference data.

What matters is that you evaluate the options, choose one that fits your needs, and record your thought process at the end.

For the second task, you'll shift to query optimization. Now that you have a schema design in place, you’ll diagnose slow queries and implement targeted improvements using the MongoDB Query Optimizer agent skill.

The original queries were written without performance best practices in mind, and they weren't designed for the optimized schema you built in task 1.

You'll use the agent to analyze existing queries and propose improvements like adding indexes, restructuring queries, and reducing unnecessary data retrieval. Your job is to evaluate the options the agent presents, for example, considering the tradeoff between index overhead and read speed. Once you choose an approach, you’ll document your reasoning.

For the third task, you'll add a semantic search feature using MongoDB Vector Search, so users can search by meaning rather than just keywords.

You’ll use the MongoDB Vector Setup agent skill to create a vector search index on embedding fields and write the queries needed to search those embeddings. You don't need to have experience using MongoDB Vector Search to accomplish this task. The agent makes the implementation decisions and writes the code. Your job is to review the output, test it, and confirm it works as expected.

At the end of each of the first three tasks, you'll respond to prompts in the provided project notes file to record your decisions.

Record what you prompted the agent to do, what the agent recommended, what you accepted, what you changed, and why.

This is an important step because developing that habit of reviewing, refining, and documenting is one of the core skills this badge is designed to build.

That documentation also sets you up for the final task: planning for production observability.

You'll use the agent to analyze the final state of the application and the documentation you produced as you developed the app. It will then identify items to track as the app grows in production.

This step is crucial because shipping is not the finish line. A production-ready app requires visibility into how that code is performing.

Without observability, you won't know if your schema changes improved read performance, whether your indexes are actually being used, or when something quietly starts to degrade.

Before you dive in, here are a few things to know about the tools you'll be working with throughout this badge.

The first is the MongoDB MCP Server, or Model Context Protocol Server.

MCP is an open standard for connecting AI agents to external tools and data sources.

The MongoDB MCP server is the connectivity layer between your AI coding agent and your MongoDB deployment, allowing your agent to interact with your database directly, completing tasks like querying schemas, analyzing indexes, and inspecting collections, in plain language.

The MongoDB agent skills used in this course rely on the MongoDB MCP server, which is already set up in your lab environment and ready to use.

You'll also use agent skills to complete each part of the skill.

The MongoDB Schema Design agent skill helps you evaluate your data model, identify anti-patterns, and propose alternatives. The MongoDB Query Optimizer agent skill analyzes your queries, flags performance issues, and suggests improvements. The MongoDB Vector Setup agent skill handles the implementation work for adding vector search to your application — setting up indexes, configuring embeddings, and wiring everything together.

It's important to know that these agents skills are non-deterministic. That means they may give you different recommendations each time you run them, and, with tasks like data modeling or query optimization, there often isn't one single correct answer.

Think of each agent skill as a knowledgeable collaborator that can suggest solutions, make changes, and answer your questions about MongoDB along the way. Use them to analyze, propose, and explain tradeoffs.

But it doesn't know how your priorities or constraints evolve over time. You do. Your job throughout this skill is to engage with the agent’s output critically. Read the output, weigh the options presented to you, challenge anything that doesn’t fit, and make a decision you can defend and explain.

That is not a passive role. The agent gives you options; you give them meaning.

You now have the full picture: an POC app that needs work, a list of improvements that will move the app towards production quality, and a set of AI agents to help you get there. The agents will generate options. You'll evaluate them, make calls, and document your reasoning.

Good luck!