Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoFix AI — Multi-Agent Orchestration System

An autonomous GitHub issue fixer powered by 11 specialized AI agents built with LangGraph StateGraph. Give it a GitHub issue. It researches, fixes, tests, audits, and ships a Pull Request — automatically.


Live Demo

AutoFix AI Dashboard


How It Works

\
GitHub Issue → Code Reader → Router ──► SIMPLE ──────────────────► Planner └──► COMPLEX ──► Researcher ──► Planner │ Code Writer │ Test Writer │ │ PASSED FAILED (retry x3) │ │ └───────┘ │ Security Auditor │ Summarizer │ PR Opener │ Notifier │ Discord Notification \\


Agent Pipeline

# Agent Role Type
01 Code Reader Reads relevant repo files via GitHub API Core
02 Router Classifies issue as SIMPLE or COMPLEX Core
03 Researcher Deep research for complex issues only NEW
04 Planner Creates step-by-step fix strategy Core
05 Code Writer Writes the patch with self-healing Core
06 Test Writer Writes + runs pytest unit tests Core
07 Security Auditor Scans for vulnerabilities NEW
08 Summarizer Writes professional PR description NEW
09 PR Opener Opens Pull Request on GitHub Core
10 Notifier Posts comment on original issue Core
11 Discord Notifier Sends rich embed to Discord NEW

Key Engineering Features

Intelligent Routing

The Router agent classifies each issue before the pipeline runs:

  • SIMPLE issues skip straight to the Planner (fast path)
  • COMPLEX issues trigger the Researcher agent first (deep path)

This is implemented using LangGraph conditional edges — the core difference between graph-based and chain-based agent systems.

Self-Healing Loop

If the generated tests fail, the system automatically:

  1. Sends the test error back to the Code Writer
  2. Code Writer rewrites the patch with the error as context
  3. Test Writer runs again
  4. Repeats up to 3 times before continuing

This is a cycle in the graph — the most advanced LangGraph pattern.

Live Dashboard

Built with FastAPI + Server-Sent Events (SSE). Every agent lights up in real time as it runs. No polling — pure streaming.


Tech Stack

Tool Purpose
LangGraph Agent orchestration (StateGraph)
Groq (llama-3.1-8b-instant) Free LLM inference
PyGithub GitHub API — branches, PRs, comments
FastAPI + SSE Real-time dashboard backend
Vanilla JS Live frontend (no framework needed)
pytest Automated test execution
Discord Webhooks Rich notifications

Setup

1. Clone and install

\\�ash git clone https://github.com/ggbadbi/multi-agent-test cd multi-agent-test python -m venv venv venv\Scripts\activate # Windows pip install -r requirements.txt \\

2. Create .env

\
GROQ_API_KEY=gsk_... GITHUB_TOKEN=ghp_... GITHUB_REPO=username/repo-name DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/... \\

3. Run the dashboard

\\�ash uvicorn dashboard.app:app --reload --port 8000 \\

4. Open and run

Go to http://localhost:8000, enter a GitHub issue number, hit Run Pipeline.

5. CLI mode (no dashboard)

\\�ash python main.py \\


Results

Every pipeline run automatically:

  • Opens a Pull Request with the fix + tests
  • Posts a comment on the original issue
  • Sends a Discord notification with full summary

Project Structure

\
multi-agent-orchestrator/ ├── agents/ │ ├── state.py # Shared AgentState TypedDict │ ├── code_reader.py # GitHub repo reader │ ├── router.py # Complexity classifier │ ├── researcher.py # Deep research (complex issues) │ ├── planner.py # Fix strategy creator │ ├── code_writer.py # Patch writer (self-healing) │ ├── test_writer.py # Test writer + runner │ ├── security_auditor.py # Vulnerability scanner │ ├── summarizer.py # PR description writer │ ├── pr_opener.py # GitHub PR creator │ ├── notifier.py # GitHub comment poster │ └── discord_notifier.py # Discord webhook sender ├── dashboard/ │ ├── app.py # FastAPI + SSE backend │ └── static/ │ └── index.html # Live dashboard UI ├── main.py # CLI entry point + graph builder ├── requirements.txt └── .env # API keys (never commit) \\


What I Learned

  • LangGraph StateGraph — graph-based vs chain-based agent orchestration
  • Conditional edges — routing agents based on live state
  • Cyclic graphs — self-healing feedback loops
  • Server-Sent Events — real-time streaming without WebSockets
  • GitHub API — programmatic branch/PR/comment management
  • Agentic design patterns — single responsibility, shared state, error recovery

Author

Built by @ggbadbi

This project was built to demonstrate real-world multi-agent system design using modern AI engineering tools.

About

Autonomous GitHub issue fixer — 11 AI agents with intelligent routing, self-healing loops, and live dashboard

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages