CodeTeam: An LLM-Powered Multi-Agent Framework for Repository-Level Code Generation
CodeTeam is an LLM-powered multi-agent framework that addresses the challenges of natural-language-to-repository generation by separating planning, decision-making, and implementation into coordinated stages, achieving state-of-the-art performance in both design quality and functional correctness on benchmark tests.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Big Problem: Building a Whole City from a Sketch
Imagine you ask a very smart, but slightly scattered, architect (an AI) to build an entire city from a single sentence: "I need a place where people can buy shoes."
If you just ask the AI to "write the code," it might build a beautiful shoe store, but it forgets to build the roads, the power plant, or the sewage system. Or, it might build the shoe store with a door that leads to a brick wall because it didn't talk to the "road builder" AI.
This is the challenge of NL2Repo (Natural Language to Repository). It's not just about writing a single function (like a single room); it's about generating a whole software project (a whole city) with many files that must talk to each other perfectly. Current AI models often get lost in the details, forgetting the big picture or creating "cross-file" messes where File A expects something File B didn't build.
The Solution: CodeTeam (The Construction Crew)
The authors propose CodeTeam, a system that doesn't rely on one lone AI genius. Instead, it acts like a well-organized construction crew with specialized roles. They break the job down into three distinct phases: Planning, Decision Making, and Building.
Here is how the team works, step-by-step:
1. The Architects (The Dreamers)
Instead of one person drawing the blueprints, the system hires four different Architect agents.
- What they do: Each one sketches a different design for the software. One might say, "Let's use a modular design!" Another says, "No, let's keep it simple and flat!"
- The Secret Weapon: Sometimes, these architects are allowed to peek at a library of successful past projects (Retrieval-Augmented Generation) to see how other people solved similar problems. This helps them avoid reinventing the wheel.
- The Goal: Create a variety of "Software Design Sketches" (SDS). Think of these as detailed blueprints that list every room, every pipe, and who is responsible for building what.
2. The CTO (The Chief Decision Maker)
Once the four architects present their blueprints, a Chief Technical Officer (CTO) agent steps in.
- What they do: The CTO reviews all the sketches, picks the best one, and turns it into a Machine-Checkable Contract.
- The Contract: This isn't just a drawing; it's a strict legal document for the computer. It says: "File A must have this specific function. File B must depend on File A. Developer 1 is in charge of the kitchen; Developer 2 is in charge of the bedroom."
- Why it matters: This contract prevents the builders from wandering off and building a garage where the kitchen should be. It sets the rules before a single brick is laid.
3. The Developers (The Builders)
Now, the actual coding begins. The system hires a specific number of Developer agents based on the CTO's contract.
- Specialization: Unlike a generic AI that tries to do everything, these developers are assigned specific files. Developer 1 only builds the login page. Developer 2 only builds the database.
- The Git Coordination (The Foreman): As they build, they use a lightweight version of Git (a tool developers use to track changes). When Developer 1 changes the login page, they leave a "commit message" (a note) saying, "I changed the password button." Developer 2 reads this note and updates their own code to match.
- Dependency Awareness: The system knows that you can't paint the walls before you build the frame. It schedules the work so that files are built in the right order.
4. The QA Agent (The Inspector)
While the team builds, a Quality Assurance (QA) agent acts like a building inspector.
- What they do: They run tests to see if the building stands up. If a door doesn't open or a pipe leaks, the QA agent doesn't just say "Error." They figure out who broke it and send a repair ticket back to that specific developer.
- The Loop: The developer fixes the issue, the inspector checks again, and they repeat until the building is perfect.
What Did They Find? (The Results)
The researchers tested CodeTeam against other methods (like a single AI trying to do it all, or other multi-agent teams) using two main "exams":
The Blueprint Exam (SketchEval): They checked if the generated code looked structurally correct compared to real-world examples.
- Result: CodeTeam won. It built structures that looked much more like real software. The "Architects" and "CTO" steps helped them get the layout right, while the "QA" steps fixed the small cracks.
- Key Insight: The "Dynamic Developer Allocation" (hiring the right number of builders for the specific job) was the biggest factor in success. If you hire too few or too many, or assign the wrong people to the wrong rooms, the building fails.
The Live Test (NL2Repo-Bench): They actually tried to run the generated software to see if it worked.
- Result: CodeTeam had the highest success rate. It didn't just look good on paper; it actually functioned.
- Key Insight: By fixing structural errors early (like missing files or broken connections), the final product was much more likely to pass the "live" tests.
The Takeaway
The paper argues that building software from scratch isn't just a "writing" task; it's a management task.
- Old Way: Ask one AI to write a whole book. It often forgets plot points or writes characters that don't match.
- CodeTeam Way: Hire a team. Have one person plan the plot, one person edit the chapters, and one person check for typos.
By separating planning (Architects/CTO) from doing (Developers) and adding checking (QA), CodeTeam creates software that is not only smarter but also more reliable. It proves that for complex tasks, a coordinated team of AI agents is far better than a single, super-smart AI working alone.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.