Task execution method and system based on multi-agent cooperation

By employing a multi-agent collaborative task execution method and utilizing evidence chains and stack-based rollback mechanisms, the problems of context accumulation and error cascading in complex task processing are solved, achieving physical isolation for online error correction and improving the interpretability of results.

CN121807506BActive Publication Date: 2026-07-03XIAMEN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAMEN UNIV
Filing Date
2026-03-12
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies have several drawbacks in handling complex tasks, including: the need for supplementary forward correction leading to context accumulation and error cascading; the inadequacy of experience-driven error correction to new errors; the difficulty in balancing semantic density and uncertainty with mechanical segmentation or partial pruning; and the lack of a structured auditing mechanism based on objective evidence.

Method used

A multi-agent collaborative task execution method is adopted. Through dynamic audit verification and stack-based rollback mechanism, the evidence chain is used for context cleanup to avoid error cascading. This includes semantic parsing of task instructions, multi-granularity decomposition, construction of temporal dependency relationships, context snapshot stacking, auditing and consistency comparison of the critic agent, and stack popping and physical cleanup when the consistency score is lower than the threshold.

Benefits of technology

It achieves physical isolation and cleanup of online error correction, improves the interpretability and auditability of results, reduces invalid generation, is suitable for online deployment and real-time error correction, and avoids context accumulation and error cascading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807506B_ABST
    Figure CN121807506B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of multi-agent collaboration, and particularly relates to a task execution method and system based on multi-agent collaboration, which comprises the following steps: performing semantic analysis and multi-granularity decomposition on user task instructions, generating a subtask dependency structure and storing it in a dynamic task pool; performing collaborative planning and pre-execution on the subtasks to be executed, generating a context snapshot and performing Push writing to a history state stack; retrieving an evidence chain and extracting a set of fact triplets based on a domain knowledge base, performing consistency comparison on a candidate reasoning path based on the structured evidence triplets, and outputting a conflict confidence and a consistency score; triggering a pop stack and physically clearing intermediate data in the error branch when the consistency score is lower than a threshold, restoring the historical context and injecting negative feedback to generate a new reasoning branch and return to continue pre-execution; outputting the result and entering the next subtask when the verification is passed; thereby improving the controllability and auditability of multi-agent collaborative task execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and multi-agent collaboration, and in particular to a task execution method and a task execution system based on multi-agent collaboration. Background Technology

[0002] In complex task processing scenarios, systems typically need to understand and break down natural language task instructions, and invoke external tools or systems in multiple steps to complete cross-domain operations. With the development of large language model-driven agent technology, multi-agent collaboration is gradually becoming an important means of executing complex tasks.

[0003] In existing technologies, a common type of collaboration method adopts a linear forward flow: the task is broken down and executed step by step, and when deviations are found, correction suggestions, update operations or compensatory instructions are added to the original reasoning path and original context to continue to advance the subsequent steps.

[0004] However, the aforementioned supplementary forward correction is based on the idea of ​​"patching up the wrong path". The error information and its related intermediate conclusions are retained and continue to enter the attention scope of subsequent reasoning, which can easily cause attention interference and trigger error cascade, making it difficult for the system to achieve thorough error correction.

[0005] At the same time, append-only corrections cause the context to grow continuously, which can easily lead to context window overflow in long-chain tasks. The system is forced to summarize or discard historical information, thereby reducing consistency, controllability and interpretability.

[0006] Another approach tends to be driven by historical experience: selecting reasoning paths by building a historical experience base, similarity matching, or reflective structural reconstruction. This type of approach has limited coverage of unseen errors or novel scenarios, and if there is a lack of a mechanism to clear the error context, erroneous branches may still implicitly affect subsequent reasoning.

[0007] Other improvement approaches attempt to mitigate context growth through context compression, such as mechanically segmenting long texts using a segmentation strategy based on a preset fixed length, or pruning cached information using local metrics based on attention scores / access frequency.

[0008] However, fixed-length segmentation strategies ignore the semantic density differences of the input text: they tend to truncate key contexts in high-complexity segments, while wasting computational resources in low-complexity segments, making it difficult to balance efficiency and accuracy.

[0009] Local pruning based on attention scores or access frequency is essentially a local greedy strategy. It only makes retention / discard decisions based on local strength, ignoring the uncertainty of overall generation. When the model is in a state of high uncertainty, blind pruning can easily lead to the loss of key information and cause illusions or logical collapse.

