How chirag0071/ai-software-engineer works
This is a FastAPI multi-agent software-engineering service. A user submits a change request and repository path; the workflow analyzes the repository, plans and implements changes, runs tests, retries debugging when needed, and reviews the result. Approval gates GitHub branch and pull-request operations. The graph captures the documented workflow wiring and sampled integrations; several agent implementations and portions of the API are unsampled, so their internal calls are not expanded.
Main entry points: workflow.py Workflow graph · main.py FastAPI API · llm.py LLM clients · filesystem.py Safe file access
Components 26
API and identity
- FastAPI API
backend/main.py - JWT auth
backend/auth/jwt.py - Auth dependencies
backend/auth/dependencies.py - Google OAuth
backend/auth/google.py - Role checks
backend/auth/roles.py - Health check
backend/utils/health.py
Engineering workflow
- Workflow graph
backend/graph/workflow.py - Run state
backend/graph/state.py - Planner
backend/agents/planner.py - Plan models
backend/agents/planner_models.py - Coder
backend/agents/coder.py - Test agent
backend/agents/test_agent.py - Debugger
backend/agents/debugger.py - Code review
backend/agents/code_review.py - Human approval
backend/agents/human_approval.py
Repository tools
- Repository scan
backend/agents/repository.py - Repository scanner
backend/tools/repository.py - Repository intelligence
backend/agents/repository_intelligence.py - Safe file access
backend/tools/filesystem.py - Test runner
backend/tools/test_runner.py
Models and GitHub
- LLM clients
backend/llm.py - Pull request service
backend/github/pr_service.py - GitHub client
backend/github/client.py
Other components
- User
- Groq
- GitHub
Connections 30
- User → FastAPI API: submits request
backend/main.py - FastAPI API → Auth dependencies: checks identity
backend/auth/dependencies.py - Auth dependencies → JWT auth: verifies token
backend/auth/dependencies.py - FastAPI API → Google OAuth: offers OAuth
backend/main.py - FastAPI API → Role checks: checks roles
backend/main.py - FastAPI API → Health check: checks health
backend/main.py - FastAPI API → Workflow graph: starts workflow
backend/main.py - Workflow graph → Repository scan: dispatches
backend/graph/workflow.py - Workflow graph → Repository intelligence: dispatches
backend/graph/workflow.py - Workflow graph → Planner: dispatches
backend/graph/workflow.py - Workflow graph → Coder: dispatches
backend/graph/workflow.py - Workflow graph → Test agent: dispatches
backend/graph/workflow.py - Workflow graph → Debugger: dispatches
backend/graph/workflow.py - Workflow graph → Code review: dispatches
backend/graph/workflow.py - Workflow graph → Human approval: dispatches
backend/graph/workflow.py - Repository scan → Repository scanner: scans files
backend/agents/repository.py - Repository intelligence → Safe file access: reads files
backend/agents/repository_intelligence.py - Code review → Safe file access: reads files
backend/agents/code_review.py - Coder → Safe file access: uses file access
backend/agents/coder.py - Debugger → Safe file access: uses file access
backend/agents/debugger.py - Planner → Plan models: uses schemas
backend/agents/planner.py - Test agent → Test runner: runs tests
- Planner → LLM clients: requests model
backend/agents/planner.py - Coder → LLM clients: requests model
backend/agents/coder.py - Debugger → LLM clients: requests model
backend/agents/debugger.py - Code review → LLM clients: requests model
backend/agents/code_review.py - LLM clients → Groq: calls API
backend/llm.py - FastAPI API → Pull request service: handles approval
backend/main.py - Pull request service → GitHub client: operates Git
backend/github/pr_service.py - GitHub client → GitHub: calls REST API
backend/github/client.py