TL;DR
AgileCoder is a multi-agent software development framework that moves beyond the rigid "Waterfall" models of previous AI systems by adopting an iterative Agile Methodology. By organizing specialized LLM agents into roles like Scrum Masters and Testers and utilizing a dynamic dependency graph to manage code context, it achieves state-of-the-art performance on complex, multi-file software projects.
What Problem Does This Paper Address?
While Large Language Models (LLMs) are excellent at writing snippets of code, building entire software systems is a different beast. Existing multi-agent frameworks like ChatDev and MetaGPT typically follow a linear "Waterfall" process: design, then code, then test, then finish. In the real world, software development is rarely linear; it is iterative, requiring constant refinement and adaptation.
Furthermore, LLMs struggle with "repository-level" understanding. As a codebase grows, the amount of context (files, classes, imports) exceeds the LLM's "context window" (its short-term memory). This leads to "hallucinations," where the AI forgets existing dependencies or generates code that breaks imports in other files. AgileCoder aims to bridge this gap by bringing the flexibility of Agile sprints and the precision of graph-based context retrieval to AI agents.
Methods
The authors introduce two primary innovations:
- Agile-Inspired Workflow: Instead of a single pass, work is organized into Sprints. Each sprint consists of four phases:
- Planning: The Product Manager (PM) and Scrum Master (SM) select tasks from a backlog.
- Development: A Developer (Dev) writes code, which is then scrutinized by a Senior Developer (SD) using a specialized three-step static review process (checking basics, backlog compliance, and bug identification).
- Testing: A Tester generates test suites and executes them in a sandbox, providing feedback for iterative fixes.
- Review: The PM assesses if requirements are met; if not, the remaining tasks move to the next sprint.
- Dynamic Code Graph Generator (DCGG): To solve the context window problem, AgileCoder maintains a Code Dependency Graph (CDG). This graph maps out how every file in the repository relates to others (e.g., which files import which classes). When an agent needs to modify a specific file, the DCGG retrieves only the relevant "ancestor" nodes from the graph. This ensures the agent has the exact context needed to maintain system integrity without being overwhelmed by irrelevant data.
Datasets
The researchers evaluated AgileCoder on three benchmarks:
- HumanEval & MBPP: Standard industry benchmarks consisting of hundreds of isolated Python programming tasks.
- ProjectDev (New): A benchmark introduced by the authors containing 14 complex, multi-file software requirements. These include mini-games (Snake, 2048, Flappy Bird), data processors (Excel to Streamlit), and CRUD management systems. Unlike standard benchmarks, these require the system to manage complex logic across multiple interconnected files.
Key Insights and Ideas
- Iterative Inheritance: One of the "aha moments" is that AgileCoder allows for the "inheritance" of outputs across sprints. If a feature is buggy or incomplete in Sprint 1, the system doesn't just fail; it carries that context into Sprint 2 for refinement, mimicking how human teams actually work.
- Graph-Based Precision: The use of the DCGG proves that "more context" isn't always better. By selectively providing agents with dependency information, the system avoids the "lost in the middle" phenomenon common in long-context LLMs, leading to much higher executability rates.
- The Power of the "Senior" Role: The paper demonstrates that breaking down code review into three distinct, sequential prompts (basics -> compliance -> bugs) significantly reduces the likelihood of the LLM overlooking subtle errors compared to a single-pass review.
Key Results
AgileCoder significantly outperformed its predecessors, particularly on complex tasks:
- SOTA Performance: On HumanEval and MBPP, AgileCoder (using GPT-3.5 Turbo) achieved 70.53% and 80.92% pass@1 scores, respectively—outperforming MetaGPT by roughly 6-7%.
- ProjectDev Superiority: On the complex ProjectDev benchmark, AgileCoder achieved an executability rate of 57.79%. For comparison, ChatDev hit 32.79%, and MetaGPT struggled significantly at 7.73%.
- Zero Errors: Remarkably, on the ProjectDev tasks, AgileCoder produced zero runtime errors in its final deliverables, whereas MetaGPT averaged 32 errors per project.
- Efficiency: The system completed complex projects in an average of just 1.64 sprints, showing it is both effective and relatively fast.
Limitations and Future Work
The authors acknowledge several areas for growth:
- Scalability: While the dependency graph helps, maintaining and updating a CDG for massive, enterprise-scale repositories (thousands of files) could become computationally expensive.
- Human Factors: Real-world Agile involves complex human dynamics and non-technical communication that are not yet fully captured by the agent interactions.
- Expanded Practices: Future versions could integrate more advanced Agile practices like Pair Programming or automated CI/CD (Continuous Integration/Continuous Deployment) pipelines to further enhance reliability.
- LLM Dependency: The system's "intelligence" is still capped by the reasoning capabilities of the underlying model (e.g., GPT-4 vs. GPT-3.5).
Summary updated