[0010] In addition, some solutions rely on capability enhancement during the training phase (such as improving model performance through data increments or parameter updates), but training and parameter updates are costly and cannot directly solve the problems of rapid localization, physical isolation, and state recovery of immediate errors during the online inference phase.

[0011] Therefore, existing technologies have at least the following shortcomings: supplementary forward correction leads to context accumulation and induces error cascading; experience-driven error correction is not robust to new errors and lacks physical rollback; mechanical segmentation or partial pruning is difficult to balance semantic density and uncertainty; and there is a lack of structured auditing mechanisms based on objective evidence to support traceable verification. Summary of the Invention

[0012] This invention aims to at least partially solve one of the technical problems in the aforementioned technologies. To this end, one objective of this invention is to propose a task execution method based on multi-agent collaboration, which can perform dynamic auditing and verification based on searchable evidence when factual conflicts, constraint violations, or logical jumps occur during task execution, and physically clear erroneous contexts through a stack-based rollback mechanism, avoiding context accumulation and error cascading caused by append-only corrections.

[0013] The second objective of this invention is to propose a task execution system based on multi-agent collaboration.

[0014] To achieve the above objectives, the first embodiment of the present invention proposes a task execution method based on multi-agent collaboration, comprising the following steps: S110, obtaining task instructions, performing semantic parsing and multi-granularity decomposition on the task instructions to generate a subtask set including direct subtasks and related subtasks, constructing a subtask dependency structure including temporal dependencies based on the subtask set, and storing the subtask dependency structure in a dynamic task pool; S120, determining the subtask to be executed from the dynamic task pool, the planner agent module generating candidate inference paths corresponding to the subtask to be executed, the executor agent module generating a pre-execution result based on the candidate inference path, generating a context snapshot corresponding to the subtask to be executed, and pushing the context snapshot execution stack onto the historical state stack; S130, the critic agent module auditing the candidate inference path and the pre-execution result to obtain conflict confidence and consistency scores, wherein... The audit process includes extracting key entities and entity relationships from the pre-execution results, retrieving evidence chain text blocks from the domain knowledge base based on the key entities and entity relationships, extracting a set of fact triples, mapping the candidate reasoning path to a set of candidate triples, performing a consistency comparison between the set of candidate triples and the set of fact triples, and outputting conflict confidence and consistency score; S140, determining whether the consistency score is lower than a preset threshold; if so, popping the historical state stack to roll back to the historical context snapshot corresponding to the top of the stack after the pop, and physically clearing the intermediate data of the erroneous branch associated with the popped stack context snapshot; generating negative feedback prompts based on the conflict items of the consistency comparison and injecting them into the executor agent module to generate a new reasoning branch different from the candidate reasoning path, and returning to execution S120; if not, confirming the pre-execution results and updating the context state, outputting the results, and executing the next subtask.

[0015] The task execution method based on multi-agent collaboration proposed in this application has the following advantages: it achieves physical isolation and clearing of the context of erroneous branches through stack rollback; it improves the interpretability and auditability of results through evidence chain and fact triple auditing; it reduces invalid generation through asynchronous streaming evaluation and interrupt signals; and the whole process occurs in the inference stage and does not involve model parameter updates, which facilitates online deployment and real-time error correction.

[0016] In addition, the task execution method based on multi-agent cooperation proposed in the above embodiments of the present invention may also have the following additional technical features:

[0017] Optionally, the dynamic task pool includes at least an execution queue, a blocking queue, and a rollback retry queue; each subtask includes a task identifier, a set of dependent predecessors, a priority, a capability requirement vector, a failure count, and a set of context constraints; when the stack pop is triggered, the corresponding subtask is written into the rollback retry queue and its verification priority is increased.

[0018] Optionally, the context snapshot includes: a dialogue context summary, environment state, tool invocation state, a set of verified inference prefix indices, a key entity table, a set of constraints, and an intermediate result reference index.

[0019] Optionally, the historical state stack is a last-in-first-out stack structure; the push stack includes binding and storing the context snapshot with the inference node index; the pop stack includes deleting the inference node cache, unsubmitted tool call candidate parameters, erroneous evidence reference index and erroneous hypothesis list associated with the popped context snapshot, so that the cleared data no longer participates in subsequent calculations.

[0020] Optionally, when generating the pre-execution result, the system interacts with external tools or systems through an external interface module to obtain reversible simulation execution results, which include tool-returned summaries and parameter filling results.

