GitLab-CICD-Agent

agentic-cicd is an intelligent DevOps agent that automates GitLab CI/CD workflows using natural language. Users can easily set up complex pipelines, as the AI-driven multi-agent system understands, generates, pushes, and monitors real infrastructure changes. This simplifies CI/CD automation for developers and ops engineers alike.

GitHub Stars

0

User Rating

Not Rated

Forks

0

Issues

0

Views

1

Favorites

0

README
๐Ÿš€ agentic-cicd: Automate GitLab CI/CD with Natural Language + AI

โ€œAutomate your GitLab CI/CD workflows using natural language โ€” powered by AI and Google Cloud.โ€


โœจ Overview

agentic-cicd is an intelligent DevOps agent that allows users to automate complex GitLab CI/CD workflows simply by describing what they want in natural language.

It bridges natural language commands and real infrastructure changes by using an AI-driven multi-agent system that understands, generates, pushes, and monitors CI/CD pipelines on GitLab.

Whether you're a developer looking to set up a CI/CD pipeline or an ops engineer handling deployments โ€” this tool simplifies GitLab automation through LLMs + agents + MCP tool servers.


๐Ÿ“Ÿ๏ธ Demo

Live Application youtube demo


๐Ÿง  Key Features
  • ๐Ÿ” GitLab OAuth Integration โ€“ Connect your GitLab account securely.

  • ๐Ÿ’ฌ Natural Language Input โ€“ Describe what you want, like:

    Set up CI to run tests on push and deploy to GKE when main branch is updated.
    
  • ๐Ÿค– Multi-Agent AI Engine โ€“ Understands the request and plans accordingly.

  • โš™๏ธ Pipeline & Infra Generation โ€“ Generates .gitlab-ci.yml, Dockerfile, Terraform, Helm config, etc.

  • โ†ป Push + Merge Request โ€“ Pushes the generated files to your GitLab repo and opens an MR.

  • ๐Ÿ” Pipeline Monitoring โ€“ Optionally track status of the build, test, and deployment stages.

  • ๐Ÿงน MCP Server/Client Architecture โ€“ Modular tool abstraction to interface with GitLab API via agents.


๐Ÿงน Architecture
โ†ป System Flow

image


๐Ÿง  Multi-Agent Architecture โ€“ LangGraphJS Supervisor Pattern

This project follows the LangGraphJS Multi-Agent Supervisor Pattern to automate GitLab CI/CD workflows using natural language commands.


๐Ÿง‘โ€โš–๏ธ 1. Supervisor Agent
  • The central decision-maker.
  • Receives natural language input from the user.
  • Maintains shared memory and execution state across agents.
  • Dynamically delegates to sub-agents using a graph-based control flow.

๐Ÿ”„ Agent Workflow Graph

The Supervisor uses LangGraph to define a directed graph of agents, where edges represent conditional flows based on task results.


๐Ÿค– Sub-Agents

Each agent handles a distinct responsibility within the pipeline.


๐Ÿงญ PlanAgent

โ€œUnderstand what needs to be done.โ€

  • Parses user intent and decomposes it into logical subtasks.
  • Understands GitLab CI/CD terminology and translates user commands accordingly.
  • Outputs a plan with goals such as:
    • Generate .gitlab-ci.yml
    • Create Dockerfile
    • Define cloud deployment strategy (e.g., GKE)

๐Ÿง‘โ€๐Ÿ’ป CodeAgent

โ€œWrite the code/configuration needed.โ€

  • Converts the structured plan into CI/CD artifacts such as:
    • .gitlab-ci.yml
    • Dockerfile
    • Terraform / Helm configurations
  • Adapts generation based on selected cloud providers (GCP, AWS, etc.)
  • Can scaffold standard GitLab CI templates dynamically.

๐Ÿงช TestAgent

โ€œValidate the configuration before use.โ€

  • Runs tests on generated configuration to ensure correctness.
  • Performs:
    • YAML linting / CI syntax validation
    • Dry-run of GitLab CI if applicable
    • Optional LLM-assisted analysis of pipeline logic

๐Ÿ’ฌ ChatAgent

โ€œExplain whatโ€™s happening or answer user queries.โ€

  • Maintains conversation with the user.
  • Can answer questions like:
    • "What is this pipeline doing?"
    • "Why did my build fail?"
  • Pushes updates about:
    • MR creation
    • Pipeline execution
    • Deployment status
  • Can re-prompt for missing details if required

๐Ÿ”ง GitLab MCP Tool Server (Tool Use via API)

Agents like CodeAgent and ChatAgent interact with GitLab via a dedicated Tool Server (GitLab MCP Server).

๐Ÿ›  MCP GitLab Tool Server
  • A REST API wrapper around GitLabโ€™s official APIs.
  • Allows fine-grained agent control over GitLab actions like:
    • Getting project info
    • Creating branches/commits
    • Listing and triggering pipelines
    • Monitoring job statuses
    • Opening Merge Requests

๐Ÿค MCP Client
  • Each agent uses an MCP Client to communicate with the Tool Server.
  • Benefits:
    • Keeps logic clean and separated from direct API calls.
    • Enables observability, tracing, and debugging of agent decisions.
    • Makes actions reversible and replicable.

