An autonomous AI agent that automatically discovers trending GitHub repositories, generates AI answers to community questions (Issues & Discussions), and creates real code patches and opens PRs for solvable issues — all gated behind a human-in-the-loop approval workflow.
| Feature | Description |
|---|---|
| 🔍 Trend Hunter | Discovers trending repos in 5 languages (Python, JS, TS, Go, Rust) and scores them by priority |
| 💬 Issue Support | Analyzes issues and generates AI answers with RAG context |
| 🗣️ Discussion Support | Automatically generates replies to GitHub Discussions |
| 🔧 Issue Solver | Solvability analysis → real code patch generation → syntax check → Docker sandbox test |
| 🚀 Autonomous PR | Fork → Branch → Commit → PR pipeline |
| 🛡️ Human Approval | All comments and PRs wait for approval before being sent |
| 📚 RAG Pipeline | Clone repo → index into ChromaDB → smart code search in issue context |
| 🐳 Docker Sandbox | Tests AI-generated code in an isolated environment |
| ⚡ Rate Limiting | Automatically manages GitHub API limits |
┌──────────────────────────────────────────────┐
│ FastAPI (api/main.py) │
│ /health /stats /pending /approve /... │
└──────────────────────┬───────────────────────┘
│
┌──────────────────────▼───────────────────────┐
│ Agent Orchestrator │
│ 6-phase pipeline: │
│ Trend Hunt → Repo Setup → Community → │
│ Discussions → Issue Solving → PR Pipeline │
└─────┬─────────┬──────────┬──────────┬────────┘
│ │ │ │
┌─────▼────┐ ┌──▼───────┐ ┌▼────────┐ ┌▼───────┐
│ GitHub │ │ LLM │ │ RAG │ │ Docker │
│ Client │ │Providers │ │ChromaDB │ │Sandbox │
│(GQL+REST)│ │Groq/Olla.│ │ │ │ │
└──────────┘ └──────────┘ └─────────┘ └────────┘
- Python 3.10+
- PostgreSQL (data storage)
- Ollama + the
qwen3-coder:30bmodel - Docker (for sandbox tests)
- Git (for cloning repos)
# Virtual environment
python -m venv venv
.\venv\Scripts\Activate.ps1 # Windows
# source venv/bin/activate # Linux/Mac
# Dependencies
pip install -r requirements.txt
# Ollama model (start.ps1 pulls this automatically; you can also do it manually)
ollama pull qwen3-coder:30bcopy .env.example .env # Windows
# cp .env.example .env # Linux/MacEdit the .env file:
GITHUB_TOKEN→ Create a GitHub PAT (required scopes:repo,read:discussion,write:discussion)POSTGRES_*→ PostgreSQL connection details
Schema changes are managed with Alembic (create_all() does not add columns to existing tables).
# Fresh / empty database:
python init_db.py && alembic stamp head
# Update an existing database (apply pending migrations):
alembic upgrade head
# Generate a new migration after changing a model:
alembic revision --autogenerate -m "description" && alembic upgrade headSingle entry point — starts everything with one click: PostgreSQL service + Ollama (serve & model pull) + DB init + FastAPI (:8000) + Next.js (:3000).
powershell -ExecutionPolicy Bypass -File .\start.ps1FastAPI only (e.g. for API debugging):
venv\Scripts\python.exe -m uvicorn api.main:app --host 0.0.0.0 --port 8000Dashboard: http://localhost:3000 · Swagger UI: http://localhost:8000/docs
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Agent status |
GET |
/health |
Service health (DB, Ollama, GitHub, Docker) |
GET |
/agent/stats |
Statistics |
POST |
/agent/trigger?task_type=... |
Trigger a task manually |
GET |
/agent/pending-actions |
Code changes awaiting approval |
GET |
/agent/pending-comments |
Comments awaiting approval |
POST |
/agent/approve-action/{id} |
Approve code change → open PR |
POST |
/agent/reject-action/{id} |
Reject code change |
POST |
/agent/approve-comment/{id} |
Approve comment → post to GitHub |
POST |
/agent/reject-comment/{id} |
Reject comment |
GET |
/agent/actions?limit=20 |
Action history |
| Variable | Default | Description |
|---|---|---|
OLLAMA_MODEL |
qwen3-coder:30b |
AI model |
TRENDING_DAYS_AGO |
7 |
How many days back to search for repos |
MIN_STARS_THRESHOLD |
50 |
Minimum star count |
LOOP_INTERVAL_SECONDS |
3600 |
Main loop interval (seconds) |
TASK_CONCURRENCY |
3 |
Number of repos processed in parallel |
REQUIRE_APPROVAL_FOR_PR |
true |
Whether PRs require approval |
REQUIRE_APPROVAL_FOR_COMMENT |
true |
Whether comments require approval |
github-agent/
├── agent/
│ ├── orchestrator.py # Main orchestrator (6-phase pipeline)
│ ├── ai/ # AIReasoningService (provider-agnostic reasoning)
│ ├── providers/ # Swappable LLM providers (Groq / Ollama / HF)
│ ├── prompts/ # Jinja2 prompt templates
│ ├── rag/ # Chunking, retrieval, reranking
│ ├── scoring/ # Repo & issue prioritization
│ ├── solver/ # Agentic code-fix loop (patch + verify)
│ ├── trends/ # Trend aggregation (GitHub, HN, Reddit)
│ └── tools/
│ ├── github_client.py # GitHub API (GraphQL + REST)
│ ├── chroma_client.py # ChromaDB indexing & search
│ └── docker_env.py # Docker sandbox
├── api/
│ └── main.py # FastAPI endpoints
├── core/
│ └── config.py # Pydantic settings (.env)
├── database/
│ ├── models.py # SQLAlchemy models
│ └── session.py # DB connection management
├── dashboard/ # Next.js approval & monitoring UI
├── alembic/ # DB schema migrations
├── tests/ # Pytest suite
├── .github/workflows/ # CI (lint + typecheck + tests + build)
├── start.ps1 # One-click launcher (single entry point)
├── init_db.py # DB bootstrap
├── pyproject.toml # Ruff + pytest config
└── requirements.txt
Released under the MIT License.
Powered by Groq / Ollama (swappable LLM) + GitHub GraphQL API + ChromaDB + Docker