[0021] Optionally, the construction and retrieval of the domain knowledge base includes: performing structured segmentation and / or semantic segmentation on the domain documents to form a set of text blocks; extracting keywords from the set of text blocks and constructing a keyword clustering tree index; during verification, using the key entities and entity relationships as query input, performing a top-down multi-hop retrieval in the keyword clustering tree, and locking the target text block through the folded tree path to form a chain of evidence.

[0022] Optionally, the consistency comparison includes conflict detection and support detection: for each candidate triple, it is determined whether it is supported by the chain of evidence, whether it conflicts with the fact triple, and whether it violates the timing constraint or dependency constraint; the conflict confidence is calculated based on the number of conflicts, the severity of the conflict type, and the credibility of the evidence source, and the consistency score is calculated accordingly.

[0023] Optionally, the negative feedback prompt includes: error type label, a list of triples that trigger conflicts, a list of erroneous assumptions that cannot be reused, a list of constraints that need to be satisfied, and an alternative reasoning strategy instruction, to guide the executor agent module to generate new reasoning branches while retaining the verified correct reasoning prefixes.

[0024] Optionally, the executor agent module and the critic agent module adopt an asynchronous streaming interaction mode. The executor agent module generates inference nodes in a streaming manner using a Node Stream. The critic agent module evaluates the generated inference nodes in real time. When a hard conflict is detected, the critic agent module sends an interrupt signal to the executor agent module to stop subsequent generation and triggers a rollback request to the rollback and hint injection module to perform the stack pop and physical cleanup.

[0025] To achieve the above objectives, a second aspect of the present invention proposes a task execution system based on multi-agent collaboration, comprising: a task parsing and task pool module, used to perform task semantic parsing and decomposition and generate sub-task dependency structures stored in a dynamic task pool; a collaborative scheduling module, used to select sub-tasks to be executed from the dynamic task pool and schedule the planner agent module and the executor agent module; a historical state stack module, used to store context snapshots and provide push and pop operations; a planner agent module, used to generate candidate inference paths; an executor agent module, used to generate pre-execution results based on the candidate inference paths; and a critic agent module. The module is used to perform consistency audits on candidate reasoning paths based on fact triples, without outputting executable action instructions; the evidence retrieval and triple verification module is used to retrieve evidence chains from the domain knowledge base, extract fact triple sets, perform consistency comparisons, and output conflict confidence and consistency scores; the rollback and prompt injection module is used to trigger stack popping, physically clear intermediate data of erroneous branches, and inject negative feedback prompts when the consistency score is lower than a preset threshold; the external interface module is used for interaction between the executor agent module and external tools or systems; and each module is configured to collaboratively execute the task execution method based on multi-agent collaboration as described above. Attached Figure Description

[0026] Figure 1 This is a flowchart illustrating a task execution method based on multi-agent collaboration according to an embodiment of the present invention.

[0027] Figure 2 This is a flowchart illustrating a task execution method based on multi-agent cooperation according to an embodiment of the present invention.

[0028] Figure 3 This is a schematic diagram of historical state stack rollback according to an embodiment of the present invention;

[0029] Figure 4 This is a schematic diagram of evidence retrieval and triplet verification logic according to an embodiment of the present invention;

[0030] Figure 5 This is a timing diagram of an asynchronous streaming interaction and interrupt mechanism according to an embodiment of the present invention;

[0031] Figure 6 This is a schematic diagram of the architecture of a task execution system based on multi-agent collaboration according to an embodiment of the present invention. Detailed Implementation

[0032] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0033] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the invention to those skilled in the art.

[0034] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0035] It should be noted that the task execution method based on multi-agent collaboration is executed during the model inference phase and does not involve gradient updates of the agent model parameters; the task instructions can be natural language instructions, structured instructions, or a combination thereof; candidate inference paths are used to represent the sequence of inference nodes or branches of inference graphs generated by the executor agent to complete the sub-task; pre-execution is used to verify the candidate inference paths in a reversible or simulated environment to obtain intermediate results; fact triples are used to represent the objective constraints of (entity-relation-entity); candidate triples are used to represent the structured assertions extracted from the assertions of the candidate inference paths.

