An AI-powered coding agent built with Python 3.11 that explores an existing GitHub repository, identifies relevant source files, creates an implementation plan using a local Large Language Model (LLM), applies AI-assisted code modifications, and generates an execution summary.
The project was developed as part of the AI Coding Agent Assignment.
- 🔍 Clone and inspect an existing GitHub repository
- 📂 Automatically explore the repository structure
- 🧠 Identify relevant source files based on the user request
- 📄 Read and analyze project files
- 🤖 Generate an implementation plan using Qwen2.5-Coder running locally with Ollama
- ✨ Apply AI-assisted modifications to the selected files
- 📝 Generate an execution report summarizing the completed work
- 🛠 Preserve the existing Node.js application structure
User Request
│
▼
AI Coding Agent
│
┌──────────────┼──────────────┐
│ │ │
▼ ▼ ▼
Repository Repository Implementation
Exploration Analysis Planning
│ │ │
└──────────────┼──────────────┘
▼
Relevant File Selection
│
▼
Ollama (Qwen2.5-Coder 7B)
│
▼
AI Code Modification
│
▼
Updated Repository Files
│
▼
Execution Report
- Clone the target GitHub repository.
- Explore the repository structure.
- Detect relevant project files.
- Read important source files.
- Generate an implementation plan using the LLM.
- Apply AI-generated code modifications.
- Save the updated files.
- Generate an execution report.
ai_coding_agent/
│
├── core/
│ ├── explorer.py
│ ├── indexer.py
│ ├── planner.py
│ ├── modifier.py
│ ├── executor.py
│ └── summarizer.py
│
├── providers/
│ ├── ollama_provider.py
│ ├── base.py
│ └── placeholder.py
│
├── reports/
│ └── execution_report.md
│
├── tools/
│ ├── read_file.py
│ ├── write_file.py
│ ├── git_diff.py
│ └── run_tests.py
│
├── workspace/
│ └── target_repo/
│
├── agent.py
├── requirements.txt
└── README.md
The agent automatically analyzes the cloned repository and identifies the files most relevant to the requested feature.
For the provided repository, the agent selected:
app/controllers/note.controller.jsapp/models/note.model.jsapp/routes/note.routes.js
These files were identified because they control note management, data storage, and API routing.
Improve the application so users can better organise and search their notes.
The AI agent proposed and applied changes including:
- Added support for note categories
- Added support for note tags
- Improved search functionality
- Updated controller logic
- Updated data model
- Updated API routes
After modification, the Node.js application was successfully started to verify that the project remained operational.
| Category | Technology |
|---|---|
| Language | Python 3.11 |
| LLM | Qwen2.5-Coder (7B) |
| Runtime | Ollama |
| Backend Target | Node.js + Express.js |
| Version Control | Git |
- The target repository follows a standard Node.js project structure.
- Relevant files can be identified through repository exploration.
- AI-generated code is reviewed before final acceptance.
- The repository is accessible through Git.
- Large repositories increase processing time.
- LLM-generated code may require human review.
- The current implementation modifies selected files rather than generating Git patches.
- Repository-specific testing is limited to verifying successful application startup.
git clone <your-repository-url>
cd ai_coding_agentpip install -r requirements.txtollama serveollama pull qwen2.5-coder:7bpython agent.py==================================================
AI CODING AGENT
==================================================
[1/5] Exploring repository...
Relevant Files
- app/controllers/note.controller.js
- app/models/note.model.js
- app/routes/note.routes.js
[3/5] Reading important files...
[4/5] Creating execution plan...
[5/6] Applying AI modifications...
✅ Updated note.controller.js
✅ Updated note.model.js
✅ Updated note.routes.js
Execution report generated.
AI assistance was used for:
- Repository understanding
- Execution planning
- Source code modification
- Documentation generation
All AI-generated code was manually reviewed before being accepted to ensure the target application remained functional.
- Multi-file context reasoning
- Git patch generation instead of full file replacement
- Automatic syntax validation
- Unit test execution
- Rollback support
- Docker containerization
- Support for multiple LLM providers
- Interactive command-line interface
Ishar Roy
B.Tech – Computer Science & Engineering
Future Institute of Engineering and Management