Inspiration

Every software team using GitLab faces the same daily friction — open bugs sitting unresolved, pipeline failures going unnoticed, and developers spending hours on routine fixes instead of building new features. I wanted to build an agent that handles this maintenance work autonomously, so developers can focus on what matters.

What it does

The GitLab Autonomous DevOps Agent monitors any GitLab repository 24/7 and autonomously:

  • Detects open issues labeled good first issue
  • Reads the actual source code using the GitLab API
  • Uses Gemini 3.5 Flash to analyze the bug and generate a real code fix
  • Creates a branch, commits the fixed code, and opens a merge request
  • Comments on the issue with the MR link and closes it automatically
  • Saves all actions to Firestore for persistent memory across sessions

No human intervention required. The agent runs every 30 minutes via Cloud Scheduler.

How I built it

  • Gemini 3.5 Flash via Vertex AI for intelligent code analysis and fix generation
  • Google ADK for agent orchestration and tool calling
  • Cloud Run for serverless deployment that scales to zero
  • Cloud Scheduler for autonomous 24/7 triggering every 30 minutes
  • Firestore for persistent memory so the agent never duplicates work
  • FastAPI for the live dashboard and health endpoints
  • GitLab API for all repository interactions

Challenges I faced

The biggest challenge was making the agent reliably call the correct tools in the right order without hallucinating results. I solved this by using explicit step-by-step instructions in the agent prompt and exposing well-typed tool functions. Rate limiting from Vertex AI required implementing exponential backoff retry logic. Getting the agent to use unique branch names per run required exposing a timestamp-based branch name generator as a tool.

What I learned

Building a truly autonomous agent requires careful attention to tool design, instruction clarity, and failure handling. The agent is only as reliable as the tools you give it and the instructions you write. Persistent memory via Firestore is essential for avoiding duplicate work across sessions.

Built With

Share this project:

Updates