[0036] The Critics Agent module is defined as an auditor: it lacks the ability to generate action or tool invocation instructions and does not output executable action instructions; its output is used to trigger rollback and hint injection, including conflict items, evidence chain indexes, conflict confidence levels, and suggested corrective constraints. The History State Stack module uses a Last-In-First-Out (LIFO) stack structure to store context snapshots; the pop operation not only represents restoring the pointer but also includes the physical clearing (Pop & Clear) of intermediate data associated with erroneous branches to ensure that erroneous information no longer participates in subsequent calculations. The Negative Prompt module injects conflict constraints and corrective suggestions into the executor, driving it to generate new reasoning branches distinct from erroneous branches; the prompt can include prohibitions on reusing assumptions, mandatory evidence types, and alternative reasoning strategies.

[0037] Figure 1 This is a flowchart illustrating a task execution method based on multi-agent cooperation according to an embodiment of the present invention, as shown below. Figure 1 As shown, this task execution method based on multi-agent cooperation includes the following steps:

[0038] S110: Obtain task instructions, perform semantic parsing and multi-granularity decomposition on task instructions to generate a subtask set including direct subtasks and related subtasks, construct a subtask dependency structure including temporal dependencies based on the subtask set, and store the subtask dependency structure in the dynamic task pool.

[0039] As an example, the dynamic task pool includes at least an execution queue, a blocking queue, and a rollback retry queue; each subtask includes a task identifier, a set of dependent predecessors, a priority, a capability requirement vector, a failure count, and a set of context constraints; when a stack pop is triggered, the corresponding subtask is written into the rollback retry queue and its verification priority is increased.

[0040] S120: Determine the sub-tasks to be executed from the dynamic task pool. The planner agent module generates candidate inference paths corresponding to the sub-tasks to be executed. The executor agent module generates pre-execution results based on the candidate inference paths, generates context snapshots corresponding to the sub-tasks to be executed, and pushes the context snapshots onto the historical state stack.

[0041] As one example, the context snapshot includes a dialogue context summary, environment state, tool invocation state, a set of verified inference prefix indices, a key entity table, a set of constraints, and an intermediate result reference index.

[0042] As an example, the historical state stack is a last-in-first-out stack structure; pushing the stack includes binding and storing the context snapshot with the inference node index.

[0043] As an example, when generating the pre-execution results, the system interacts with external tools or systems through an external interface module to obtain reversible simulation execution results. The pre-execution results include a tool-returned summary and parameter filling results.

[0044] S130, the critic agent module audits the candidate reasoning paths and the pre-execution results to obtain conflict confidence and consistency scores. The audit includes extracting key entities and entity relationships from the pre-execution results, retrieving evidence chain text blocks from the domain knowledge base based on the key entities and entity relationships and extracting a set of fact triples, mapping the candidate reasoning paths to a set of candidate triples, comparing the consistency between the set of candidate triples and the set of fact triples, and outputting the conflict confidence and consistency scores.

[0045] As an example, the construction and retrieval of the domain knowledge base includes: performing structured segmentation and / or semantic segmentation on domain documents to form a set of text blocks; extracting keywords from the set of text blocks and constructing a keyword clustering tree index; during verification, using key entities and entity relationships as query input, performing a top-down multi-hop retrieval in the keyword clustering tree, and locking the target text block through the folded tree path to form a chain of evidence.

[0046] As an example, consistency comparison includes conflict detection and support detection: for each candidate triple, it is determined whether it is supported by the chain of evidence, whether it conflicts with the fact triple, and whether it violates the timing constraint or dependency constraint; the conflict confidence is calculated based on the number of conflicts, the severity of the conflict type and the credibility of the evidence source, and a consistency score is calculated accordingly.

[0047] S140: Determine if the consistency score is lower than a preset threshold. If yes, pop the historical state stack to roll back to the historical context snapshot corresponding to the top of the stack after popping, and perform physical clearing on the intermediate data of the erroneous branch associated with the popped context snapshot. Generate negative feedback prompts based on the conflict items of the consistency comparison and inject them into the executor agent module to generate a new inference branch that is different from the candidate inference path, and return to execute S120. If no, confirm the pre-execution result and update the context state, output the result and execute the next subtask.

[0048] As one example, the pop stack includes deleting the inference node cache, uncommitted tool call candidate parameters, erroneous evidence reference index, and erroneous hypothesis list associated with the popped context snapshot, so that the cleared data no longer participates in subsequent calculations.

[0049] As an example, negative feedback prompts include: error type labels, a list of triples that trigger conflicts, a list of erroneous assumptions that cannot be reused, a list of constraints that must be met, and alternative reasoning strategy instructions, to guide the executor agent module to generate new reasoning branches while retaining verified correct reasoning prefixes.