๐Ÿ”„ Feedback Loop
  1. User Input

    โ€œSet up CI to run tests on push and deploy to GKE when main is updated.โ€

  2. Supervisor Flow

    • PlanAgent โ†’ Understands the request and breaks into subgoals.
    • CodeAgent โ†’ Generates .gitlab-ci.yml, Dockerfile, etc.
    • TestAgent โ†’ Validates the generated files.
    • GitLab MCP Server โ†’ Applies the changes via GitLab API (opens MR).
    • ChatAgent โ†’ Informs the user and monitors progress.
  3. Pipeline Execution

    • GitLab CI is triggered.
    • Status is periodically updated to the user.

โœ… Why LangGraphJS?
  • Structured Reasoning
    Flow is modeled as a directed graph for better traceability and control.

  • Shared Memory Across Agents
    All agents work with a centralized state context.

  • Retries and Fallbacks
    Automatically retry failed tasks or re-ask user when needed.

  • Plug-and-Play Agents
    Each agent is modular, testable, and can be extended independently.


โœจ The result is a natural-language-driven GitLab CI/CD automation system powered by intelligent agents, tailored infrastructure, and real-time feedback โ€“ all orchestrated via LangGraph.

๐Ÿ” Authorization:
  • Uses the userโ€™s OAuth token to act on their behalf.
  • Each API call is scoped by the GitLab OAuth access token.

๐Ÿ’ฝ Tech Stack
Layer Tech
Frontend React, React Router, Vite, Tailwind
Backend Node.js, Express, Supabase
AI Agents LangGraphJS, LangChainJS, Gemini/GPT
Auth GitLab OAuth 2.0
Infra Tools Docker, Terraform, Helm (generated)
Hosting Vercel (frontend), Render (backend)

๐Ÿš€ Getting Started
1. Clone the Repository
git clone https://github.com/your-org/agentic-cicd.git
cd agentic-cicd

2. Frontend Setup
cd frontend
npm install

Create a .env file:

VITE_BACKEND_URL=https://your-backend-url.onrender.com
VITE_GITLAB_CLIENT_ID=your_gitlab_client_id
VITE_REDIRECT_URI=https://your-frontend-url.vercel.app/oauth/callback
npm run dev

3. Backend Setup
cd backend
npm install

.env file:

GITLAB_CLIENT_ID=your_gitlab_client_id
GITLAB_CLIENT_SECRET=your_gitlab_client_secret
GITLAB_REDIRECT_URI=https://your-frontend-url.vercel.app/oauth/callback

SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key

GOOGLE_API_KEY=your_gemini_api_key
TAVUS_API_KEY=your_tavus_key

Build and Run:

npm run build
npm run start

๐Ÿงช Usage
  1. Go to the app homepage.

  2. Click "Connect GitLab" and authorize access.

  3. Enter your command like:

    Set up CI to run tests on push and deploy to GKE when main branch is updated.
    
  4. Agent will:

    • Understand your intent
    • Generate .gitlab-ci.yml and Dockerfile
    • Push to a new branch
    • Open a merge request
    • Trigger a pipeline
  5. Watch pipeline logs via GitLab or frontend.


โ˜๏ธ Deployment Guide
Frontend (Vercel)
  1. Link GitHub Repo โ†’ Vercel Dashboard
  2. Set environment variables in Settings
  3. Deploy
Backend (Render)
  1. Create new Web Service โ†’ Connect to GitHub
  2. Build Command: npm run build
  3. Start Command: node dist/index.js
  4. Add your environment variables

โ— Troubleshooting
Issue Fix
CORS error Ensure backend sets correct Access-Control-Allow-Origin
OAuth redirect 404 Check GitLab app redirect URI matches deployed frontend
Failed to fetch Backend must be live + CORS enabled
503 MCP Init GitLab token expired or MCP endpoint down
CI config invalid Re-run or correct command syntax

๐Ÿค Contributing

We welcome PRs and ideas!

# Fork -> Clone -> Create Branch -> Code -> Commit -> PR

Please open issues for:

  • Bugs
  • New agent tasks
  • GitLab features you'd like automated

๐Ÿ“„ License

MIT License ยฉ 2025 MemeVerse CICD Dev Team


๐Ÿ’ก Inspired By

๐Ÿ—‚๏ธ Folder Structure (Simplified)
agentic-cicd/
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ””โ”€โ”€ components/
โ”‚
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ agents/
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   |โ”€โ”€ services/
|-โ”€ mcp-server/
โ”‚
โ”œโ”€โ”€ .env.example
โ””โ”€โ”€ README.md

๐Ÿ“ฌ Contact

For inquiries or collaborations: ๐Ÿ“ง shalwinsanju.25cs@licet.ac.in ๐Ÿฆ Twitter: @samshalwin


Author Information
Shalwin

๐Ÿ‘จโ€๐Ÿ’ป Full Stack Developer | Agent Developer | LLM Enthusiast | GenAI | Langraph | Passionate about building agentic applications

2

Followers

36

Repositories

0

Gists

58

Total Contributions

Top Contributors

Threads