Inspiration
Debugging is one of the most time consuming parts of software development. Developers often spend hours identifying bugs, testing possible solutions, and fixing errors. We wanted to build an AI powered assistant that goes beyond suggesting code and actually tests whether a proposed fix works. This inspired us to create RepoMedic AI, an intelligent repository repair agent focused on evidence based debugging.
What it does
RepoMedic AI analyzes Python repositories, identifies potential causes of reported bugs, and generates AI powered code patches. It validates patches using safety checks, applies them in isolated workspaces, and runs tests using pytest inside a restricted Docker environment. If a fix fails, it uses test failure evidence to attempt another repair, with a maximum of three attempts. It provides code differences, test results, logs, and repair evidence to help developers review the changes.
How we built it
We built RepoMedic AI using Python, an AI coding model called Qwen2.5 Coder 7B through Ollama, Git, pytest, and Docker. The system includes a repository scanner, an AI model adapter, a patch validation layer, an isolated test runner, and an orchestration engine. It supports a command line interface, a web interface, and a REST API. We also developed a benchmark to compare one shot AI repairs with iterative, evidence driven repairs.
Challenges we ran into
One of our biggest challenges was ensuring that AI generated patches were safe and reliable. A patch that looks correct may still fail when executed. We also had to handle invalid diffs, test failures, unsafe file modifications, and execution isolation. Another challenge was designing a repair loop that learns from test failure evidence without retrying indefinitely. We addressed these challenges through patch validation, restricted execution, disposable Git worktrees, and a bounded retry mechanism.
Accomplishments that we are proud of
We are proud of building a complete AI assisted repository repair workflow rather than just a code suggestion tool. RepoMedic AI combines AI generated patches with automated testing and safety checks. In our initial ten task Python benchmark, the iterative repair workflow achieved a fifty percent pass rate compared with twenty percent for one shot repair. We also developed a reporting system that presents code differences and test evidence, making repair attempts easier to inspect and evaluate.
What we learned
We learned that generating code and verifying code are two different challenges. AI generated fixes should not be trusted simply because they look correct. They must be tested and reviewed. We gained practical experience in AI agent orchestration, local language models, Git worktrees, Docker based isolation, automated testing, patch validation, and benchmark evaluation. Most importantly, we learned to treat test results as evidence of correctness within the available tests, not as a guarantee that every bug has been eliminated.
What is next for RepoMedic AI
Our next steps are to improve repair accuracy across more programming languages and larger repositories, expand our benchmark datasets, and strengthen security and resource limits. We also plan to improve the user interface, add repository level debugging insights, support continuous integration workflows, and provide clearer repair reports. In the future, we aim to make RepoMedic AI a practical assistant for individual developers, open source maintainers, and software engineering teams.
Built With
- ai-agents
- artificial-intelligence
- automated-bug-fixing
- automated-testing
- bug-detection
- code-analysis
- continuous-integration
- docker
- fastapi
- git
- large-language-models
- machine-learning
- ollama
- open
- pytest
- python
- qwen2.5-coder
- rest-api
- software-engineering
- web-development
Log in or sign up for Devpost to join the conversation.