Inspiration

Every modern software project uses dependency bots (Dependabot, Renovate, GitLab Dependency Bot) to keep packages up to date. But these bots create individual merge requests for every single update — sometimes 10-30 MRs piling up per week. Each MR triggers its own CI/CD pipeline: builds, tests, linting, security scans.

The result? Hundreds of wasted CI minutes, redundant compute, and a real carbon footprint that nobody talks about.

We asked: What if AI could consolidate all of these into one smart MR and track the environmental savings?

What it does

CarbonMerge is a multi-agent AI system built on the GitLab Duo Agent Platform that:

  1. Scans all open bot-generated merge requests in a project
  2. Merges compatible dependency updates into a single unified commit
  3. Publishes one "Eco-Update" MR with detailed change tables and carbon metrics
  4. Reports sustainability insights using Google Cloud Vertex AI — including annualized CO2 projections, industry benchmarks, and AI-powered optimization recommendations

Real Impact Example

  • Before: 6 bot MRs → 6 CI pipelines → 120 CI minutes → 470g CO2
  • After: 1 Eco-Update MR → 1 pipeline → 20 CI minutes → 83% reduction

How we built it

CarbonMerge uses a 4-agent orchestrated flow on the GitLab Duo Agent Platform:

Agent Role Tools
Scanner Finds all bot-generated MRs list_merge_requests, get_merge_request
Merger Consolidates changes into one commit read_file, create_commit
Publisher Creates the Eco-Update MR create_merge_request, create_merge_request_note
Reporter Generates sustainability analysis Google Cloud Vertex AI via MCP

The agents are orchestrated via flows/carbonmerge_flow.yml using the v1 flow definition spec. The Reporter agent connects to Google Cloud Vertex AI through the official Google Cloud MCP server for AI-powered carbon analysis.

Challenges we ran into

  • Flow orchestration complexity: Designing the data handoff between 4 sequential agents required careful input/output mapping and error handling at each stage
  • Carbon calculation methodology: Finding reliable CI-to-CO2 conversion factors and building a credible carbon footprint model
  • Duo Agent Platform beta limitations: Working with a new platform that was still evolving during the hackathon period

Accomplishments that we're proud of

  • Clean 4-agent architecture that's modular and extensible
  • Realistic carbon impact calculations based on Google Cloud's own carbon footprint methodology
  • Google Cloud Vertex AI integration for intelligent sustainability reporting
  • A compelling demo showing the before/after of CI/CD waste reduction

What we learned

  • The GitLab Duo Agent Platform makes it surprisingly natural to compose AI agents into complex workflows
  • MCP (Model Context Protocol) integration enables powerful connections to external AI services
  • The sustainability angle in DevOps is underexplored — there's real impact potential here

What's next for CarbonMerge

  • Auto-scheduling: Run CarbonMerge on a weekly cron to automatically batch bot MRs
  • Conflict resolution: Handle merge conflicts between dependency updates using AI
  • Organization dashboard: Track cumulative CO2 savings across all projects in a GitLab group
  • Carbon badges: Show a real-time CO2 savings badge in project READMEs

Built With

  • gitlab-duo-agent-platform
  • google-cloud-vertex-ai
  • mcp-(model-context-protocol)
  • python
  • yaml
Share this project:

Updates