AutoBot — Autonomous Multi-Agent Issue Resolution System

Hackathon Submission — AutoBot is a fully autonomous 4-agent CI/CD system built on GitLab, LangGraph, and AWS Bedrock. It detects software issues, analyzes Java source code, writes a real patch, raises a Merge Request, and documents everything — with no human intervention until MR review.


Our Story

During a sprint retrospective, our team noticed a pattern: we kept fixing the same class of bugs over and over — a NullPointerException in a payment service, a missing null guard in a user lookup, a validation edge case that slipped through review. The triage cycle was always the same: locate the issue, read the code, write the fix, review, merge, close. Hours spent on predictable, repeatable work.

We asked: what if the pipeline could do this itself?

AutoBot is our answer. It turns GitLab CI/CD into an autonomous reasoning system powered by Claude 3.5 Sonnet on AWS Bedrock. When a developer opens an issue, four specialized AI agents wake up, read the actual source code, fix the bug, raise a Merge Request, and write permanent documentation — all within minutes.


Executive Summary

Dimension Value
Agents 4 (3 LangGraph + Claude, 1 deterministic Python)
Pipeline GitLab CI/CD — 4 sequential stages
AI Model Claude 3.5 Sonnet via AWS Bedrock
Agent Framework LangGraph ReAct
Application Under Test Java 17 + Maven + JUnit 4
Mean Time to Resolution Under 15 minutes
Human Intervention MR review only — everything else is automated

Problem Statement

Engineering teams waste significant time on predictable, repeatable bug resolution:

  1. Issue created
  2. Engineer triages manually — reads code, identifies root cause
  3. Fix written, reviewed, and merged — hours or days later
  4. Issue closed manually
  5. No documentation written
  6. Same bug resurfaces months later because no one documented it

The core problem: the resolution cycle for common bug patterns (null pointer exceptions, missing validations, incorrect guards) is mechanical and repeatable — exactly the kind of work AI should handle.


Solution Overview

AutoBot turns GitLab CI/CD into an autonomous agent runtime. Four agents activate sequentially on every new issue:

Stage Agent Runtime What it does
analyze Issue Analyzer LangGraph + Claude Detects the issue, saves context, triggers the pipeline
fix Auto Fix LangGraph + Claude Reads Java source, identifies root cause, writes the patch
mr_creation MR Creation Python (deterministic) Commits the fix and opens a Merge Request
document Wiki Documenter LangGraph + Claude Writes wiki documentation including the MR link

Multi-Agent Architecture

GitLab Issue Created
        │
        ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                        .gitlab-ci.yml  (4 stages)                       │
│                                                                         │
│  ┌──────────┐    ┌──────────┐    ┌─────────────┐    ┌──────────────┐  │
│  │ analyze  │───▶│   fix    │───▶│ mr_creation │───▶│   document   │  │
│  │          │    │          │    │             │    │              │  │
│  │ Agent 1  │    │ Agent 2  │    │  Agent 3    │    │  Agent 4     │  │
│  │LangGraph │    │LangGraph │    │  Python     │    │  LangGraph   │  │
│  │+ Claude  │    │+ Claude  │    │  (GitLab    │    │  + Claude    │  │
│  │          │    │          │    │   API)      │    │              │  │
│  └──────────┘    └──────────┘    └─────────────┘    └──────────────┘  │
│       │               │                │                  │            │
│ issue_context    fix_proposal.json  mr_result.env      Wiki page       │
│     .env          + patched src/    (MR_URL)           + comments      │
└─────────────────────────────────────────────────────────────────────────┘

Artifact Chain

issue_context.env        (Agent 1 → Agent 2, Agent 4)
       ↓
fix_proposal.json + src/ (Agent 2 → Agent 3)
       ↓
mr_result.env (MR_URL)   (Agent 3 → Agent 4)
       ↓
Wiki page + labels       (Agent 4 → GitLab)

Agent Deep Dive

Agent 1 — Issue Analyzer (agents/agent1_analyze_issue.py)

Runtime: LangGraph ReAct + Claude 3.5 Sonnet (AWS Bedrock)

