🌱 Inspiration

Modern software development often prioritizes performance and features, but rarely considers environmental impact. Many developers unknowingly include heavy dependencies that increase energy consumption, slow down applications, and make them unusable on low-resource devices.

We wanted to build a solution that brings sustainability awareness directly into the developer workflow — not as an afterthought, but as an automated intelligent assistant.


🚀 What it does

Green Agent is an AI-powered agent integrated with GitLab that:

  • 🔍 Analyzes dependency files (e.g., requirements.txt, package.json)
  • ⚠️ Detects heavy libraries
  • 🌱 Suggests lightweight alternatives
  • 📊 Estimates carbon footprint savings (gCO2e)
  • 🤖 Generates AI-powered sustainability insights using Gemini

Additionally, we built a standalone Edge version that runs on low-resource environments like mobile devices using :contentReference[oaicite:0]{index=0}.


🛠 How we built it

The system is composed of:

  • Python-based analyzer engine for dependency scanning
  • GitLab CI/CD pipeline to trigger analysis on every Merge Request
  • GitLab API integration to automatically post sustainability reports
  • Carbon estimation logic based on package size heuristics
  • AI integration (Gemini) to generate human-friendly sustainability insights

We also designed a lightweight standalone version that runs independently without external dependencies, demonstrating real-world edge deployment.


⚙️ Architecture Overview

  1. Developer opens a Merge Request on :contentReference[oaicite:1]{index=1}
  2. GitLab CI triggers the Green Agent
  3. The agent analyzes dependencies
  4. Carbon impact is estimated using:

$$ Carbon\ Savings = (Size_{original} - Size_{alternative}) \times 0.01 $$

  1. AI generates an explanation of environmental benefits
  2. The agent posts a structured comment directly on the Merge Request

📱 Edge Deployment (Termux Demo)

To prove real-world usability, we implemented an Edge Agent that runs on mobile devices:

  • No external libraries required
  • No cloud dependency
  • Instant analysis on-device

This demonstrates how Green Agent can support developers in constrained environments such as mobile phones and edge systems.


🧩 Challenges we faced

  • Integrating AI APIs reliably within CI pipelines
  • Handling model/version compatibility issues with Gemini
  • Designing a system that works both in cloud (GitLab) and offline (Edge)
  • Balancing simplicity with meaningful carbon estimation

📚 What we learned

  • How to build event-driven AI agents in DevOps workflows
  • Practical approaches to estimate environmental impact in software
  • The importance of lightweight design for global accessibility
  • How to combine AI + sustainability into a real developer tool

🔮 Future Work

This project is a prototype demonstrating the concept of sustainable DevOps.

Future improvements include:

  • Integration with real carbon tracking APIs
  • Advanced AI optimization suggestions
  • Deeper GitLab Duo Agent Platform integration
  • Runtime energy analysis
  • Smarter edge intelligence

🌍 Impact

Green Agent helps developers:

  • Build more efficient software
  • Reduce carbon emissions
  • Support low-resource environments
  • Make sustainability a default part of development

🚀 Green Agent brings sustainability into every pull request.

Built With

  • devops
  • gemini-ai
  • gitlab-api
  • gitlab-ci/cd
  • google-ai-studio
  • python
  • regex
  • rest-apis
  • termux
Share this project:

Updates