AI agent that automatically fixes GitHub issues and opens pull requests.
FastAPI β’ LangChain β’ RAG β’ LLM Agents β’ Docker β’ GitHub API
- Input: GitHub Issue
- Output: Auto-generated fix + Draft PR
- π Intelligent code retrieval using RAG
- π€ Autonomous agent loop (plan β edit β validate-> self healing)
- π§ Automatic bug fixing from GitHub issues
- π Draft PR generation with commits
- β‘ Supports multiple LLM providers
Modern software development is moving towards AI-assisted workflows. This project demonstrates how LLM agents can:
- Understand large codebases
- Fix real-world issues
- Integrate with developer tools like GitHub
The live GitHub flow looks like this:
- A developer opens a GitHub issue.
- GitHub sends an
issueswebhook to AIDE. - Clones the repository locally.
- Parses the repository and builds a retrieval index.
- Finds relevant files and creates a repair plan.
- Edits the likely file(s), validates syntax, and runs tests when present.
- Creates a branch, pushes the fix, and opens a draft PR.
- Comments back on the issue with the result.
api/ FastAPI app and GitHub webhook entrypoint
backend/agents/ retriever, Planner, coder, fixer, critic, self healer, orchestration
backend/rag/ Parser, retriever, vector store
backend/services/ execution helpers, llm service, github service
scripts/ Manual test and exploration scripts
tests/ Automated tests for the live autonomous flow
repos/ Cloned target repositories and job workspaces
The project supports 4 LLM providers (in priority order):
openai- OpenAI GPT modelsanthropic- Anthropic Claude modelsgemini- Google Gemini modelsollama- Local Ollama (default)
git clone <your-repo-url>
cd Autonomous-Issue-Driven-EngineerExample :
GITHUB_TOKEN=your_github_token
GITHUB_WEBHOOK_SECRET=your_random_webhook_secret
LLM_PROVIDER=Your chosen provider - openai, anthropic, gemini or ollama.
LLM_MODEL=Your chosen model name for that provider, e.g. qwen2.5-coder:7b
OPENAI_API_KEY=your_key // If using OpenAI
ANTHROPIC_API_KEY=your_key // If using Anthropic
GOOGLE_API_KEY=your_key // If using Google Gemini
OLLAMA_BASE_URL=http://host.docker.internal:11434- Go to GitHub -> Settings -> Developer settings -> Personal access tokens -> Fine-grained tokens -> Generate new token
- Set permissions: Repository permissions -> Contents, Issues, Pull requests (Read and write)
- Copy the generated token and paste it into
.envasGITHUB_TOKEN
Generate a strong random string (e.g. with Python import secrets; print(secrets.token_hex(32))) and paste it into .env as GITHUB_WEBHOOK_SECRET. Use the same value when configuring the GitHub webhook.
If using OpenAI, Anthropic, or Google Gemini, create API keys on their respective platforms and add them to .env as OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY.
- make sure to set
LLM_PROVIDER=ollamaandOLLAMA_BASE_URL=http://host.docker.internal:11434in.env. - Install Ollama on your host machine from https://ollama.com/.
- Pull the model you want to use, for example:
ollama pull qwen2.5-coder:7b- Install Docker desktop from https://www.docker.com/products/docker-desktop and
- Run Docker desktop so that you can use Docker commands and Docker Compose to run the project.
To allow GitHub to send webhooks to your local development server, you need to expose it to the internet using a tunnel. Cloudflare Tunnel is a great option for this.
- Install Cloudflare Tunnel (cloudflared) from https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/
- Run the tunnel to expose your local API:
cloudflared tunnel --url http://localhost:8000- Cloudflare will provide you with a public URL like
https://your-random-name.trycloudflare.com. This is the URL GitHub will use to send webhooks. - In your GitHub repository, go to
Settings -> Webhooks -> Add webhookand configure it with:
- Payload URL:
https://your-random-name.trycloudflare.com/api/webhook/github - Content type:
application/json - Secret: same value as
GITHUB_WEBHOOK_SECRETin.env - Events: select
Issues - Active: enabled
Note : Keep the tunnel running in a seprate terminal while you are developing and testing, so GitHub can reach your local API.
- Start the Ollama server ina separate terminal (if using Ollama):
ollama serve- Now build docker image and run the project with Docker Compose in seprate terminal:
docker compose build
docker compose upNow you can open a new GitHub issue to trigger the flow. Keep an eye on the terminal running Docker Compose to see the logs and results.
- Intelligent Testing Pipeline
- Automatically generate and run tests to validate fixes before PR creation.
- CI/CD and DevOps Automation
- Automated Docker optimization and Kubernetes deployment generation.
- Integrate GitHub Actions pipelines for continuous integration.
- Memory and Learning System
- Implement a long-term memory system for the agent to learn from past issues and fixes.
- Use vector databases to store and retrieve past issue contexts and solutions.
- Store reusable engineering patterns and architectural decisions.
- Human-in-the-Loop Collaboration
- Allow developers to approve, reject, or modify agent-generated plans.
- Multi-Modal Engineering Support
- Support for diagram understanding, UI screenshots, and architecture images.
- Enable code generation directly from whiteboard designs or flowcharts.
This project is licensed under the MIT License.