[0050] As an example, the executor intelligent agent module and the critic intelligent agent module adopt an asynchronous streaming interaction mode. The executor intelligent agent module generates inference nodes in a streaming manner using a node stream. The critic intelligent agent module evaluates the generated inference nodes in real time. When a hard conflict is detected, the critic intelligent agent module sends an interrupt signal to the executor intelligent agent module to stop subsequent generation and triggers a rollback request to the rollback and hint injection module to perform stack popping and physical cleanup.

[0051] Specifically, such as Figure 2 and Figure 6As shown: S110 is the task semantic parsing and decomposition. In S110, the task parsing and task pool module 101 performs semantic parsing on the task instructions, extracts the task objectives, input / output constraints, resource constraints, and environmental context features, and generates intent encoding. In some embodiments, the task parsing and task pool module 101 decomposes the task into direct subtasks and related subtasks: direct subtasks are used to advance the core objective output; related subtasks are used for supplementary verification, validation, disambiguation, constraint alignment, or risk checks, and form dependencies with direct subtasks. In some embodiments, the dynamic task pool records the corresponding dependency predecessor set and timing constraints for each subtask, supporting the movement of subtasks to the rollback retry queue and the improvement of their verification priority after verification failure.

[0052] S120 involves collaborative planning, pre-execution simulation, and stacking. In S120, the planner agent module 104 generates candidate inference paths. Each candidate inference path may contain multiple inference nodes, and each node includes at least assertions, evidence requirements, and constraint checks. The executor agent module 105 generates pre-execution results based on the candidate inference paths. In some embodiments, the executor adopts a hierarchical structure: high-level semantic planning corresponds to candidate inference nodes, and low-level action sequences correspond to tool calls or external system operation sequences.

[0053] like Figure 6 As shown, the executor intelligent agent module 105 can perform pre-executive interaction through the external interface module 109; the pre-executive interaction is preferably reversible or simulated execution so as not to produce irreversible side effects during rollback.

[0054] Before or at the start of the pre-execution, the system generates a context snapshot and performs a push operation to write it to the history state stack module 103. The context snapshot includes at least a dialogue context summary, environment state, tool call state, verified inference prefix index set, key entity table, and intermediate result reference index.

[0055] S130 is a knowledge-driven adversarial verification. In S130, the critic agent module 106 audits the candidate reasoning paths. It extracts key entities and entity relationships from the pre-execution results and submits them as query inputs (key entities / relationships) to the evidence retrieval and triplet verification module 107.

[0056] like Figure 4 As shown, the evidence retrieval and triplet verification module 107 includes three stages: data preprocessing, indexing and retrieval, and extraction and verification.

[0057] Data preprocessing stage: Perform structured segmentation and / or semantic segmentation on the domain documents to form a set of text chunks; each text chunk can carry a heading level, source identifier and credibility tag.

[0058] Indexing and retrieval phase: Extract keywords from the text block set and construct a keyword clustering tree index; during retrieval, form a query vector with key entities / relationships, traverse from top to bottom in the keyword clustering tree, lock specific text blocks through multi-hop retrieval and folded tree path, and form a set of evidence chain text blocks.

[0059] Extraction and Verification Phase: Extract a set of fact triples from the evidence chain text blocks; simultaneously map candidate reasoning paths to a set of candidate triples (candidate reasoning path / candidate triple); perform consistency comparison between candidate triples and fact triples, including conflict detection and support detection, and output conflict confidence and consistency score.

[0060] In some embodiments, the conflict confidence score is calculated based on the number of conflicts, the severity of the conflict type, the credibility of the evidence source, and the inference node level at which the conflict assertion is located; the consistency score is obtained by weighting factual consistency, constraint satisfaction, and temporal consistency.

[0061] S140 is for stack popping, rollback, physical cleanup, and hint injection. When the consistency score is lower than the threshold, the system enters the rollback phase and performs stack popping and physical cleanup.

[0062] like Figure 3 As shown, the T1 stage is Push: the system writes the context snapshot bound to the inference node to the historical state stack (for example, snapshot S1 is bound to the state of node A).

[0063] Phase T2 is for execution and verification failure: the system generates subsequent nodes (e.g., node B) based on node A and a logical conflict occurs or the score is below the threshold.

[0064] Phase T3 involves stack rollback and physical clearing (Pop & Clear): The system performs a stack pop to restore the historical context corresponding to snapshot S1, and performs physical clearing on the erroneous node B and all its associated intermediate data. Physical clearing includes not only deleting the inference node cache, but also deleting uncommitted tool call candidate parameters, erroneous evidence reference indexes, erroneous hypothesis lists and their reference relationships, ensuring that they no longer participate in subsequent calculations (corresponding to...). Figure 3 (The trash cans are labeled "Physical Removal / Disposal").

[0065] After the rollback is completed, the rollback and prompt injection module 108 generates a negative feedback prompt based on the conflict triplet and the correction suggestion, and injects it into the executor agent module 105 to guide it to generate a new inference branch (e.g., node C) to replace the erroneous branch and return to execution S120.

[0066] In addition, such as Figure 5As shown, in some embodiments, the executor agent module 105 generates inference nodes (such as node N, node N+1) in a streaming manner of Node Stream, and provides the generated nodes for the critic agent module 106 to evaluate in parallel.

[0067] As Figure 5 shown, the critic agent module 106 performs real-time evaluation on the node stream; when a hard conflict is detected, the critic sends an interrupt signal Interrupt Signal to the executor to stop generation, and triggers a rollback request to the rollback and prompt injection module 108, and the module 108 performs stack popping and clearing accordingly.

[0068] In some embodiments, hard conflicts include direct contradictions with fact triples or inevitable violations of key constraints; soft conflicts include insufficient evidence or lack of dependencies, and the system can trigger the insertion of associated subtasks to supplement evidence and then continue verification.

[0069] Exemplary application embodiments are as follows:

[0070] In one example, the user task is to summarize cross-system data and generate a report. The system decomposes the task into subtasks such as data acquisition, field alignment, exception verification, and report generation at S110, and inserts the exception verification as an associated subtask into the dynamic task pool to block error propagation in advance.

[0071] In the field alignment subtask, the executor agent module 105 generates candidate inference paths and performs pre-execution; the critic agent module 106 calls the module 107 to retrieve the evidence chain and extract the field definition fact triple. If it is found that the Score < Threshold due to unit or caliber conflict, the system triggers Pop&Clear rollback and injects Negative Prompt, and the executor generates a new branch and returns to S120 to retry until verification passes.

[0072] In another example, the result returned by the external system contains ambiguous entity names; the critic retrieves the evidence chain through the keyword clustering tree and extracts the synonym relationship fact triple, outputs the disambiguation constraint, and the system inserts an associated subtask to complete disambiguation and then advances the subsequent subtasks.

[0073] In summary, the task execution method based on multi-agent collaboration in this application runs in the inference stage without updating model parameters. Through the collaborative mechanism of "structured evidence triple adversarial verification" and "History State Stack stack-style stack popping and rollback (Pop&Clear)", it realizes the auditable error correction of the multi-agent inference link and the isolation of context pollution; it avoids context accumulation and error cascading caused by additional corrections on the wrong path, and improves the objectivity and interpretability of verification through evidence chain retrieval of the keyword clustering tree.

[0074] To implement the above embodiments, this invention also proposes a task execution system based on multi-agent cooperation, such as... Figure 6 As shown, the task execution system based on multi-agent collaboration includes: a task parsing and task pool module 101, a collaborative scheduling module 102, a historical state stack module 103, a planner agent module 104, an executor agent module 105, a critic agent module 106, an evidence retrieval and triple verification module 107, a rollback and hint injection module 108, and an external interface module 109.

[0075] The task parsing and task pool module 101 is used to perform task semantic parsing and decomposition and generate subtask dependency structures, which are then stored in a dynamic task pool. The collaborative scheduling module 102 is used to select subtasks to be executed from the dynamic task pool and schedule the planner agent module and the executor agent module. The historical state stack module 103 is used to store context snapshots and provide push and pop operations. The planner agent module 104 is used to generate candidate inference paths. The executor agent module 105 is used to generate pre-execution results based on the candidate inference paths. The critic agent module 106 is used to perform fact-based three-dimensional analysis on the candidate inference paths. The consistency audit of tuples does not output executable action instructions; the evidence retrieval and triple verification module 107 is used to retrieve evidence chains from the domain knowledge base and extract fact triple sets, perform consistency comparison and output conflict confidence and consistency score; the rollback and prompt injection module 108 is used to trigger stack popping, physically clear intermediate data of erroneous branches and inject negative feedback prompts when the consistency score is lower than a preset threshold; the external interface module 109 is used for the interaction between the executor intelligent agent module and external tools or external systems; wherein, each module is configured to collaboratively execute the above-mentioned task execution method based on multi-agent collaboration.