The entry point. Polls GitLab for open issues not yet labelled auto-fixed, saves context into issue_context.env, and triggers the downstream pipeline.

LangGraph Tools:

  • fetch_open_issue — GET /issues?not[labels]=auto-fixed
  • save_issue_context — writes issue_context.env artifact
  • trigger_pipeline — POST /trigger/pipeline with ISSUE_IID
  • post_comment_on_issue — posts 4-agent status table on the issue

Loop prevention: Three-layer guard (not[labels]=auto-fixed filter + CI_PIPELINE_SOURCE check + TRIGGERED_BY variable) prevents infinite re-triggering.


Agent 2 — Auto Fix (agents/agent2_auto_fix.py)

Runtime: LangGraph ReAct + Claude 3.5 Sonnet (AWS Bedrock)

The AI engineer. Reads actual Java source and test files, reasons about the root cause, writes a complete corrected file, and saves a fix proposal.

LangGraph Tools:

  • load_context — reads issue_context.env
  • get_issue_details — GET /issues/:iid
  • mark_issue_in_progress — creates and applies in-progress label
  • list_java_files — globs src/**/*.java
  • read_java_file — reads source and test files
  • write_java_file — writes patched file to disk, stages in _pending_changes
  • save_fix_proposal — writes fix_proposal.json, clears pending changes
  • post_fix_comment — posts root-cause analysis on the issue

Claude's reasoning loop:

load_context → get_issue_details → mark_issue_in_progress →
list_java_files → read_java_file × N →
[Claude reasons about root cause] →
write_java_file × N → save_fix_proposal → post_fix_comment

Agent 3 — MR Creation (agents/agent3_mr_creation.py)

Runtime: Plain Python 3.11 (no AI — deterministic)

The MR raiser. Reads fix_proposal.json, commits patched files to branch autofix/issue-<n>, opens a Merge Request targeting main with Closes #<n> in the description, and writes mr_result.env with the MR URL for Agent 4.

Key functions: load_fix_proposal()create_mr(proposal)post_mr_comment()save_mr_result()


Agent 4 — Wiki Documenter (agents/agent4_wiki_documenter.py)

Runtime: LangGraph ReAct + Claude 3.5 Sonnet (AWS Bedrock)

The documentation agent. Uses Claude to author a comprehensive Markdown wiki page (including the MR link and root-cause analysis), applies the auto-fixed label, and posts a final 4-agent closure summary on the issue.

LangGraph Tools:

  • load_context — reads issue_context.env
  • get_issue_details — GET /issues/:iid
  • get_merge_request_url — reads MR_URL env var (API fallback)
  • create_wiki_page — POST /wikis with Claude-authored Markdown
  • post_wiki_comment — posts wiki link on the issue
  • add_auto_fixed_label — creates and applies auto-fixed label
  • post_closure_comment — posts 4-agent pipeline summary

Note: Agent 4 does NOT close the issue. Issues remain open pending MR review and merge by a human.


Shared Module — flows/gitlab_client.py

All agents import shared constants, helpers, and the LLM builder from a single module:

from flows.gitlab_client import API_URL, GL_HEADERS, PROJECT_ID, build_llm, post_issue_comment

This module provides: API_URL, GL_HEADERS, PROJECT_ID, GITLAB_TOKEN, TRIGGER_TOKEN, load_issue_context(), build_llm(), post_issue_comment(), ensure_label(), apply_label().


Technology Stack

Layer Technology
CI/CD Platform GitLab CI/CD
Agent Framework LangGraph (ReAct pattern)
LLM Claude 3.5 Sonnet (anthropic.claude-3-5-sonnet-20240620-v1:0)
LLM Runtime AWS Bedrock (langchain-aws, boto3)
HTTP Client requests (GitLab REST API v4)
Shared Module flows/gitlab_client.py
Application Under Test Java 17, Maven 3.9.6, JUnit 4.13.2
Container python:3.11-slim per CI job

Key Design Decisions

1. Separation of Concerns

AI agents handle reasoning. Plain Python handles deterministic Git operations. Each job has a single, auditable responsibility.

2. ReAct Agent Pattern

