
MANTRA: AI-Powered Code Refactoring
Automating method-level refactoring through multi-agent LLM collaboration
MANTRA introduces a novel framework that leverages contextual retrieval-augmented generation (RAG) and multi-agent LLM collaboration to automate code refactoring while ensuring compilability and successful test execution.
- Combines specialized LLM agents with distinct roles to tackle complex refactoring tasks
- Uses contextual RAG to provide relevant codebase information to the LLM agents
- Ensures refactored code maintains functionality by verifying compilability and test execution
- Reduces developer workload by automating labor-intensive refactoring processes
This research significantly advances software engineering productivity by transforming manual refactoring into an automated process, allowing developers to focus on higher-value tasks while maintaining code quality and reliability.