Inspiration
Modern microservices generate massive streams of operational and telemetry data. When a critical database failure occurs—such as a replication lag spike, connection pool exhaustion, or an unexpected secondary cluster disconnection—on-call engineers are usually buried under a mountain of raw logs. We were inspired to build a system where the data layer could talk directly to the DevOps pipeline. We wanted to eliminate manual triage by creating an intelligent, autonomous bridge that captures database anomalies immediately, analyzes them with human-like reasoning, and instantly documents them where developers already live: inside GitLab.
What it does
The MongoDB & GitLab Dual-Agent Assistant is an autonomous, event-driven backend service that acts as an automated incident responder. The system coordinates two distinct agentic responsibilities:
- The Monitor Agent: Watches a MongoDB cluster, parsing operational logs, heartbeat traces, and performance health metrics.
- The Operator Agent: Communicates through a Node.js/Express bridge layer using a Model Context Protocol (MCP) design pattern to authenticate via secure GitLab Personal Access Tokens and instantly open detailed GitLab Incidents under Project 82204031.
When a problem strikes (e.g., a "MongoDB Data Sync Drop"), the assistant creates a structured tracking issue complete with priority labels (P1 - Critical), automation tags, and markdown-formatted diagnostic payloads extracted during the grounding process.
How we built it
The ecosystem was developed using a modern, lightweight, and secure stack:
- Google Cloud Agent Builder & Gemini: Used to design, test, and coordinate the core agent logic, providing the contextual reasoning necessary to translate messy logs into clear incident reports.
- Node.js & Express: Serves as our dedicated integration runtime. The code exposes a secure REST endpoint (POST /api/alert) that receives automated triggers.
- GitLab REST API: Integrated into our core services (gitlabService.js) using asynchronous JavaScript and native HTTP fetch patterns to programmatically generate issue entities.
- Dotenv & Git Security: Constructed with an isolated runtime environment using .env handling to prevent secret keys or API tokens from being tracked in our public repository.
Challenges we ran into
One of our primary obstacles was making our locally running Node.js development server securely visible to the cloud-based Google Cloud Agent Builder without exposing our system to the public internet. We initially faced connection failures attempting to address local routes. We resolved this by implementing a secure, verified reverse-proxy tunnel using ngrok to map public hooks down to port 3000.
Another challenge was managing the transition of our modern asynchronous imports (import/export) in Node.js, which initially threw standard module compilation errors. We solved this by refining our configuration properties to cleanly lock in ECMAScript modules ("type": "module") inside our package.json.
Accomplishments that we're proud of
- Zero-Leak Credential Security: Successfully set up a production-ready repository configuration utilizing .gitignore structures, ensuring our raw GitLab tokens are completely protected.
- Clean Asynchronous Pipeline: Created a failure-resistant data flow where incoming raw diagnostic parameters are cleanly mapped, validated, and translated into a dynamic GitLab API call in milliseconds.
- End-to-End Automation: Built a functional prototype that moves beyond simple chat-based prompts and takes tangible, multi-step actions across isolated platforms.
What we learned
We gained hands-on experience working with Model Context Protocol principles and engineering lightweight integrations that expand the execution capabilities of LLMs. We also mastered the nuances of setting up local debugging environments utilizing cloud-forwarding tunnels, managing Node package lifecycles, and ensuring open-source compliance by deploying official licensing directly into our code trees.
What's next for MongoDB & GitLab Dual-Agent Assistant
The next phase for this assistant is introducing closed-loop automation. Instead of just opening a descriptive ticket when MongoDB encounters a sync error, the assistant will be upgraded to query a vector knowledge base of historical database fixes, suggest the exact recovery commands directly within the GitLab issue comments, and potentially run automated rollback scripts with human-in-the-loop validation!
Log in or sign up for Devpost to join the conversation.