Multi-agent cooperation-based software engineering task dynamic arrangement method and system
Patent Information
- Application Number
- CN202611139703.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]但上述方式比较依赖预设的任务分解逻辑,缺乏对分支决策、工具调用、人工干预点、失败恢复路径等历史执行过程细节的记录与利用,当任务因模型选择错误、权限等待过长或上下文缺失而阻塞时,往往只能被动地由人工介入或重新执行整个流程,无法自动从失败中学习并优化后续调度策略
1、本发明通过构建研发过程演化图谱,动态记录每个任务执行过程中的分支决策、工具调用序列、人工干预点、失败恢复路径以及跨智能体依赖的实际耗时,将原本不可见的过程信息转化为结构化的图数据,为后续的任务预测和策略优化提供了丰富的历史经验基础,实现从历史执行中提取可泛化的任务模式。
Smart Images

Figure CN122963516A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of software engineering and artificial intelligence technology, specifically relating to a method and system for dynamic orchestration of software engineering tasks based on multi-agent collaboration. Background Technology
[0002] In the complex software development process, multi-agent collaboration technology is widely used in task decomposition, role allocation and process orchestration. In the current traditional approach, a role-based agent collaboration framework is usually adopted, which drives workflow execution based on a predefined task dependency graph or fixed template.
[0003] However, the above methods rely heavily on preset task decomposition logic and lack the recording and utilization of historical execution process details such as branch decisions, tool calls, manual intervention points, and failure recovery paths. When a task is blocked due to incorrect model selection, excessively long permission wait times, or missing context, it can only be passively intervened manually or the entire process is re-executed. It cannot automatically learn from failures and optimize subsequent scheduling strategies.
[0004] To address the above problems, this invention proposes a dynamic orchestration system and method for software engineering tasks based on multi-agent collaboration. Summary of the Invention
[0005] To address the aforementioned problems in the existing technology, the present invention aims to provide a method and system for dynamic orchestration of software engineering tasks based on multi-agent collaboration.
[0006] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows: A dynamic orchestration method for software engineering tasks based on multi-agent collaboration includes: S1. Dynamically record the branch decisions, tool call sequences, manual intervention points, failure recovery paths, and actual time consumption across agent dependencies during the execution of each task, and construct an evolution map of the R&D process; S2. When a new task is received, the graph neural network is used to embed and encode the historical graph in the evolution graph of the R&D process, generate the embedding vector of the current task, and predict the optimal decomposition method and role allocation strategy of the current task based on the embedding vector. S3. During the execution of the current task, the task execution status is monitored through a multi-level blocking detection mechanism, which includes rule detection based on a blocking pattern library and intelligent prediction based on historical graph similarity. When task blocking is detected, counterfactual reasoning is performed based on a pre-built structural causal model. In the structural causal model, intervention operations are performed on the decision nodes corresponding to the blockage points. Counterfactual results under each candidate alternative decision are calculated through forward propagation, generating multiple counterfactual paths. Among them, the structural causal model describes the causal structural equations between each decision node, intermediate variable and final result in the task execution; S4. Calculate the counterfactual confidence level of each counterfactual path, and use the counterfactual paths with confidence levels exceeding a preset threshold to generate policy patches; The counterfactual confidence score is obtained by weighted fusion of multiple factors, including historical success rate, deviation of simulated execution results from historical distribution, causal path stability, and task semantic similarity. S5. Inject the policy patch into the orchestrator's decision rule base to update the scheduling policy for subsequent tasks.
[0007] Preferably, the evolution graph of the R&D process is stored in a directed graph structure. Nodes in the graph represent key events in the task execution process. Key events include task start, branch decision point, tool call, manual intervention, failure, and recovery success. Edges in the graph represent the temporal dependencies and causal relationships between events. Each node is associated with attribute information, including event type, timestamp, participating agent identifier, resource consumption, and whether it was successful.
[0008] Preferably, the graph neural network uses a graph attention network or a graph convolutional network to generate a high-dimensional embedding vector that reflects the task execution pattern by aggregating node features and edge features in the historical graph. The optimal task decomposition method and role allocation strategy based on embedding vectors include: outputting the hierarchical structure of task decomposition, the dependencies between subtasks, and the types of agents to be assigned based on the embedding vectors through a multilayer perceptron.
[0009] Preferably, the method for constructing a structural causal model includes: extracting decision nodes as causal variables from the evolution graph of the R&D process, extracting tool response time and resource utilization rate as intermediate variables, and extracting task blocking or success as outcome variables; learning the causal relationship between variables through a causal discovery algorithm, and estimating the parameters of the causal structural equation through regression or neural networks.
[0010] Preferably, the intervention operation uses the do-operator to force the value of the decision node corresponding to the blockage point to be the candidate alternative decision value, cut off the input edge of the node affected by other causal variables, and calculate the counterfactual values of intermediate variables and outcome variables by forward propagation along the causal graph.
[0011] Preferably, in the calculation of counterfactual confidence, each factor is weighted and fused using a preset weight coefficient, which can be dynamically adjusted according to different application scenarios; the semantic similarity is calculated by the vector distance of the task graph embedding vector.
[0012] Preferably, the strategy patch is a structured rule that includes triggering conditions, alternative decisions, priority, and scope of application; the orchestrator's decision rule base supports dynamic hot loading of strategy patches and prioritizes matching patch rules when similar tasks arrive in the future.
[0013] Preferably, the method further includes: after completing a task, appending the process data of this execution to the R&D process evolution graph, and using the new data to update the causal structure equation parameters of the structural causal model through incremental learning; when the confidence of all counterfactual paths is lower than the preset threshold, not generating a policy patch and recording this blocking event in the low confidence event log.
[0014] This invention also discloses a dynamic orchestration system for software engineering tasks based on multi-agent collaboration, comprising: The process recording module is used to dynamically collect branch decisions, tool call sequences, manual intervention points, failure recovery paths, and actual time consumption across agent dependencies during the execution of each task, and to construct an evolution map of the R&D process; The graph embedding and prediction module is used to embed and encode the historical graph in the R&D process evolution graph using a graph neural network when a new task is received, generate the embedding vector of the current task, and predict the optimal decomposition method and role allocation strategy of the current task based on the embedding vector. The blocking detection and counterfactual reasoning module is used to detect blocking events during task execution through a multi-level blocking detection mechanism, and to initiate counterfactual reasoning when blocking is detected; the counterfactual reasoning module has a pre-built structured causal model, and generates multiple counterfactual paths by performing intervention operations on the structured causal model; The confidence assessment module is used to calculate the counterfactual confidence of each counterfactual path and filter out counterfactual paths whose confidence exceeds a preset threshold. The strategy patch injection module is used to transform the filtered counterfactual paths into executable strategy patches and inject the strategy patches into the orchestrator's decision rule base.
[0015] Preferably, it also includes a graph and model incremental update module, which is used to append the process data of this execution to the R&D process evolution graph after the task is completed, and use the new data to update the causal structure equation parameters of the structural causal model through incremental learning; the confidence evaluation module does not output any strategy patch and records the corresponding event in the low confidence event log when the confidence of all counterfactual paths is lower than the preset threshold.
[0016] Beneficial effects 1. This invention constructs an evolutionary graph of the R&D process, dynamically recording the branch decisions, tool call sequences, manual intervention points, failure recovery paths, and actual time consumption of cross-agent dependencies during the execution of each task. It transforms the originally invisible process information into structured graph data, providing a rich historical experience base for subsequent task prediction and strategy optimization, and enabling the extraction of generalizable task patterns from historical execution.
[0017] 2. This invention describes the causal structural equations between decision nodes, intermediate variables and final results in task execution by pre-constructing a structural causal model. When task blockage is detected, intervention operations are performed to generate counterfactual paths, which elevates counterfactual reasoning from simple enumeration simulation to the level of causal inference. This allows the structural causal model to learn the dependencies between variables through causal discovery algorithms, making the counterfactual reasoning results more accurate and more consistent with actual logic.
[0018] 3. This invention calculates the confidence of each counterfactual path by weighting and fusing multiple factors such as historical success rate, deviation of simulated execution results from historical distribution, causal path stability, and task semantic similarity. Only paths with confidence exceeding a preset threshold are used to generate policy patches, effectively avoiding low-quality or erroneous counterfactual pollution of the rule base. This improves the robustness and security of the system's self-evolution and solves the problem of experience pollution caused by the lack of quality assessment in existing technologies. Attached Figure Description
[0019] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a system module diagram of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments. It should be understood that the specific embodiments described herein are merely for explaining the invention and are not intended to limit the scope of protection of the invention.
[0021] Example 1 Please see Figure 1 As shown, this embodiment provides a dynamic orchestration method for software engineering tasks based on multi-agent collaboration. This method runs on a collaborative platform containing multiple specialized agents and is uniformly scheduled by a central orchestrator. Specifically, it includes: S1. Constructing a graph of the R&D process evolution. When the orchestrator receives a research and development task, the system breaks down the task into several atomic subtasks and assigns them to the corresponding professional intelligent agents for execution. During the task execution, multi-dimensional process information is collected in real time to accumulate historical experience for subsequent task prediction and strategy optimization.
[0022] The system records the selection results at each branch decision point, the time point of each tool call sequence, input parameters, return status, and execution time, the time of manual intervention, the operation content, and the processing result, the cause of failure, rollback operation, retry strategy, and the complete sequence of steps for eventual successful recovery, as well as the waiting time, data transmission time, and actual completion time for cross-agent dependencies. All of the above information is organized into a directed graph structure, which is the evolutionary graph of the R&D process.
[0023] In the evolutionary graph of the R&D process, nodes represent key events, including task start, branch decision points, tool calls, human intervention, failure, and successful recovery; the edges in the graph represent the temporal dependencies and causal relationships between events. Each node is also associated with attribute information, including event type, timestamp of occurrence, unique identifier of the participating agent, computational or storage resources consumed, and success or failure flag.
[0024] The evolutionary map of the R&D process accumulates continuously with the execution of each task, forming a constantly growing historical experience knowledge base.
[0025] S2. Graph embedding and prediction upon arrival of a new task When a new task arrives at the system, a graph neural network is used to process the existing R&D process evolution graph, thereby extracting generalizable task execution patterns from historical successes and failures.
[0026] Furthermore, this embodiment employs a graph attention network as the graph neural network model. The attention mechanism calculates the association weights between each node and its neighbors in the graph, and aggregates the feature information of the neighbors accordingly to generate a high-dimensional embedding vector for each node. Through global pooling operations in the network, such as averaging or summing the embeddings of all nodes, a graph-level embedding vector representing the entire historical graph is obtained. This graph-level embedding vector encodes the common patterns and typical patterns exhibited by all past tasks during execution.
[0027] The graph-level embedding vector is concatenated with the metadata of the current task, including task type identifier, estimated size, and expected delivery time. The concatenated vector is then input into a multilayer perceptron, whose output consists of three parts: The optimal hierarchical structure for decomposing the current task, which involves dividing the task into several subtasks and the dependencies between them; the type of agent to be assigned to each subtask, such as a code generation agent, a testing agent, or a code review agent; and the estimated resource allocation scheme.
[0028] In this way, the system can learn from past successes and plan a proven workflow path with a higher probability of success for new tasks, thereby avoiding repeating the same mistakes.
[0029] S3. Counterfactual reasoning based on structural causal models During task execution, the orchestrator continuously monitors the execution status of each agent to promptly identify and locate decision nodes that lead to task failure. Blockage detection is achieved through a multi-layered comprehensive detection mechanism, which includes rule detection based on a blocking pattern library and intelligent prediction based on historical graph similarity.
[0030] The orchestrator maintains a blocking mode library, which predefines various blocking types and their corresponding detection rules for different development scenarios. Blocking types include output format errors or compilation failures due to incorrect model selection, permission timeouts, unresponsive external tool calls, data inconsistencies in cross-agent dependencies, and deadlocks caused by resource contention.
[0031] For model selection errors, the detection rule is set as follows: when the output of a subtask cannot be parsed by the downstream agent, or when the returned error code belongs to a preset set of model incompatibility error codes, it is considered a blocking condition. This set of incompatible error codes includes error codes corresponding to keywords such as "unexpected token" and "module not found".
[0032] For permission waiting, the detection rule is set as follows: when a subtask requests database read / write permissions, if the waiting time exceeds a preset multiple of the historical average waiting time for this type of task, and no authorization response is received, it is determined to be blocked. In a preferred embodiment, this multiple is between 2.5 and 3.5 times; this embodiment uses 3 times.
[0033] For unresponsive tool calls, the detection rule is set as follows: if no return signal is received within a preset timeout period after calling an external tool, and the maximum number of retries has been reached without success, it is considered a blockage. Preferably, the timeout period is set to thirty seconds, and the number of retries is set to three.
[0034] Furthermore, intelligent detection is performed using anomaly patterns from the historical graph. When the execution trajectory of a subtask is highly similar to a known failure pattern in the historical graph, the system predicts and determines in advance that there is a risk of blocking, even if a timeout or explicit error code has not yet been triggered. Specifically: If the historical graph records multiple compilation failures caused by selecting model A, and the current task selects model A again, and the feature matching degree between the compilation stage features and the features of the historical failure cases exceeds a preset threshold, the system will issue a blocking warning in advance. This matching degree threshold is preferably 85%.
[0035] The matching score is calculated as follows: The current execution trajectory is encoded into a sequence of event types and a sequence of event parameters, and compared with the sequences corresponding to historical failure patterns. First, the order similarity of the event types is compared, and then the matching degree of the event parameters at the same position is compared. If the parameters are exactly the same, it is a complete match; if they belong to the same type of tool, it is a partial match; otherwise, it is a no match. The final matching score is obtained by weighting type similarity and parameter similarity, with type similarity having a weight of 60% and parameter similarity having a weight of 40%. When the matching score reaches 85% or higher, it is judged as highly similar, triggering a blocking warning.
[0036] When a blockage is detected, the system locates the key decision node causing the blockage and initiates the counterfactual reasoning module. The core of this module is a pre-built structural causal model. The construction process of this structural causal model is as follows: The algorithm extracts all decision nodes from the R&D process evolution graph as causal variables, tool response time, resource utilization, and intermediate processing status as intermediate variables, and whether the task is ultimately blocked or successful as an outcome variable. A causal discovery algorithm is then used to learn the causal dependencies between these variables.
[0037] This embodiment uses the PC algorithm, which constructs a completely undirected graph, performs conditional independence checks to gradually delete edges, and finally determines the direction of the edges according to the direction propagation rule.
[0038] The PC algorithm is combined with the task data in the following ways: Decision nodes are extracted from the evolutionary graph as causal variables, tool response time and resource utilization rate are extracted as intermediate variables, and task blocking is extracted as an outcome variable. For continuous variables, partial correlation coefficients are used to test conditional independence with a significance level of 0.05. For discrete variables, G-test is used. After determining the causal direction, linear regression or neural network is used to estimate the structural equation parameters.
[0039] After obtaining the causal graph structure, the parameters of the causal structural equation are estimated. For linear relationships between continuous variables, multiple linear regression is used to estimate the equation coefficients; for nonlinear relationships, a two-layer fully connected neural network is used for parameterization, with 64 hidden layer nodes and ReLU activation function.
[0040] The counterfactual reasoning module performs intervention operations on the decision node corresponding to the blockage point in the structural causal model. That is, it uses the do-operator to force the value of the decision node to be a candidate alternative decision value, and cuts off the input edge of the node that is affected by other causal variables. The module propagates along the forward direction of the causal graph and recalculates the counterfactual values of intermediate variables and outcome variables.
[0041] Specifically, in a linear structural equation model containing decision variables, intermediate variables, and outcome variables, the predicted values of the intermediate variables are recalculated by replacing the actual values of the decision variables with candidate alternative values and then substituting them into the structural equation model to determine whether the outcome variables have changed. Multiple counterfactual paths are generated by enumerating all candidate alternative decisions.
[0042] S4. Confidence Assessment and Screening of Counterfactual Paths After generating multiple counterfactual paths, the system performs a confidence assessment step to prevent low-quality or erroneous counterfactuals from polluting the rule base, ensuring that only highly reliable experiences are used for policy evolution. The confidence of each counterfactual path is calculated using the following formula:
[0043] in, This indicates the confidence level of the counterfactual path, with a value ranging from 0 to 1. The larger the value, the higher the confidence level of the counterfactual path. This represents the historical success rate, which is the percentage of historical tasks that were successfully completed after the alternative decision was adopted in a context similar to the current task type. This is the weighting coefficient for historical success rates; This represents the deviation, which is a measure of the difference between the simulated execution result and the actual result distribution of the same task in the historical graph. The value ranges from 0 to 1, and the smaller the deviation, the closer the value is to one. The weighting coefficient for the degree of deviation; The stability score represents the path stability, which is the stability score obtained after performing sensitivity analysis on the causal path from the decision node to the outcome node in the structural causal model. These are the weighting coefficients for path stability; It represents semantic similarity, which is the normalized value of the graph embedding vector distance between the current task and similar tasks in the historical graph that generated the counterfactual path; This represents the weighting coefficient for semantic similarity.
[0044] Furthermore, the specific calculation methods for each of the above factors are as follows: Historical success rate This refers to retrieving historical tasks related to an alternative decision from the evolutionary graph of the R&D process, and statistically analyzing the success rate of that decision in these tasks. The retrieval is limited to tasks of similar type, and similarity is determined by the cosine distance of the graph embedding vectors, with a threshold of 0.5.
[0045] Deviation It is a measure of difference obtained by comparing the simulation results with the actual results distribution of all similar tasks in the historical graph. The compilation time predicted by counterfactual method is used as the simulation result, and the absolute value of the difference after normalization by Mahalanobis distance or Z-score is used as the deviation.
[0046] Path stability This is an index obtained by performing sensitivity analysis on the causal path from the decision node to the outcome node in a structural causal model. Specifically, a small perturbation is applied to each parameter in the causal structural equation, the magnitude of change of the outcome variable is calculated, and the reciprocal of the average magnitude of change of all parameters, after normalization, is the path stability score. The perturbation magnitude is preferably set to 1%.
[0047] semantic similarity This is the vector distance between the graph embedding vectors of the current task and similar tasks in the historical graph that generated the counterfactual path. This vector distance can be cosine distance or Euclidean distance, and the distance value is normalized to the interval between zero and one before being used as semantic similarity.
[0048] Furthermore, the weighting coefficients of each factor can be dynamically adjusted according to the application scenario. In a preferred embodiment, the weight of historical success rate is... Set the weight of deviation to 0.3. Set to 0.2, the weight for path stability. Set to 0.2, the weight of semantic similarity Set to 0.3. All factors have been normalized to the zero-to-one interval before weighting.
[0049] A confidence threshold is preset, which can be dynamically determined based on the statistical characteristics of the confidence distribution during system operation, or a pre-calibrated fixed value can be used. In a preferred embodiment, the initial value of the confidence threshold is set to 0.8.
[0050] Only confidence level Counterfactual paths exceeding the confidence threshold are retained for subsequent policy patch generation. If the confidence of all counterfactual paths is below the threshold, no patch is generated, and the blocking event is recorded in the low-confidence event log for manual review or subsequent offline analysis.
[0051] Furthermore, to illustrate the effectiveness and reliability of the confidence assessment mechanism more intuitively, a specific calculation example is provided below. Suppose a counterfactual reasoning operation generates a candidate path, and the system calculates the following values for each factor: Historical Success Rate The deviation is 0.85. The path stability is 0.12. The semantic similarity is 0.9. The weighting coefficient is 0.88, and the above-mentioned preferred value is adopted. =0.3、 =0.2、 =0.2、 =0.3. Substitute the above value into the confidence level calculation formula: =0.3×0.85+0.2×(1-0.12)+0.2×0.9+0.3×0.88=0.875 Calculated confidence level The value is 0.875, significantly exceeding the preset threshold of 0.8. Therefore, this counterfactual path is determined to be a high-confidence path and can be used to generate policy patches. Conversely, it is assumed that another path has a lower historical success rate (e.g., =0.55) or a large deviation (e.g. =0.35), then substituting into the calculation, we get: =0.3×0.55+0.2×(1-0.35)+0.2×0.9+0.3×0.88=0.739 If the confidence level of 0.739 is lower than the threshold of 0.8, it will be automatically filtered out and will not be included in the rule base.
[0052] The above calculation examples show that, through multi-factor weighted fusion, confidence assessment can comprehensively reflect the reliability of counterfactual paths: the higher the historical success rate, the more consistent the simulation results are with historical distributions, the more stable the causal path, and the more similar the semantics, the higher the confidence level; conversely, poor performance of any factor will cause the confidence level to drop below the threshold.
[0053] The above methods effectively eliminate low-quality experiences, ensuring the purity of the rule base and the security of the system's self-evolution. Only confidence levels are considered. Counterfactual paths exceeding the confidence threshold are retained for subsequent policy patch generation. If the confidence of all counterfactual paths is below the threshold, no patch is generated, and the blocking event is recorded in the low-confidence event log for manual review or subsequent offline analysis.
[0054] S5, Strategy Patch Generation and Injection Counterfactual paths filtered by confidence level are transformed into executable policy patches. Each policy patch is a set of structured rules, with each rule containing four elements: Triggering conditions, such as when the task type is unit test writing and the estimated code size exceeds one thousand lines; Alternative decisions, such as prioritizing model B over the default model A; Priority: Sets the priority level of this patch rule, ensuring it is higher than the default rule; And the scope of application, limiting which types of subtasks or which intelligent agents the rule applies to.
[0055] The orchestrator's decision rule base supports dynamic hot-loading of policy patches. This means that without interrupting system operation, newly generated patches are injected into the rule base and the index is updated. When similar tasks arrive in the future, the orchestrator will prioritize matching the patch rules when formulating scheduling policies, thereby gradually optimizing the execution efficiency of the workflow and avoiding the recurrence of similar blocking.
[0056] In addition, after the task is completed, the entire process data of this execution, including the actual branch decisions adopted, the specific time spent on tool calls, the record of manual intervention, and the complete process of failure recovery, will be added to the R&D process evolution map. The parameters of the causal structure equation of the structure causal model will be updated using incremental learning methods such as stochastic gradient descent based on the new data.
[0057] With the continuous accumulation of successful experiences and lessons learned from failures, the prediction accuracy and counterfactual reasoning effectiveness of graph neural networks have been continuously improved, forming a complete closed-loop self-evolution mechanism.
[0058] Through the above steps, this embodiment elevates counterfactual reasoning from simple simulation to causal inference and introduces a confidence assessment and screening mechanism, which significantly improves the robustness and security of the system's self-evolution.
[0059] Example 2 Please see Figure 2 As shown, this embodiment provides a dynamic orchestration system for software engineering tasks based on multi-agent collaboration, including: Process recording module It is configured to dynamically collect branch decisions, tool call sequences, manual intervention points, failure recovery paths, and actual time consumption across agent dependencies during the execution of each task, and construct an evolution map of the R&D process based on this information.
[0060] By listening to communication messages between the orchestrator and each agent, tool call logs, and input from the manual intervention interface, event data is captured in real time and stored in a structured form as a directed graph.
[0061] Graph embedding and prediction module It is configured to use a graph neural network to embed and encode the historical graph in the evolution graph of the R&D process when a new task is received, generate the embedding vector of the current task, and predict the optimal decomposition method and role allocation strategy of the current task based on the embedding vector.
[0062] Furthermore, the module incorporates a pre-trained graph attention network and a multilayer perceptron. The graph attention network is responsible for extracting high-dimensional features from the historical graph, while the multilayer perceptron is responsible for mapping the features into specific task decomposition schemes and agent allocation suggestions.
[0063] Blockage Detection and Counterfactual Reasoning Module It is configured to detect blocking events through a multi-level blocking detection mechanism during task execution and initiate counterfactual reasoning when a blocking event is detected.
[0064] Specifically: a pre-built structural causal model is constructed, which describes the causal structural equations between each decision node, intermediate variable and final result in the task execution; when a blockage occurs, an intervention operation is performed on the decision node corresponding to the blockage point on the structural causal model, and counterfactual results under each candidate alternative decision are calculated through forward propagation to generate multiple counterfactual paths.
[0065] Confidence assessment module It is configured to calculate the counterfactual confidence of each counterfactual path. The calculation of counterfactual confidence comprehensively considers four factors: the success rate of historical alternative decisions, the degree of deviation between simulation results and historical distribution, the stability of causal paths, and the semantic similarity of tasks. The weight of each factor can be dynamically adjusted according to the application scenario.
[0066] Furthermore, this module only passes counterfactual paths with confidence levels exceeding a preset threshold to the policy patch injection module, while other low-confidence paths are recorded but not used for automatic evolution; when the confidence levels of all counterfactual paths are below the preset threshold, no policy patch is output and the corresponding event is recorded in the low-confidence event log.
[0067] Policy Patch Injection Module Configured to transform filtered counterfactual paths into executable policy patches and inject these patches into the orchestrator's decision rule base. This module is responsible for compiling the causal logic in the counterfactual paths into structured rules in IF-THEN format and dynamically loading the rules by calling the hot-update interface of the orchestrator's rule base.
[0068] Incremental Update Module for Map and Model It is configured to append the process data of this execution to the R&D process evolution graph after the task is completed, and use the new data to update the causal structure equation parameters of the structural causal model through incremental learning.
[0069] Furthermore, this module employs incremental graph storage technology, adding only new nodes and edges without modifying the written historical records, thus ensuring the integrity and traceability of the graph and the immutability of the evolutionary history. At the same time, it updates the causal structure equations through online learning, enabling the model to adapt to the dynamic changes in the research and development environment.
[0070] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for dynamic orchestration of software engineering tasks based on multi-agent collaboration, characterized in that, include: S1. Dynamically record the branch decisions, tool call sequences, manual intervention points, failure recovery paths, and actual time consumption across agent dependencies during the execution of each task, and construct an evolution map of the R&D process; S2. When a new task is received, the graph neural network is used to embed and encode the historical graph in the evolution graph of the R&D process, generate the embedding vector of the current task, and predict the optimal decomposition method and role allocation strategy of the current task based on the embedding vector. S3. During the execution of the current task, the task execution status is monitored through a multi-level blocking detection mechanism, which includes rule detection based on a blocking pattern library and intelligent prediction based on historical graph similarity. When task blocking is detected, counterfactual reasoning is performed based on a pre-built structural causal model. In the structural causal model, intervention operations are performed on the decision nodes corresponding to the blockage points. Counterfactual results under each candidate alternative decision are calculated through forward propagation, generating multiple counterfactual paths. Among them, the structural causal model describes the causal structural equations between each decision node, intermediate variable and final result in the task execution; S4. Calculate the counterfactual confidence level of each counterfactual path, and use the counterfactual paths with confidence levels exceeding a preset threshold to generate policy patches; The counterfactual confidence score is obtained by weighted fusion of multiple factors, including historical success rate, deviation of simulated execution results from historical distribution, causal path stability, and task semantic similarity. S5. Inject the policy patch into the orchestrator's decision rule base to update the scheduling policy for subsequent tasks.
2. The method for dynamic orchestration of software engineering tasks based on multi-agent collaboration according to claim 1, characterized in that, The evolution graph of the R&D process is stored in a directed graph structure. Nodes in the graph represent key events in the task execution process. Key events include task start, branch decision point, tool call, human intervention, failure, and recovery success. Edges in the graph represent the temporal dependencies and causal relationships between events. Each node is associated with attribute information, including event type, timestamp, participating agent identifier, resource consumption, and whether it was successful.
3. The method for dynamic orchestration of software engineering tasks based on multi-agent collaboration according to claim 1, characterized in that, Graph neural networks employ graph attention networks or graph convolutional networks to generate high-dimensional embedding vectors that reflect task execution patterns by aggregating node and edge features in historical graphs. The optimal task decomposition method and role allocation strategy based on embedding vectors include: outputting the hierarchical structure of task decomposition, the dependencies between subtasks, and the types of agents to be assigned based on the embedding vectors through a multilayer perceptron.
4. The method for dynamic orchestration of software engineering tasks based on multi-agent collaboration according to claim 3, characterized in that, Methods for constructing structural causal models include: Decision nodes are extracted from the evolution map of the R&D process as causal variables, tool response time and resource utilization rate are extracted as intermediate variables, and task blocking or success is extracted as outcome variables. Causal discovery algorithms are used to learn causal relationships between variables, and regression or neural networks are used to estimate the parameters of causal structural equations.
5. The method for dynamic orchestration of software engineering tasks based on multi-agent collaboration according to claim 1, characterized in that, The intervention operation uses the do-operator to force the value of the decision node corresponding to the blockage point to be the candidate alternative decision value, cuts off the input edge of the node affected by other causal variables, and calculates the counterfactual values of intermediate and outcome variables by forward propagation along the causal graph.
6. The method for dynamic orchestration of software engineering tasks based on multi-agent collaboration according to claim 1, characterized in that, In the calculation of counterfactual confidence, each factor is weighted and fused using preset weight coefficients, which can be dynamically adjusted according to different application scenarios; semantic similarity is calculated by the vector distance of the task graph embedding vectors.
7. The method for dynamic orchestration of software engineering tasks based on multi-agent collaboration according to claim 1, characterized in that, The policy patch is a structured rule that includes triggering conditions, alternative decisions, priorities, and scope of application. The orchestrator's decision rule base supports dynamic hot loading of policy patches and prioritizes matching the patch rules when similar tasks arrive in the future.
8. The method for dynamic orchestration of software engineering tasks based on multi-agent collaboration according to claim 1, characterized in that, Also includes: After completing a task, the process data of this execution is added to the R&D process evolution map, and the causal structure equation parameters of the structure causal model are updated using incremental learning with the new data. When the confidence of all counterfactual paths is below a preset threshold, no policy patch is generated and the blocking event is recorded in the low confidence event log.
9. A dynamic orchestration system for software engineering tasks based on multi-agent collaboration, characterized in that, include: The process recording module is used to dynamically collect branch decisions, tool call sequences, manual intervention points, failure recovery paths, and actual time consumption across agent dependencies during the execution of each task, and to construct an evolution map of the R&D process; The graph embedding and prediction module is used to embed and encode the historical graph in the evolution graph of the R&D process using a graph neural network when a new task is received, generate the embedding vector of the current task, and predict the optimal decomposition method and role allocation strategy of the current task based on the embedding vector. The blocking detection and counterfactual reasoning module is used to detect blocking events through a multi-level blocking detection mechanism during task execution, and to initiate counterfactual reasoning when blocking is detected. The counterfactual reasoning module has a pre-built structured causal model, and multiple counterfactual paths are generated by performing intervention operations on the structured causal model; The confidence assessment module is used to calculate the counterfactual confidence of each counterfactual path and filter out counterfactual paths whose confidence exceeds a preset threshold. The policy patch injection module is used to transform the filtered counterfactual paths into executable policy patches and inject the policy patches into the orchestrator's decision rule base.
10. A software engineering task dynamic orchestration system based on multi-agent collaboration according to claim 9, characterized in that, It also includes a graph and model incremental update module, which is used to append the process data of this execution to the R&D process evolution graph after the task is completed, and use the new data to update the causal structure equation parameters of the structural causal model through incremental learning; the confidence evaluation module does not output any policy patch and records the corresponding event in the low confidence event log when the confidence of all counterfactual paths is lower than the preset threshold.