Agents 1, 2, and 4 use LangGraph ReAct — Claude reasons about tool outputs before deciding the next action, enabling multi-step code understanding without hardcoded logic.

3. Artifact-Based Communication

Agents communicate exclusively through GitLab CI artifact files and dotenv injection. No shared database, no external queue — the platform's built-in mechanism is sufficient and reliable.

4. Human-in-the-Loop Safety

No auto-merge. Every fix goes through a reviewable Merge Request. Issues stay open until a human approves and merges.

5. Shared flows/ Module

Extracting common GitLab API logic into flows/gitlab_client.py eliminates duplication across all four agents and makes the system easier to extend.


Impact

Metric Before AutoBot With AutoBot
Mean Time to Resolution Hours to days Under 15 minutes
Manual triage effort High Zero for known patterns
Wiki documentation rate 0% 100% of auto-fixed issues
Duplicate bug risk High Reduced (wiki + label history)
MR review process Same Unchanged — human still approves

Repository Structure

java-auto-fix-app/
├── .gitlab-ci.yml                              # 4-stage pipeline definition
├── .ai-catalog-mapping.json                    # GitLab AI Catalog mapping
├── agents/
│   ├── agent1_analyze_issue.py                 # Agent 1 — Issue Analyzer (LangGraph + Claude)
│   ├── agent2_auto_fix.py                      # Agent 2 — Auto Fix (LangGraph + Claude)
│   ├── agent3_mr_creation.py                   # Agent 3 — MR Creation (Python)
│   ├── agent4_wiki_documenter.py               # Agent 4 — Wiki Documenter (LangGraph + Claude)
│   └── agents.yml                              # GitLab AI Catalog item definition
├── flows/
│   ├── gitlab_client.py                        # Shared config, helpers, build_llm()
│   └── flows.yml                               # GitLab AI Catalog flow definition
├── src/
│   ├── main/java/com/example/service/
│   │   ├── PaymentService.java
│   │   ├── UserService.java
│   │   └── User.java
│   └── test/java/com/example/service/
│       ├── PaymentServiceTest.java
│       └── UserServiceTest.java
└── pom.xml                                     # Java 17 + JUnit 4.13.2

Demo Walkthrough

  1. Create a GitLab issue: NullPointerException in PaymentService — amount is null
  2. Pipeline triggers (schedule or manual) — Agent 1 detects the issue
  3. in-progress label applied — Agent 2 marks the issue immediately
  4. Root-cause comment posted — Claude identifies processPayment() calls amount.multiply() without null guard
  5. Branch autofix/issue-<n> created — Agent 3 commits the patched PaymentService.java
  6. Merge Request openedCloses #<n> in description, ready for human review
  7. Wiki page created — full Markdown documentation with MR link
  8. auto-fixed label applied — prevents reprocessing
  9. Closure summary comment — 4-agent pipeline summary posted on issue

Setup

Required CI/CD Variables

Variable Description Masked
GITLAB_PAT Personal Access Token with api + write_repository scopes Yes
CI_PIPELINE_TRIGGER_TOKEN Pipeline trigger token Yes
AWS_ACCESS_KEY_ID AWS credentials for Bedrock Yes
AWS_SECRET_ACCESS_KEY AWS credentials for Bedrock Yes
AWS_DEFAULT_REGION Bedrock region (default: ap-southeast-1) No

Trigger

# Manual API trigger
curl --request POST \
  --form "token=$CI_PIPELINE_TRIGGER_TOKEN" \
  --form "ref=main" \
  --form "variables[ISSUE_IID]=42" \
  "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/trigger/pipeline"

Future Roadmap

  • More bug patterns — dependency errors, test failures, configuration issues (Claude already handles arbitrary patterns; just needs more test cases)
  • Maven build validation — run mvn test inside Agent 2 to verify the fix compiles before committing
  • Slack / Teams notification — notify on-call engineers when a fix is raised
  • Severity routing — triage critical bugs to immediate pipelines, low-severity to batch
  • Changelog generation — append to a master CHANGELOG.md wiki page on each fix

AutoBot · GitLab CI/CD · LangGraph · Claude 3.5 Sonnet · AWS Bedrock · Python 3.11

Built With

Share this project:

Updates