An AI software engineering agent that analyzes repositories and GitHub issues using LLM-powered workflows. It reduces the manual effort required for repository understanding, code review, bug triage, documentation, fix planning, and protected pull request preparation.
- ✅ Repository question answering
- ✅ AI-assisted code review
- ✅ Bug triage and root-cause analysis
- ✅ Documentation generation
- ✅ GitHub issue analysis
- ✅ Code-fix and patch suggestions
- ✅ Protected pull request workflow components
- ✅ OpenAI, Claude, and local mock modes
- ✅ MCP repository tools
- ✅ Docker deployment
- ✅ Filesystem and GitHub write safety controls
- ✅ Unit tests and GitHub Actions CI
User or GitHub Issue
↓
FastAPI
↓
LangGraph Workflow
↙ ↓ ↘
Repository LLM GitHub API
Tools Provider Service
↓ ↓ ↓
Local Code OpenAI/Claude Proposed Fix or PR Plan
| Area | Technologies |
|---|---|
| Language | Python 3.11+ |
| API | FastAPI, Pydantic, Uvicorn |
| Agent orchestration | LangGraph |
| LLM integration | LangChain, OpenAI, Anthropic Claude |
| Tool protocol | Model Context Protocol, MCP |
| Repository integration | GitHub REST API, HTTPX |
| Deployment | Docker, Docker Compose |
| Testing and quality | Pytest, Ruff, MyPy, GitHub Actions |
- Python and backend development
- Software engineering and modular architecture
- REST API design with FastAPI
- AI agents and LangGraph workflows
- LangChain tool development
- OpenAI and Claude integration
- Prompt engineering and structured outputs
- GitHub API integration
- Model Context Protocol, MCP
- Secure filesystem handling
- Human-in-the-loop workflow design
- Unit testing and API testing
- CI/CD with GitHub Actions
- Docker containerization
- Error handling and configuration management
ai-coding-agent/
├── app/
│ ├── agents/ # LangGraph workflow, prompts, output parser
│ ├── api/ # FastAPI routes
│ ├── core/ # Settings, logging, dependencies, security
│ ├── llm/ # OpenAI, Claude, and mock providers
│ ├── models/ # Pydantic request, response, and state models
│ ├── services/ # Repository and GitHub API services
│ ├── tools/ # LangChain repository tools
│ └── main.py # FastAPI application entry point
├── mcp_server/ # MCP server and repository tools
├── evaluation/ # Lightweight evaluation script and results
├── examples/ # Example API request and output
├── tests/ # Unit, security, repository, and API tests
├── docs/
│ ├── images/ # Architecture and API screenshots
│ └── architecture.md
├── workspace/ # Safe root for local repositories
├── .github/workflows/ # CI pipeline
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── pyproject.toml
└── LICENSE
git clone https://github.com/ParisaArbab/ai-coding-agent.git
cd ai-coding-agent
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --reloadOn Windows, activate the environment with:
.venv\Scripts\activatepip install -e ".[dev]"Open Swagger UI at http://localhost:8000/docs.
Mock mode is enabled by default, so the project can run without a paid API key.
OpenAI:
LLM_PROVIDER=openai
OPENAI_API_KEY=your_key
OPENAI_MODEL=gpt-4.1-miniClaude:
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=your_key
ANTHROPIC_MODEL=claude-sonnet-4-5GitHub repository access:
GITHUB_TOKEN=your_tokenGitHub writes remain disabled unless explicitly enabled:
ALLOW_PR_CREATION=trueThe main endpoint supports five task types:
POST /api/v1/agent/run
Content-Type: application/json{
"task_type": "repository_qa",
"instruction": "Explain the architecture and request flow.",
"repository_path": "sample_repo"
}{
"task_type": "code_review",
"instruction": "Review the code for reliability and security problems.",
"repository_path": "sample_repo"
}{
"task_type": "issue_fix",
"instruction": "Analyze issue 42 and propose a fix.",
"github_owner": "owner",
"github_repo": "repository",
"issue_number": 42
}Input issue:
The divide function crashes when the second value is zero.
Agent response:
{
"task_type": "bug_triage",
"summary": "The function does not validate a zero divisor.",
"analysis": "calculator.py directly performs a / b. Python raises ZeroDivisionError when b is zero.",
"proposed_changes": [
"Validate the divisor before division",
"Raise a clear ValueError for zero input",
"Add tests for normal and zero-divisor cases"
],
"patch": "--- a/calculator.py\n+++ b/calculator.py\n@@\n+ if b == 0:\n+ raise ValueError('b must not be zero')",
"files_considered": ["calculator.py", "README.md"],
"warnings": []
}The project does not return a fake confidence percentage. A future evaluation layer can add calibrated confidence based on test execution and retrieval quality.
A request enters FastAPI and is validated with Pydantic. LangGraph then collects safe repository context from a local workspace or GitHub, sends the task and selected code to the configured LLM, parses the structured response, and returns analysis, recommended changes, and an optional patch. GitHub write operations are separated from analysis and disabled by default so a human can review changes before a branch or pull request is created.
Request
↓
Input validation
↓
Repository or GitHub context collection
↓
Relevant file selection
↓
LLM analysis
↓
Structured output parsing
↓
Recommendation and patch proposal
↓
Optional human-approved GitHub workflow
The included evaluation is intentionally simple and reproducible. It measures engineering behavior rather than claiming model accuracy without a labeled benchmark.
| Metric | Result | Meaning |
|---|---|---|
| Supported task types | 5/5 | Q&A, review, triage, documentation, issue fixing |
| Local unit tests | 4/4 passed | Parser, repository, and security tests |
| API health test | Included | Runs after project dependencies are installed |
| Python syntax validation | Passed | All Python source files compile |
| CI configuration | Included | Ruff and Pytest run on push and pull request |
| Mock response latency | Under 1 second locally | No external model or network call |
Run the evaluation:
python evaluation/benchmark.pyRun the complete test suite:
pytest -v
pytest --cov=app --cov=mcp_server --cov-report=term-missingSee evaluation/results.json for the stored baseline. Real OpenAI or Claude quality depends on the selected model, repository size, prompt, and network latency. A production benchmark should use labeled GitHub issues and human review scores.
- Hallucination control: The model may propose files or APIs that do not exist. The prompt requires repository-grounded answers.
- Context limits: Large repositories cannot be placed fully in one prompt. The current version selects a limited set of files.
- Prompt injection: Repository text may contain instructions for the model. The system prompt treats code and documentation as untrusted data.
- Safe code execution: Running generated code creates security risk. Command execution is disabled in this starter version.
- Patch reliability: A syntactically valid response may still produce an incorrect patch. Human approval and test execution are required before writes.
- GitHub permissions: Tokens must use minimum permissions, and automatic writes must remain protected.
- Multi-agent planning with reviewer and tester agents
- Semantic code search and repository embeddings
- Sandboxed test and lint execution
- Automatic patch validation with
git apply --check - Human approval checkpoints in LangGraph
- Persistent memory and LangGraph checkpoints
- Streaming API responses
- Webhook-driven GitHub issue processing
- PostgreSQL or Redis for durable job state
- Kubernetes deployment and horizontal scaling
- LangSmith or OpenTelemetry tracing
- Labeled benchmark dataset and LLM-as-judge evaluation
- Small web dashboard and recorded demo GIF
Run the MCP server with standard input/output transport:
python -m mcp_server.serverAvailable tools:
list_repository_filesread_repository_filesearch_repositorysummarize_repository
docker compose up --buildThe API will be available at http://localhost:8000.
pytest
ruff check .
mypy appThe GitHub Actions workflow in .github/workflows/ci.yml installs the project, runs Ruff, and runs Pytest on every push and pull request.
A live hosted demo and video are not included because they require deployment credentials or a recorded external asset. The repository includes two screenshots, sample requests, sample output, Swagger UI, and mock mode for a fast local demonstration.
Recommended 30-second demo flow:
- Start the API with
uvicorn app.main:app --reload. - Open
/docs. - Submit a
code_reviewrequest forsample_repo. - Show the structured findings and patch proposal.
- Run
pytestto show automated tests.
Under Active Development
The architecture and core workflows are complete for a portfolio demonstration. Production deployment still requires sandboxed execution, stronger retrieval, persistent job storage, authentication, observability, and a human approval interface.
Parisa Arbab
- GitHub: ParisaArbab
- LinkedIn: parisa-arbab


