Inspiration
Support teams spend up to 40% of their time answering the exact same Level 1 questions over and over. When new, unknown issues arise, they get solved in a ticket, but that solution rarely makes it back into the company knowledge base in real-time. We wanted to build an agent that doesn't just read a static knowledge base—but actively learns and writes to it autonomously.
What it does
MongoMind is an AI agent that monitors incoming support tickets. Its workflow goes far beyond standard chat: Search: When a new ticket arrives, it uses the official MongoDB MCP Server to execute a semantic vector search on the Atlas database for similar historical problems. Resolve: If it finds a match, it synthesizes a polite, accurate response to the user. Escalate: If the issue is novel, the agent recognizes its limitations and escalates the ticket to a human expert. Self-Improve: Here is the magic. Once the human expert resolves the ticket, MongoMind automatically kicks back in. It extracts the core problem and the human's solution, and uses the MongoDB MCP to permanently insert this new knowledge back into the database. The next time that question is asked, MongoMind handles it automatically.
How we built it
We built the agent using Node.js and the Google Gen AI SDK (@google/genai). To connect to the database, we integrated the official MongoDB MCP Server (mongodb-mcp-server) running over Standard I/O. We provided the gemini-2.5-flash model with three custom tools that map directly to the MCP server's capabilities: search_knowledge_base -> Maps to MCP mongodb_aggregate (Vector Search) add_to_knowledge_base -> Maps to MCP mongodb_insert escalate_to_human -> Triggers human-in-the-loop workflows By giving Gemini the ability to execute these MCP commands, it became a fully autonomous, state-mutating agent rather than just a RAG chatbot.
Challenges we ran into
Integrating the MCP server on a Windows environment presented some interesting edge cases. Initially, running the MCP server via npx caused silent hangs and timeouts because it was waiting for interactive shell inputs that aren't exposed over stdio. We overcame this by installing the MCP server locally as an npm package and executing the compiled binary directly, ensuring rock-solid stability. We also had to carefully map Gemini's tool outputs to the strict Zod parsing requirements of the MCP SDK using the callTool helper. Furthermore, we had to architect an exponential backoff logic loop (callGeminiWithRetry) to prevent our high-volume vector search queries from crashing due to free-tier API rate limits.
Accomplishments that we're proud of
We are incredibly proud to have built a closed-loop AI system. Most hackathon projects focus on Reading data (RAG). We successfully built an agent that Writes and mutates state, creating a system that gets smarter every time a human interacts with it. Leveraging advanced Atlas Vector Search natively inside our workflow via Gemini's text-embedding-004 model was a massive success.
What we learned
We learned the immense power of the Model Context Protocol (MCP). By simply plugging in the MongoDB MCP server, we instantly gave our Gemini agent the ability to query, vectorize, and modify a production-grade database without having to write hundreds of lines of custom CRUD API wrappers.
What's next for MongoMind
Slack Integration: Hooking the escalate_to_human tool directly into a Slack channel so human engineers can reply natively, triggering the DB ingestion seamlessly.
Log in or sign up for Devpost to join the conversation.