NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Knowledge-Guided Multi-Agent Framework for Application-Level Software Code Generation

Qian Xiong, Bo Yang, Weisong Sun, Yiran Zhang, Tianlin Li, Yang Liu, Zhi JinarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) have demonstrated remarkable proficiency in generating isolated code snippets and solving algorithmic puzzles. However, transitioning from these "micro-tasks" to full-scale, multi-file software application development remains a significant challenge. Current LLM-based code generation often suffers from three systematic deficits: context isolation, where the model lacks a holistic view of the repository; a lack of grounding, leading to unverified "hallucinated" code; and an absence of iterative self-correction loops.

To address these issues, researchers have introduced KGACG (Knowledge-Guided Application-Level Code Generation), a multi-agent framework designed to orchestrate complex software projects through structured planning, coding, and testing phases guided by industry standards.

The KGACG Framework Architecture

The core of KGACG lies in its division of labor among three specialized agents, each supported by a dedicated knowledge base. This structure ensures that the generated software is not only functional but also architecturally sound and maintainable.

Overview of the KGACG multi-agent framework architecture, illustrating the coordination between COPA, CA, and TA agents.
  1. COPA (Code Organization & Planning Agent): Acting as the project architect, COPA translates Software Requirements Specifications (SRS) and Architectural Design Documents (ADD) into a comprehensive project structure and implementation plan. It leverages knowledge of IEEE and ISO standards to ensure professional documentation.
  2. CA (Coding Agent): The developer agent follows COPA's plan to generate the actual source code. It draws from a knowledge base of open-source projects and API libraries. Crucially, it includes a "self-debugging" loop to resolve syntax errors during the generation phase.
  3. TA (Testing Agent): Serving as the QA engineer, TA generates unit tests and test plans based on the initial requirements. It provides structured feedback to the other agents if tests fail, triggering necessary revisions.

Knowledge-Guided Iteration

Unlike standard "one-shot" generation pipelines, KGACG utilizes a closed-loop feedback system. If the Testing Agent identifies a semantic error, it doesn't just report a failure; it generates a detailed report that can prompt the Coding Agent to refactor code or even lead the Planning Agent to update the architectural blueprint. This hierarchical feedback mimics the collaborative environment of a human development team.

Furthermore, the "Knowledge-Guided" aspect ensures that agents consult external documentation and design patterns rather than relying solely on the LLM's internal weights. This prevents the "spaghetti code" often associated with AI-generated projects by enforcing standards like IEEE 830 for requirements and ISO 29148 for project structure.

Case Study: Java Tank Battle

The framework's efficacy was evaluated through a comprehensive case study: developing a Java-based Tank Battle game. This project required multi-component coordination, such as separating game logic from the user interface and managing complex object interactions.

Detailed artifacts generated by the COPA, CA, and TA agents during the Tank Battle game development process.

During the development process, the framework successfully:

  • Established a Multi-Tier Architecture: Correctly organized the project into distinct .logic, .model, and .view packages.
  • Automated Logic Correction: When the Testing Agent detected a flaw in diagonal collision detection, the system automatically generated a report, leading the Coding Agent to refactor the coordinate calculation logic without human intervention.
  • Resolved Runtime Issues: The self-check phase identified and corrected NullPointerExceptions caused by uninitialized instances before the final code was delivered.

Conclusion and Future Directions

KGACG represents a significant step toward autonomous, application-level software engineering. By integrating domain knowledge and structured multi-agent coordination, it overcomes the limitations of isolated code generation. Future research will focus on refining the translation of high-level human requirements into actionable plans and optimizing communication protocols to reduce computational overhead in increasingly complex software tasks.

Summary updated

BibTeX
@misc{xiong2025knowledge,
  author = {Qian Xiong and Bo Yang and Weisong Sun and Yiran Zhang and Tianlin Li and Yang Liu and Zhi Jin},
  title = {{Knowledge-Guided Multi-Agent Framework for Application-Level Software Code Generation}},
  year = {2025},
  eprint = {2510.19868},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.19868},
}
Figure