[0076] Specifically, such as Figure 6 As shown, the system can be divided into a task access area, a core collaboration area, and a verification and correction area.

[0077] The task access area includes a task parsing and task pool module 101, which receives task instructions input by the user, performs semantic parsing on the task instructions and decomposes them into direct subtasks and related subtasks, constructs a subtask dependency structure and stores it in a dynamic task pool. Direct subtasks are used to advance core objectives, while related subtasks are used for supplementary verification, dependency validation, constraint alignment, or risk control.

[0078] The core collaboration area includes a collaborative scheduling module 102, a historical state stack module 103, a planner intelligent agent module 104, an executor intelligent agent module 105, and an external interface module 109.

[0079] The collaborative scheduling module 102 is used to select subtasks to be executed from the dynamic task pool and schedule the planner agent module 104 and the executor agent module 105 to work collaboratively; in some embodiments, the collaborative scheduling module 102 can also calculate the matching degree based on the subtask capability requirements and the agent capability descriptions to select a suitable executor agent instance.

[0080] The planner agent module 104 is used to generate candidate inference paths, including high-level semantic planning (what to do, dependencies, expected outputs, evidence requirements), and can annotate the expected state changes for key nodes.

[0081] The executor agent module 105 is used to generate low-level action sequences based on the candidate inference paths and interact with external tools or external systems through the external interface module 109 to complete reversible preview execution; it outputs the preview execution results, including key entities, entity relationships, tool return summaries, and candidate assertion sets.

[0082] The historical state stack module 103 is used to perform a push operation before preview execution, writing the context snapshot into the HistoryState Stack; it receives a pop request when the verification fails and outputs the restored historical context snapshot.

[0083] The verification and correction area includes the critic agent module 106, the evidence retrieval and triple verification module 107, and the rollback and hint injection module 108.

[0084] The critic agent module 106 is used to audit the candidate inference paths: it extracts key entities / relationships from the preview execution results, calls the evidence retrieval and triple verification module 107 to obtain the evidence chain and the set of fact triples, and outputs the conflict confidence and the consistency score Score.

[0085] The evidence retrieval and triple verification module 107 is used to retrieve evidence chain text blocks from the domain knowledge base and extract the set of fact triples, and at the same time compare the consistency of the candidate triples and the fact triples, outputting the conflict detection and support detection results.

[0086] The rollback and hint injection module 108 is used to trigger a pop operation and physical clearing when Score < Threshold, and inject negative feedback prompts Negative Prompt into the executor agent module 105; when the verification passes, the system outputs the result and proceeds to the next subtask.

[0087] It should be noted that the above description and examples of the task execution method based on multi-agent collaboration also apply to the task execution system based on multi-agent collaboration in this embodiment, and will not be elaborated here.

[0088] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0089] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0090] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0091] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0092] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0093] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0094] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

[0095] In the description of this invention, it should be understood that 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 indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0096] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0097] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0098] 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 should not be construed as necessarily referring 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.

[0099] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A task execution method based on multi-agent cooperation, characterized in that, Includes the following steps: S110, Obtain task instructions, perform semantic parsing and multi-granularity decomposition on the task instructions to generate a subtask set including direct subtasks and related subtasks, construct a subtask dependency structure including temporal dependencies based on the subtask set, and store the subtask dependency structure in the dynamic task pool. S120, determine the sub-task to be executed from the dynamic task pool, the planner agent module generates a candidate inference path corresponding to the sub-task to be executed, the executor agent module generates a pre-execution result according to the candidate inference path, generates a context snapshot corresponding to the sub-task to be executed, and pushes the context snapshot onto the historical state stack. S130, the critic agent module audits the candidate reasoning path and the pre-execution result to obtain conflict confidence and consistency score. The audit includes extracting key entities and entity relationships from the pre-execution result, retrieving evidence chain text blocks from the domain knowledge base based on the key entities and entity relationships and extracting a set of fact triples, mapping the candidate reasoning path to a set of candidate triples, comparing the set of candidate triples with the set of fact triples, and outputting conflict confidence and consistency score. S140, determine whether the consistency score is lower than the preset threshold; If so, pop the historical state stack to roll back to the historical context snapshot corresponding to the top of the stack after popping, and perform physical clearing on the intermediate data of the erroneous branch associated with the popped stack context snapshot; generate negative feedback prompts based on the conflict items of the consistency comparison and inject them into the executor agent module to generate a new inference branch that is different from the candidate inference path, and return to execution S120. If not, confirm the pre-execution result, update the context state, output the result, and execute the next subtask.

