Abstract
Generating an entire software repository from a single prompt is significantly more complex than writing isolated functions. This paper introduces ProjectGen, a multi-agent framework that bridges the gap between high-level requirements and executable code using a novel Semantic Software Architecture Tree (SSAT). Alongside a more realistic benchmark, CodeProjectEval, the authors demonstrate that iterative, architecturally-aware generation can outperform existing state-of-the-art methods by up to tenfold.
Introduction: The Semantic Gap in Code Generation
While Large Language Models (LLMs) excel at generating isolated code snippets, project-level code generation—creating a complete, multi-file repository from complex requirements—remains a major challenge. The transition from a human-written requirement document to a machine-interpretable file structure involves managing hierarchical dependencies across dozens of files. An error in an early architectural decision often cascades, leading to total project failure.
The ProjectGen Framework
ProjectGen decomposes the generation process into three sequential phases, each managed by specialized agents:
- Architecture Design: An
ArchAgenttransforms requirements into a Semantic Software Architecture Tree (SSAT). The SSAT is a structured representation that maps out modules, files, classes, and functions, including their responsibilities and parameters. - Skeleton Generation: A
SkeletonAgentuses the SSAT to create the "bones" of the project—file hierarchies and function signatures—ensuring the project is syntactically valid and imports are correctly mapped. - Code Filling: A
CodeAgentiteratively fills in the logic for each function, using topological sorting to ensure files are generated in an order that respects their dependencies.
Crucially, each stage includes a Judge Agent that provides feedback and scores. If a stage fails to meet a quality threshold, the system uses a memory-based context management system to reflect on the feedback and refine its output.
Benchmarking with CodeProjectEval
Existing benchmarks often lack the complexity of real-world software. To address this, the researchers developed CodeProjectEval, derived from 18 real-world Python repositories.
CodeProjectEval averages 12.7 files and ~2,388 lines of code per task, making it significantly more complex than previous benchmarks. It includes full documentation (PRDs, UML diagrams) and an average of 186 unit tests per task to ensure functional correctness.
Key Results and Insights
ProjectGen achieved state-of-the-art performance across the board. On the DevBench benchmark, it achieved a 57% improvement over baselines like MetaGPT. On the more challenging CodeProjectEval, it demonstrated a tenfold improvement over baseline approaches, which struggled to generate even basic runnable structures for larger projects. Notably, the framework's effectiveness persists across different base models; even when using DeepSeek-V3, ProjectGen significantly outperformed other frameworks, proving that the multi-agent process and SSAT structure are as critical as the underlying model's capabilities.
The success of ProjectGen highlights that moving directly from text to code is too "lossy." The SSAT acts as a bidirectional bridge, helping the LLM maintain a "global view" of the project's architecture while working on local implementation details. Furthermore, iterative refinement via "Judges" at every step is mandatory to catch architectural errors before they are baked into thousands of lines of code.
Limitations and Future Work
Despite this progress, generating projects exceeding 1,000 lines of code remains difficult. The most common failure point is ImportErrors, where the model loses track of definitions across large directory trees. Future work will focus on human-in-the-loop interactions, extending the framework to other languages like Java or C++, and enabling the model to update existing project architectures.
Summary updated