A multi-agent software generation method based on breadth-depth two-level decision
Patent Information
- Application Number
- CN202611025091.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-09-18
AI Technical Summary
[0003]然而,现有的多智能体软件生成方法中,直接依赖大语言模型在单次推理中生成最终方案,并没有系统性地应对模型固有的非确定性输出特征,由此可能会导致生成内容在不同运行间存在显著差异,或者因缺乏多候选方案的横向对比与纵深评估机制,使得错误在智能体间传播放大,从而影响生成结果的准确性、一致性与可靠性,难以满足企业级软件工程对过程可追溯与质量可控的严格要求
本发明首次将“广度并行探索+深度多维度择优”的决策机制引入AI辅助软件生成场景,以系统架构的确定性弥补底层模型的不确定性,从系统层面而非模型参数层面解决一致性问题;多维评审机制突破单层验证局限,实现更高质量保障;降低人工干预频次,提高全流程自动化程度。
Smart Images

Figure CN122777095A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and software engineering technology, and in particular to a multi-agent software generation method based on two-level decision-making: breadth and depth. Background Technology
[0002] With the deep integration of artificial intelligence and software engineering technologies, multi-agent collaborative frameworks have become an important technical path for achieving full-process automation of software development. Related technologies utilize specialized agents for planning, coding, testing, and debugging, and leverage role division and collaborative dialogue mechanisms to construct an automated pipeline from requirements understanding to code generation.
[0003] However, existing multi-agent software generation methods rely directly on large language models to generate the final solution in a single inference, without systematically addressing the inherent non-deterministic output characteristics of the model. This may lead to significant differences in the generated content between different runs, or the lack of a mechanism for horizontal comparison and in-depth evaluation of multiple candidate solutions may cause errors to propagate and amplify among agents, thereby affecting the accuracy, consistency, and reliability of the generated results. This makes it difficult to meet the stringent requirements of enterprise-level software engineering for process traceability and quality control. Summary of the Invention
[0004] The main objective of this invention is to provide a multi-agent software generation method based on two-level decision-making: breadth and depth.
[0005] Another objective of this invention is to propose a multi-agent software generation device based on breadth-depth two-level decision-making.
[0006] The third objective of this invention is to provide an electronic device.
[0007] A fourth objective of this invention is to provide a non-transitory computer-readable storage medium.
[0008] To achieve the above objectives, a first aspect of the present invention proposes a multi-agent software generation method based on a two-level breadth-depth decision-making process, comprising: S1, In the stage where content generation is required, multiple independent content generation processes are triggered in parallel, and each generation adopts a differentiated strategy to generate multiple candidate solutions; S2. According to the preset multi-dimensional review framework, each candidate solution is evaluated in multiple independent review dimensions to obtain the score of each candidate solution in each review dimension. S3. Based on the scores of each evaluation dimension, the candidate solution with the best overall performance is selected from multiple candidate solutions as the winning solution, and a consistency alignment operation is performed on the winning solution to obtain the final output solution. S4: Attach confidence labels to the final output solution, record its scores in each review dimension, and trigger the corresponding quality control response based on the comparison results of the confidence labels and preset thresholds.
[0009] Optionally, during the content generation phase, multiple independent content generation processes can be triggered in parallel, with each generation employing a differentiated strategy to generate multiple candidate solutions, including: By issuing differentiated system-level instructions or thought processes to the same large language model, multiple code implementation schemes for the same function are generated from the perspectives of prioritizing functional integrity, performance, maintainability, and security, respectively, as candidate schemes. By leveraging the diversity of solutions naturally generated under structural differences from different underlying basic models or different versions of the same model, multiple candidate solutions are obtained by independently generating solutions for the same input task by calling multiple different large language models. By using the same data type but configuring different combinations of sampling parameters, including temperature, top_p, and top_k parameters, multiple feasible solutions are generated from different inference paths as candidate solutions.
[0010] Optionally, each candidate solution is evaluated across multiple independent review dimensions to obtain a score for each candidate solution across these dimensions, including: Each candidate solution is scored independently from the dimensions of functional completeness, logical consistency, prior pattern consistency, quality compliance, and maintainability, and the scores of each candidate solution in each evaluation dimension are obtained.
[0011] Optionally, based on the scores of each review dimension, the candidate solution with the best overall performance is selected from multiple candidate solutions as the winning solution, and a consistency alignment operation is performed on the winning solution to obtain the final output solution, including: The scores from multiple evaluation dimensions are weighted and fused according to a preset weight vector to calculate the comprehensive confidence score for each candidate solution. The candidate solution with the highest comprehensive confidence score is selected as the preliminary winning solution, where the comprehensive confidence score C(S) is the highest. i The formula for calculating ) is:
[0012] in, Candidate solutions The score on the j-th review dimension, For the first The weight of each review dimension; All candidate solutions are evaluated on a score-by-score basis across all evaluation dimensions. When the winning solution scores relatively low on a certain evaluation dimension and another candidate solution scores significantly better on that dimension, the corresponding part of the winning solution is partially revised to inherit the advantageous features of that candidate solution on that dimension.
[0013] Optionally, based on the comparison result between the confidence label and a preset threshold, a corresponding quality control response can be triggered, including: When the overall confidence score is lower than the preset automatic pass threshold, one or more responses will be automatically triggered; When the overall confidence score is lower than the preset automatic pass threshold, the rollback and re-exploration operation is automatically triggered, returning to the steps of triggering multiple independent content generation processes in parallel, adjusting the differentiation strategy, adding more candidate solutions, expanding the scope of exploration, and re-entering the evaluation and screening steps; When the overall confidence score is lower than the preset automatic pass threshold, a manual review reminder will be automatically triggered, and the final output solution and its confidence label will be pushed to the manual review interface for the developer to review and make a decision. When the overall confidence score is lower than the preset automatic pass threshold, the current input task is marked as unreliable and the user is informed that the current task is beyond the system's reliable processing range, and it is recommended that the task be completed manually.
[0014] To achieve the above objectives, a second aspect of the present invention provides a multi-agent software generation device based on breadth-depth two-level decision-making, comprising: The content generation unit is used to trigger multiple independent content generation processes in parallel at the stage where content generation is required. Each generation adopts a differentiated strategy and generates multiple candidate solutions. The evaluation unit is used to evaluate each candidate solution in multiple independent evaluation dimensions according to a preset multi-dimensional evaluation framework, and obtain the score of each candidate solution in each evaluation dimension. The calculation unit is used to select the best overall candidate solution from multiple candidate solutions based on the scores of each evaluation dimension, and to perform a consistency alignment operation on the winning solution to obtain the final output solution. The response unit is used to attach confidence labels to the final output solution, record its scores in each review dimension, and trigger the corresponding quality control response based on the comparison results of the confidence labels and preset thresholds.
[0015] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0016] To achieve the above objectives, a third aspect of this application provides an electronic device, including a processor and a memory; wherein the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, for implementing the multi-agent software generation method based on breadth-depth two-level decision-making as described in the first aspect embodiment.
[0017] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-agent software generation method based on breadth-depth two-level decision-making as described in the first aspect embodiment.
[0018] The embodiments of the present invention have the following beneficial effects: This invention introduces a decision-making mechanism of "broad parallel exploration + deep multi-dimensional optimization" into the AI-assisted software generation scenario for the first time. It uses the determinism of the system architecture to compensate for the uncertainty of the underlying model, and solves the consistency problem from the system level rather than the model parameter level. The multi-dimensional review mechanism breaks through the limitations of single-layer verification and achieves higher quality assurance. It reduces the frequency of manual intervention and improves the degree of automation of the whole process. Attached Figure Description
[0019] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart illustrating a multi-agent software generation method based on breadth-depth two-level decision-making provided in an embodiment of the present invention; Figure 2 This is a structural diagram of a multi-agent software generation device based on breadth-depth two-level decision-making, provided in an embodiment of the present invention. Detailed Implementation
[0020] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0022] The following describes, with reference to the accompanying drawings, a method and apparatus for generating multi-agent software based on two-level decision-making (breadth-depth).
[0023] Example 1 This invention provides a multi-agent software generation method based on breadth-depth two-level decision-making, such as... Figure 1 As shown, the method includes the following steps: S1, in the stage where content generation is required, triggers multiple independent content generation processes in parallel, with each generation employing a differentiated strategy to generate multiple candidate solutions.
[0024] To address the issues of traditional AI's single-generation scheme being limited, insufficient solution space exploration, and strong output randomness, this application employs three differentiated strategies to generate multiple candidate schemes in parallel and independently, significantly broadening the coverage of feasible solutions.
[0025] In this application embodiment, traditional AI-assisted software engineering content generation methods mostly adopt a single-point generation mode, relying solely on fixed instructions and fixed model parameters to output a single solution. This not only limits the exploration of the solution space but is also highly susceptible to the randomness of large model reasoning and the inertia of fixed prompts, resulting in homogenized output solutions, functional defects, and limited adaptability to specific scenarios. This application, based on a multi-path parallel independent generation logic at a broad layer, comprehensively expands the solution space of feasible solutions for the task, thereby avoiding the industry's technical defects caused by the single reasoning path of large models, such as rigid thinking, homogenized solutions, and uncontrollable output.
[0026] In this embodiment, the software engineering business process includes multiple business links that require AI-intelligent content generation, such as requirements analysis and compilation, system architecture design, business code writing, automated test script generation, project deployment and orchestration, and online fault operation and maintenance repair. At any content generation node that requires the output of the target solution, this application can start a broad generation mechanism to trigger multiple sets of AI content generation processes that do not interfere with each other and run completely independently.
[0027] In this embodiment, each independent content generation process is configured with a unique and differentiated generation strategy. Based on the differences in strategy dimensions, reasoning logic, and model foundation, diverse feasible solutions with varying output focuses, technical architectures, and implementation logic are generated. Finally, all generated results are aggregated and integrated to obtain a set of multiple independent and complementary candidate solutions. In this embodiment, three types of differentiated generation strategies are specifically designed to be enabled individually or combined arbitrarily, adapting to software engineering projects with different confidentiality levels, development timelines, and quality requirements.
[0028] In this application embodiment, the first type is a diversity-guided meta-prompt strategy. This strategy relies on prompt word engineering to achieve differentiated guidance, and issues customized differentiated system instructions and differentiated chain-like thinking reasoning paths to the same large language model. According to four development perspectives, namely, priority of functional integrity, priority of execution performance, priority of later maintainability, and priority of full-link security and compliance, it generates differentiated code, project documents, and system architecture candidate solutions corresponding to the same development task, so as to achieve full coverage of the human development perspective.
[0029] In the embodiments of this application, the second type is a multi-model differential sampling strategy. This strategy relies on the inherent differences in the underlying model to achieve the diversity of solutions. It calls multiple heterogeneous underlying large models with different network architectures, training datasets, and capability focuses, or high and low versions of the same basic model after iterative optimization. Independent inference generation is carried out for the same input development task. Based on the differences in the native generation capabilities and logical preferences of different models, candidate solutions with complementary advantages and disadvantages and adapted to different working conditions are produced.
[0030] In the embodiments of this application, the third type is a multi-point parameter sampling strategy. This strategy relies on the randomness of model inference parameter adjustment to achieve scheme differentiation. It uses a single specified large language model, and differentiates the three core sampling parameters: temperature inference temperature, top_p core sampling threshold, and top_k candidate sampling quantity. It accurately controls the divergence of model inference and splits multiple independent inference branches to stably generate multiple sets of differentiated feasible schemes.
[0031] In this embodiment, candidate solutions are generated independently and in parallel through three differentiated methods: meta-hint guidance, multi-model invocation, and sampling parameter adjustment. The completely isolated inference link fully covers the random bias of the model, laying the foundation for subsequent multi-dimensional review.
[0032] S2, according to the preset multi-dimensional review framework, evaluates each candidate solution in multiple independent review dimensions and obtains the score of each candidate solution in each review dimension.
[0033] To avoid the problems of subjective bias, low efficiency and inconsistent standards in manual review, this application establishes a five-dimensional automated review framework to comprehensively and quantitatively verify the merits of candidate solutions and generate a standardized scoring ledger for solution selection.
[0034] In this application embodiment, traditional software engineering solution reviews mostly rely on manual verification and scoring by R&D personnel. This not only results in low review efficiency but is also affected by the development experience and subjective preferences of personnel, leading to problems such as inconsistent review standards, large scoring deviations, missed detection of hidden defects, and inconsistent review standards across projects. It cannot adapt to the rapid review of a large number of candidate solutions. This application pre-builds a standardized multi-dimensional independent review framework adapted to all business scenarios of software engineering. Based on the collaborative linkage of professional review intelligence, code static analysis tools, standardized business testing environment, and shared knowledge base verification tools, the entire process of candidate solution review and scoring is completed automatically. From the mechanism level, it avoids the industry shortcomings of strong subjectivity, inconsistent review standards, and low efficiency of batch review in manual review.
[0035] In this application embodiment, the application defines five fixed review dimensions with clear boundaries, non-overlapping evaluation criteria, and independent assessment focus, to achieve a comprehensive quantitative assessment of the merits and demerits of the solution. The five review dimensions are functional integrity dimension, logical consistency dimension, prior mode consistency dimension, quality compliance dimension, and maintainability dimension.
[0036] In this embodiment, a comprehensive business verification is conducted at the functional integrity level. The focus is on verifying whether candidate solutions fully cover explicit requirements of development tasks, implicit business boundary adaptation conditions, and abnormal business handling logic for various unforeseen scenarios, preventing missing functionalities and boundary handling vulnerabilities. In this embodiment, a bidirectional logical verification is conducted at the logical consistency level. On one hand, it verifies the internal consistency and lack of contradictions within the business code and architectural logic of a single candidate solution. On the other hand, it verifies the semantic compatibility of the current candidate solution with upstream requirements documents, architectural drawings, and other pre-deliverables, preventing the distortion of development information and the transmission of incorrect business logic from the source of the software engineering chain.
[0037] In this application embodiment, the prior pattern consistency dimension is a unique and innovative review dimension that distinguishes this application from existing review technologies. The review process retrieves the historical high-quality project knowledge graph accumulated in the shared knowledge base in real time, benchmarks against the enterprise's unified coding specifications, standardized architecture design patterns, and best industry practices for project implementation, and verifies the degree to which candidate solutions fit the paradigm of existing high-quality projects, ensuring the overall development paradigm of the project is unified and facilitating team collaboration and iteration.
[0038] In this embodiment, the quality compliance dimension focuses on verifying the non-functional indicators of the solution, standardizing the verification of code time and space computational complexity, OWASP network security coding standards, unified coding format for the project, and multiple hard constraints on business function testability to determine the solution's compliance and implementation qualifications. In this embodiment, the maintainability dimension assesses the software's later-stage operation and maintenance iterations, quantitatively evaluating the rationality of modular decomposition, the standardization of program naming, the completeness of code comments, and the completeness of supporting development and maintenance documentation, adapting to the long-term iterative operation and maintenance needs of the software.
[0039] In this embodiment, by linking multiple review tools, all candidate solutions are automatically evaluated based on five independent review dimensions, generating a traceable dimension score ledger, which lays the foundation for subsequent weighted selection of the best solution.
[0040] S3: Based on the scores of each evaluation dimension, select the best overall candidate solution from multiple candidate solutions as the winning solution, and perform a consistency alignment operation on the winning solution to obtain the final output solution.
[0041] To address the issues that fixed weights cannot be adapted to different projects and that a single optimal solution may have local shortcomings, this application dynamically configures the review weights and calculates the comprehensive score to select the winning solution. Then, it aligns across solutions to fill in the deficiencies and obtains the final solution.
[0042] In this application embodiment, traditional selection methods mostly use fixed review weights, which cannot adapt to the differentiated quality control requirements of different types of software projects and different development stages. This application pre-sets a dimension weight vector that supports dynamic customization and adjustment. Staff can flexibly modify the weight values corresponding to each review dimension based on the current project type, development stage, and preset quality priorities. In this application embodiment, the weight ratio of the quality compliance dimension can be adjusted for security-sensitive projects, and the weights of the maintainability dimension and the consistency dimension of the prior model can be increased simultaneously for large projects that require long-term iterative maintenance. At the same time, this application has built-in multiple pre-made quick weight templates for security priority, performance priority, and operation and maintenance priority, which developers can select with one click, reducing the cost of weight configuration.
[0043] In this embodiment, the system calls a preset weighted calculation formula to calculate the comprehensive confidence score for each candidate solution. The comprehensive confidence score calculation formula is as follows:
[0044] in, Candidate solutions The score on the j-th review dimension, For the first The system calculates the weights of each evaluation dimension, iterates through the calculation results of all candidate solutions, selects the candidate solution with the highest comprehensive confidence score, and marks it as the preliminary winning solution.
[0045] In this embodiment, the application innovatively adds a differentiated consistency alignment optimization step. Instead of directly using the preliminary winning solution as the output, it performs a horizontal comparison of the preliminary winning solution with all other candidate solutions across all dimensions to identify the review dimensions where the preliminary winning solution scores low. When other candidate solutions are found to score significantly better than the preliminary winning solution in the low-scoring dimension, the system will make targeted local revisions to the corresponding functional modules within the preliminary winning solution, absorbing and reusing the advantageous design logic of other candidate solutions in that dimension to make up for the shortcomings of the preliminary winning solution.
[0046] In this embodiment, the alignment optimization process distinguishes between two execution modes adapted to different scenarios. For structured code modules with clear structure and well-defined modular boundaries, the system can directly extract the corresponding fragments of high-quality candidate solutions to complete local replacement and achieve fully automatic alignment. For functional modules with high business logic coupling and complex structure, the system uses the preliminary winning solution as the main base and high-scoring candidate solutions as optimization reference materials to initiate a local lightweight regeneration operation to complete the repair alignment. After the entire alignment process is completed, a final output solution that fits the project development needs and has the best overall performance is generated, achieving the technical effect of selecting the best option, taking the best and making up for the shortcomings, and comprehensively improving the overall quality of the solution.
[0047] In this embodiment, a preliminary winning scheme is selected by calculating the comprehensive confidence score using a customizable weight vector, comparing the scores of each dimension and making local revisions and integrating the advantages of other candidate schemes according to different modes, to generate the final output scheme with the best overall quality.
[0048] S4: Attach confidence labels to the final output solution, record its scores in each review dimension, and trigger the corresponding quality control response based on the comparison results of the confidence labels and preset thresholds.
[0049] To achieve traceability of generated results, precise hierarchical control, and to establish a human-machine collaborative intervention channel, this application adds a complete confidence label, triggers multiple types of quality responses through threshold comparison, and provides visualized decision-making traceability capabilities.
[0050] In this embodiment, the system automatically binds a unique and traceable confidence label to the final output solution. In this embodiment, the confidence label carries full-link traceability data, fully retaining the individual scores of the five review dimensions of the solution, the weighted comprehensive confidence score, the differentiated generation strategy number, the review weight parameters, and the full traceability information of the solution alignment revision log. All label data is transmitted to the shared knowledge base in conjunction with the solution itself, and classified and persistently archived. This facilitates project compliance auditing and full-process decision-making retrospective verification, and also enables the accumulation of high-quality project characteristics based on the existing label data, and iterative optimization of subsequent review standards and generation strategies.
[0051] In this embodiment, the application includes an automatic pass confidence threshold that can be customized and modified by administrators to adapt to project level adjustments. Administrators can flexibly raise or lower the threshold standard according to the project's security level, delivery timeliness, and quality requirements. The system retrieves the comprehensive confidence score of the final output solution in real time, completes the automatic comparison between the score and the preset threshold, and triggers a differentiated closed-loop quality control response mechanism based on the comparison results.
[0052] In this embodiment, when the overall confidence score of the final output solution is greater than or equal to the preset automatic pass confidence threshold, the system directly determines that the current solution is compliant and meets the project requirements, and the reliability of the generated solution meets the project requirements. No manual intervention is required for review, and the solution is automatically transferred to the next business link in the software engineering process, thereby improving the efficiency of software development workflow.
[0053] In this embodiment, when the overall confidence score of the final output solution is lower than the preset automatic pass confidence threshold, the system determines that the solution has defects and insufficient generation reliability, and triggers one or more types of adaptability control responses simultaneously. The three types of control responses can be activated independently or in combination. In this embodiment, the first type is a process rollback and re-exploration response. The system directly jumps back to the S1 candidate solution parallel generation stage, specifically optimizes and adjusts the original differentiated generation strategy, adds more generation paths to add a sufficient number of candidate solutions, further expands the scope of the task solution space exploration, and re-executes the multi-dimensional review and best alignment process in sequence to iteratively optimize the solution quality.
[0054] In this embodiment of the application, the second type is a targeted manual review reminder response. The system will carry the final output solution with complete confidence labels and traceability logs, and push it to the platform's dedicated manual review interface. It will mark the low-scoring dimensions and risk defect points of the solution to assist developers in quickly reviewing and judging, and determining the solution modification opinions or usability conclusions.
[0055] In this application embodiment, the third type is the task level downgrade marking response. For development tasks with extremely low comprehensive confidence scores, huge deviations in the core logic of the solution, and excessive difficulty in iterative optimization, the system directly marks the current task as unreliable by AI automatic generation, and pops up a prompt to the operator that the current task exceeds the system's intelligent processing boundary, suggesting that the entire development process be completed manually.
[0056] In this embodiment, the system relies on an overall architecture and dedicated visual human-machine collaborative management capabilities. The system automatically generates a standardized decision traceability visualization report for each decision and is equipped with five types of visualization views to fully disclose the decision-making process: candidate solution comparison view, multi-dimensional review radar chart, weighted selection process perspective view, consistency alignment difference view, and confidence dashboard. These views intuitively and visually display the details of the entire process of solution generation, scoring, selection, revision, and judgment, eliminating the black box problem of AI decision-making.
[0057] In this embodiment, the platform's human-computer interaction interface grants multiple manual intervention permissions, allowing developers to bypass the system's selection logic to manually select candidate solutions, fine-tune the review weights of each dimension in real time, independently modify the confidence threshold of hierarchical control, make targeted local modifications to the final solution's functional modules, and intervene in the AI decision-making process throughout the entire process. This achieves a two-way combination of AI's autonomous intelligent decision-making and controllable human intervention, balancing development efficiency and solution controllability.
[0058] In this embodiment, the entire interconnected workflow constructs a standardized two-level decision-making closed-loop system that features broad parallel exploration, multi-dimensional in-depth review, optimal complementarity and supplementation, and hierarchical closed-loop management. It is highly versatile and can be embedded and adapted to all software engineering business processes, including requirements analysis, architecture design, business coding, test script writing, project deployment orchestration, and online fault operation and maintenance repair.
[0059] In this embodiment, the entire process relies on a shared knowledge base to continuously accumulate project development paradigms, review experience, and characteristics of high-quality solutions. It iteratively optimizes model generation strategies, review dimension weights, and hierarchical control thresholds to effectively improve the output quality of AI-assisted software development solutions in the long term. This addresses the industry pain points of traditional AI-assisted software development models, such as high randomness in reasoning, uncontrollable quality of generated solutions, heavy workload of full-domain manual review, misaligned information transmission between upstream and downstream software engineering, and poor ability of generated solutions to adapt to project scenarios. This helps reduce costs, improve quality, and increase efficiency throughout the entire software engineering process.
[0060] Example 2 This invention relates to a multi-agent software generation system based on a two-level decision-making process of breadth and depth, which is achieved through the collaborative implementation of the following functional modules: The multi-agent execution layer comprises a series of specialized agents covering key stages of software engineering, such as requirements analysis agents, architecture design agents, code generation agents, test generation agents, code review agents, deployment and orchestration agents, and operation and maintenance agents. Agents communicate collaboratively via a unified message bus and achieve persistent storage and cross-stage transfer of context information through a shared knowledge base. It should be noted that the aforementioned agents are functional units that execute specific tasks. The core inventive point of this invention—a breadth-depth two-level decision-making mechanism—serves as a general decision-making layer independent of specific agent types and can be embedded in the generation process of each agent to ensure the consistency and accuracy of its output. The specific number of agents, their roles, and the number of stages covered do not constitute a limitation on the scope of protection of this invention.
[0061] The breadth-depth decision engine is the core module of this invention. It is responsible for executing the parallel generation of multiple candidate solutions at the breadth layer and the multi-dimensional comprehensive review and selection at the depth layer during the AI content generation stage. This engine can cooperate with any one or more agents in the aforementioned multi-agent execution layer to provide decision support.
[0062] A shared knowledge base stores inputs, intermediate candidate solutions, review results, final outputs, and their confidence labels for each stage, supporting consistency traceability and knowledge reuse across stages. The shared knowledge base may include historical project knowledge graphs, providing a benchmark reference for deep-level prior pattern consistency reviews.
[0063] Example 3 This invention provides a multi-agent software generation device 10 based on breadth-depth two-level decision-making, such as... Figure 2 As shown, the device includes: The content generation unit 100 is used to trigger multiple independent content generation processes in parallel during the content generation stage, with each generation employing a differentiated strategy to generate multiple candidate solutions. Evaluation unit 200 is used to evaluate each candidate solution in multiple independent evaluation dimensions according to a preset multi-dimensional evaluation framework, and obtain the score of each candidate solution in each evaluation dimension. The calculation unit 300 is used to select the best candidate solution from multiple candidate solutions based on the scores of each evaluation dimension, and to perform a consistency alignment operation on the winning solution to obtain the final output solution. The response unit 400 is used to attach confidence labels to the final output solution, record its scores in each review dimension, and trigger the corresponding quality control response based on the comparison results of the confidence labels and preset thresholds.
[0064] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0065] Example 4 To implement the methods of the above embodiments, the present invention also provides an electronic device, which includes a memory and a processor; wherein the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the various steps of the methods described above.
[0066] Example 5 To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in the foregoing embodiments.
[0067] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0068] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0069] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
Claims
1. A multi-agent software generation method based on breadth-depth two-level decision-making, characterized in that, include: S1, In the stage where content generation is required, multiple independent content generation processes are triggered in parallel, and each generation adopts a differentiated strategy to generate multiple candidate solutions; S2. According to the preset multi-dimensional review framework, each candidate solution is evaluated in multiple independent review dimensions to obtain the score of each candidate solution in each review dimension. S3. Based on the scores of each evaluation dimension, the candidate solution with the best overall performance is selected from multiple candidate solutions as the winning solution, and a consistency alignment operation is performed on the winning solution to obtain the final output solution. S4: Attach confidence labels to the final output solution, record its scores in each review dimension, and trigger the corresponding quality control response based on the comparison results of the confidence labels and preset thresholds.
2. The method according to claim 1, characterized in that, In the content generation stage, multiple independent content generation processes are triggered in parallel. Each generation employs a differentiated strategy to generate multiple candidate solutions, including: By issuing differentiated system-level instructions or thought processes to the same large language model, multiple code implementation schemes for the same function are generated from the perspectives of prioritizing functional integrity, performance, maintainability, and security, respectively, as candidate schemes. By leveraging the diversity of solutions naturally generated under structural differences from different underlying basic models or different versions of the same model, multiple candidate solutions are obtained by independently generating solutions for the same input task by calling multiple different large language models. By using the same data type but configuring different combinations of sampling parameters, including temperature, top_p, and top_k parameters, multiple feasible solutions are generated from different inference paths as candidate solutions.
3. The method according to claim 1, characterized in that, The evaluation of each candidate solution across multiple independent review dimensions yields a score for each candidate solution across these dimensions, including: Each candidate solution is scored independently from the dimensions of functional completeness, logical consistency, prior pattern consistency, quality compliance, and maintainability, and the scores of each candidate solution in each evaluation dimension are obtained.
4. The method according to claim 1, characterized in that, The process involves selecting the optimal candidate solution from multiple candidates based on the scores of each evaluation dimension, and then performing a consistency alignment operation on the winning solution to obtain the final output solution, including: The scores from multiple evaluation dimensions are weighted and fused according to a preset weight vector to calculate the comprehensive confidence score for each candidate solution. The candidate solution with the highest comprehensive confidence score is selected as the preliminary winning solution, where the comprehensive confidence score C(S) is the highest. i The formula for calculating ) is: in, Candidate solutions The score on the j-th review dimension, For the first The weight of each review dimension; All candidate solutions are evaluated on a score-by-score basis across all evaluation dimensions. When the winning solution scores relatively low on a certain evaluation dimension and another candidate solution scores significantly better on that dimension, the corresponding part of the winning solution is partially revised to inherit the advantageous features of that candidate solution on that dimension.
5. The method according to claim 1, characterized in that, The step of triggering a corresponding quality control response based on the comparison result between the confidence label and a preset threshold includes: When the overall confidence score is lower than the preset automatic pass threshold, one or more responses will be automatically triggered; When the overall confidence score is lower than the preset automatic pass threshold, the rollback and re-exploration operation is automatically triggered, returning to the steps of triggering multiple independent content generation processes in parallel, adjusting the differentiation strategy, adding more candidate solutions, expanding the scope of exploration, and re-entering the evaluation and screening steps; When the overall confidence score is lower than the preset automatic pass threshold, a manual review reminder will be automatically triggered, and the final output solution and its confidence label will be pushed to the manual review interface for the developer to review and make a decision. When the overall confidence score is lower than the preset automatic pass threshold, the current input task is marked as unreliable and the user is informed that the current task is beyond the system's reliable processing range, and it is recommended that the task be completed manually.
6. A multi-agent software generation device based on breadth-depth two-level decision-making, characterized in that, include: The content generation unit is used to trigger multiple independent content generation processes in parallel at the stage where content generation is required. Each generation adopts a differentiated strategy and generates multiple candidate solutions. The evaluation unit is used to evaluate each candidate solution in multiple independent evaluation dimensions according to a preset multi-dimensional evaluation framework, and obtain the score of each candidate solution in each evaluation dimension. The calculation unit is used to select the best overall candidate solution from multiple candidate solutions based on the scores of each evaluation dimension, and to perform a consistency alignment operation on the winning solution to obtain the final output solution. The response unit is used to attach confidence labels to the final output solution, record its scores in each review dimension, and trigger the corresponding quality control response based on the comparison results of the confidence labels and preset thresholds.
7. An electronic device, characterized in that, Including processor and memory; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the method as described in any one of claims 1-5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.