2. The task execution method based on multi-agent cooperation as described in claim 1, characterized in that, The dynamic task pool includes at least an execution queue, a blocking queue, and a rollback retry queue; each subtask includes a task identifier, a set of dependent predecessors, a priority, a capability requirement vector, a failure count, and a set of context constraints; when the stack pop is triggered, the corresponding subtask is written into the rollback retry queue and its verification priority is increased.

3. The task execution method based on multi-agent cooperation as described in claim 1, characterized in that, The context snapshot includes a dialogue context summary, environment state, tool call state, set of verified inference prefix indices, key entity table, constraint set, and intermediate result reference index.

4. The task execution method based on multi-agent cooperation as described in claim 1, characterized in that, The historical state stack is a last-in-first-out stack structure; the push stack includes binding and storing the context snapshot with the inference node index; the pop stack includes deleting the inference node cache, uncommitted tool call candidate parameters, erroneous evidence reference index and erroneous hypothesis list associated with the popped context snapshot, so that the cleared data no longer participates in subsequent calculations.

5. The task execution method based on multi-agent cooperation as described in claim 1, characterized in that, When generating the pre-execution results, the system interacts with external tools or systems through an external interface module to obtain reversible simulation execution results, which include tool-returned summaries and parameter filling results.

6. The task execution method based on multi-agent cooperation as described in claim 1, characterized in that, The construction and retrieval of the domain knowledge base includes: performing structured segmentation and / or semantic segmentation on domain documents to form a set of text blocks; extracting keywords from the set of text blocks and constructing a keyword clustering tree index; during verification, using the key entities and entity relationships as query input, performing a top-down multi-hop retrieval in the keyword clustering tree, and locking the target text block through the folded tree path to form a chain of evidence.

7. The task execution method based on multi-agent cooperation as described in claim 1, characterized in that, The consistency comparison includes conflict detection and support detection: for each candidate triple, it is determined whether it is supported by the chain of evidence, whether it conflicts with the fact triple, and whether it violates the timing constraint or dependency constraint. The conflict confidence level is calculated based on the number of conflicts, the severity of the conflict type, and the credibility of the evidence source, and the consistency score is calculated accordingly.

8. The task execution method based on multi-agent cooperation as described in claim 1, characterized in that, The negative feedback prompts include: error type labels, a list of triples that trigger conflicts, a list of erroneous assumptions that cannot be reused, a list of constraints that must be met, and alternative reasoning strategy instructions, to guide the executor agent module to generate new reasoning branches while retaining the verified correct reasoning prefixes.

9. The task execution method based on multi-agent cooperation as described in claim 1, characterized in that, The executor intelligent agent module and the critic intelligent agent module adopt an asynchronous streaming interaction mode, and the executor intelligent agent module generates inference nodes in a streaming manner using a node stream. The critic agent module evaluates the generated inference nodes in real time; when a hard conflict is detected, the critic agent module sends an interrupt signal to the executor agent module to stop subsequent generation, and triggers a rollback request to the rollback and hint injection module to perform the stack pop and physical cleanup.

10. A task execution system based on multi-agent cooperation, characterized in that, include: The task parsing and task pool module is used to perform task semantic parsing and decomposition and generate subtask dependency structures that are stored in a dynamic task pool. The collaborative scheduling module is used to select subtasks to be executed from the dynamic task pool and schedule the planner agent module and the executor agent module. The history state stack module is used to store context snapshots and provide push and pop operations; The planner agent module is used to generate candidate reasoning paths; The executor agent module is used to generate pre-execution results based on candidate inference paths; The critic agent module is used to perform consistency audits on candidate reasoning paths based on fact triples, and does not output executable action instructions. The evidence retrieval and triple verification module is used to retrieve evidence chains from the domain knowledge base, extract fact triple sets, perform consistency comparisons, and output conflict confidence and consistency scores. The rollback and prompt injection module is used to trigger stack popping, physically clear intermediate data of erroneous branches, and inject negative feedback prompts when the consistency score is lower than a preset threshold. External interface module, used for interaction between the executor agent module and external tools or systems; Each module is configured to collaboratively execute the multi-agent collaborative task execution method as described in any one of claims 1 to 9.