Query method and system based on multi-agent cooperation
Patent Information
- Application Number
- CN202610854213.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-12
- Publication Date
- 2026-10-16
AI Technical Summary
[0003]然而,现有的这种模式存在以下的固有缺陷:首先,系统对用户请求的理解往往停留在表面层次,缺乏对其深层意图、所属复杂领域以及所需综合能力的精细解构,例如,现有方法通常仅依赖基础的语义分析技术进行意图分类,无法准确获得查询能力需求,易导致任务分解的精度不足,难以精确匹配计算单元的专长能力;其次,在组织多个计算单元工作时,现有方案通常只构建单一的执行链路,缺乏对执行过程与中间结果的即时、结构化核查机制,这样容易使错误在链路中传递和累积,影响最终结果的可靠性;同时,由于缺少独立的验证机制来监控关键路径节点和高风险能力节点,导致过程监控强度不足;更为关键的是,当来自不同专长计算单元的输出存在分歧或矛盾时,现有系统通常采用简单的投票、加权平均或选择置信度最高结果等刚性策略,缺乏对矛盾根源的分析和调和能力,从而限制处理复杂、开放域查询的综合效能
[0009]In summary, the query method and system based on multi-agent collaboration provided in this application generate intent classification and demand vectors by parsing query instructions, constructing a collaborative network including execution and verification sub-networks, and performing conflict identification and dynamic processing. This enables deep analysis of user intent and the construction of a collaborative mechanism with self-checking capabilities, thereby intelligently resolving internal cognitive conflicts and improving the accuracy and reliability of complex query processing results.
Smart Images

Figure CN122925469A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of natural language query, and in particular to a query method and system based on multi-agent collaboration. Background Technology
[0002] In the fields of artificial intelligence and information retrieval, leveraging multiple computing units with different specializations to collaboratively process complex user requests has become an important direction for improving the capabilities of systems. In existing technologies, common collaborative methods often focus on the simple decomposition and allocation of tasks, that is, a central module breaks down complex problems and distributes them to multiple computing units for parallel or serial execution, and finally collects and combines the returned results.
[0003] However, the existing model has the following inherent flaws: First, the system's understanding of user requests often remains superficial, lacking a fine-grained deconstruction of their deeper intent, the complex domain to which they belong, and the comprehensive capabilities required. For example, existing methods typically rely only on basic semantic analysis techniques for intent classification, failing to accurately obtain query capability requirements and leading to insufficient precision in task decomposition, making it difficult to precisely match the specialized capabilities of computing units. Second, when organizing multiple computing units, existing solutions typically construct only a single execution link, lacking an immediate, structured verification mechanism for the execution process and intermediate results. This makes it easy for errors to propagate and accumulate in the link, affecting the reliability of the final result. At the same time, the lack of an independent verification mechanism to monitor critical path nodes and high-risk capability nodes results in insufficient process monitoring. More importantly, when there are discrepancies or contradictions in the outputs from different specialized computing units, existing systems typically adopt rigid strategies such as simple voting, weighted averaging, or selecting the result with the highest confidence, lacking the ability to analyze and reconcile the root causes of contradictions, thus limiting the overall performance in handling complex, open-domain queries. Summary of the Invention
[0004] To address the aforementioned shortcomings, this application provides a query method and system based on multi-agent collaboration.
[0005] The above-mentioned objective of this application is achieved through the following technical solution: A query method based on multi-agent cooperation includes the following steps: In response to a query command, the query command is parsed using a pre-trained task generation model to generate parsing results and corresponding query tasks. The parsing results include query intent classification, query domain labels, and query capability requirement vectors. Based on the analysis results and query tasks, several first agents are selected from the preset agent pool, and a collaborative network is constructed, which includes an execution subnetwork and a verification subnetwork. Several query subtasks and verification subtasks are generated based on the query task. The query subtasks and verification subtasks are distributed to the first agent in the cooperative network. The intermediate results fed back by the execution subnetwork and the verification results fed back by the verification subnetwork are collected. Conflict identification is performed on intermediate results and verification results, dynamic processing instructions are generated based on the conflict identification results, and process trajectory information is recorded; The dynamic processing instructions and process trajectory information are input into the second intelligent agent. The second intelligent agent then performs the corresponding analysis and processing flow on the process trajectory information based on the dynamic processing instructions to generate query result information.
[0006] The second objective of this invention is achieved through the following technical solution: A query system based on multi-agent collaboration includes: The task parsing module is used to respond to query commands by parsing the query commands through a pre-trained task generation model, generating parsing results and corresponding query tasks. The parsing results include query intent classification, query domain labels, and query capability requirement vectors. The network construction module is used to select several first agents from a preset agent pool based on the parsing results and query tasks, and to construct a collaborative network, which includes an execution subnetwork and a verification subnetwork. The subtask generation module is used to generate several query subtasks and verification subtasks based on the query task, distribute the query subtasks and verification subtasks to the first agent in the cooperative network, and collect the intermediate results fed back by the execution subnetwork and the verification results fed back by the verification subnetwork. The conflict identification module is used to identify conflicts in intermediate results and verification results, generate dynamic processing instructions based on the conflict identification results, and record process trajectory information. The result generation module is used to input dynamic processing instructions and process trajectory information into the second intelligent agent. The second intelligent agent then performs the corresponding analysis and processing flow on the process trajectory information based on the dynamic processing instructions to generate query result information.
[0007] This application also relates to a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described multi-agent cooperative query method.
[0008] This application also relates to a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described multi-agent cooperative query method.
[0009] In summary, the query method and system based on multi-agent collaboration provided in this application generate intent classification and demand vectors by parsing query instructions, constructing a collaborative network including execution and verification sub-networks, and performing conflict identification and dynamic processing. This enables deep analysis of user intent and the construction of a collaborative mechanism with self-checking capabilities, thereby intelligently resolving internal cognitive conflicts and improving the accuracy and reliability of complex query processing results. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating the steps of an embodiment of a query method based on multi-agent collaboration according to this application; Figure 2 This is a general flowchart of an embodiment of a query method based on multi-agent collaboration in this application; Figure 3 This is a flowchart illustrating the conflict identification and processing in an embodiment of a multi-agent collaborative query method of this application. Detailed Implementation
[0011] The following will refer to the appendix to this application. Figures 1-3 The technical solutions in this application are clearly and completely described herein. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. The components of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0012] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0013] In the fields of artificial intelligence and information retrieval, existing technologies that use multi-agent collaboration to process complex user queries often limit their understanding of query instructions to a superficial level. They fail to accurately deconstruct the deeper intent of the query, its complex domain, and the required comprehensive capabilities, resulting in insufficient precision in task decomposition and difficulty in effectively matching the expertise of the agents. Furthermore, task generation modules often simply break down queries based on explicit keywords, lacking accurate understanding of query intent, query domain, and query capability requirements, which easily leads to a low degree of matching between task allocation and agent capabilities. Moreover, existing collaboration mechanisms typically only construct a single execution link, lacking real-time verification of the execution process and intermediate results, causing errors to propagate and accumulate in the link. In addition, when there are disagreements in the outputs from agents with different expertise, existing conflict resolution strategies may only use simple voting or confidence selection, failing to deeply analyze and reconcile the root causes of the conflict, thus affecting the overall efficiency of processing complex, open-domain queries.
[0014] For example, in intelligent consultation systems in the healthcare field, when a user inputs the query "How to manage the diet and exercise of patients with type 2 diabetes to prevent complications," existing task generation modules typically break the query down into two independent sub-tasks: "dietary recommendations" and "exercise recommendations," and distribute them to nutrition-specific agents and sports medicine-specific agents. However, because the task generation module fails to recognize the implicit individual differences in patient needs within the query, such as age and history of complications, the generated query tasks do not include query domain labels and query capability requirements, leading to a mismatch between task decomposition and agent expertise. Furthermore, there is a situation where the nutrition agent outputs high-fiber diet recommendations, while the sports medicine agent recommends high-intensity training programs. In this case, existing systems may only select the latter based on confidence scores, lacking consistency checks on the synergistic logic of diet and exercise. Consequently, their output may ignore the constraints of dietary adjustments on exercise effects, resulting in conflicting recommendations and reduced reliability.
[0015] If the above problems are not addressed, erroneous information will continue to be transmitted and amplified in the collaborative chain, significantly reducing the reliability of the final result; the rigid strategy for conflict handling will also limit the system's adaptability in contradictory situations and make it impossible to effectively integrate multi-source knowledge; in the long run, it will weaken the accuracy and intelligence level of multi-agent collaborative systems in complex query processing and hinder their application expansion.
[0016] In one embodiment, this application discloses a query method based on multi-agent collaboration, such as... Figure 1 As shown, the specific steps include the following: S10: In response to a query command, the query command is parsed using a pre-trained task generation model to generate parsing results and corresponding query tasks. The parsing results include query intent classification, query domain labels, and query capability requirement vectors. In this embodiment, a query instruction refers to a request or question issued by the user to the query system. In this embodiment, query instructions typically correspond to complex, multi-agent collaborative query tasks, thus requiring a multi-agent collaborative approach to answer them. The pre-trained task generation model refers to an artificial intelligence model that has been trained on a large amount of data and is capable of understanding and parsing user queries and generating task representations. The parsing result refers to the structured information output by the task generation model after analyzing the query instruction. The parsing result includes query intent classification, query domain labels, and query capability requirement vectors. Query intent classification refers to the categorization of the user's query purpose, such as finding information, performing operations, comparing data, etc. Query domain labels refer to the professional field or knowledge category to which the query belongs, such as finance, medicine, history, etc. Query capability requirement vectors refer to vectors that quantify the atomic capabilities required to complete the query task and their strength or importance. The query task refers to the specific task description that can be executed by the agent after parsing and structuring.
[0017] Specifically, in one implementation, the task generation model can parse query commands based on keyword matching or rule matching. For example, multiple keywords and rules can be preset. When a query command contains specific keywords, it is categorized into the corresponding query intent and domain, and a query task and capability requirement vector are generated according to a preset template. In another implementation, the task generation model can use a method based on shallow semantic analysis, such as extracting the main words in the query command through statistical methods such as bag-of-words model or TF-IDF, and comparing them with preset intents, domains, and capability libraries to generate parsing results.
[0018] S20: Based on the parsing results and the query task, select several first agents from the preset agent pool and construct a collaborative network, which includes an execution subnetwork and a verification subnetwork. In this embodiment, the agent pool refers to a pre-configured and stored set of agents with different capabilities and expertise; the first agent refers to an agent selected from the agent pool to perform query subtasks and verification subtasks; the cooperative network refers to a network structure composed of the first agents for coordinating the execution and verification of query tasks, wherein the cooperative network includes an execution subnetwork and a verification subnetwork; the execution subnetwork refers to the agents in the cooperative network responsible for actually executing the query subtasks and their connection relationships; the verification subnetwork refers to the agents in the cooperative network responsible for verifying and monitoring the intermediate results generated by the execution subnetwork and their connection relationships.
[0019] Specifically, several first agents can be randomly selected from the agent pool, or filtered according to the agents' general ability tags. The selected agents are then organized into a cooperative network, with some agents designated as execution roles and others as verification roles. As an alternative implementation, agents in the agent pool can also be pre-labeled as execution agents or verification agents, and the required number of agents can be selected from their respective categories to build a cooperative network based on the type of query task. Furthermore, agents can also be filtered based on a single ability metric, such as the ability to process specific data types, selecting agents with ability values higher than a threshold and building a cooperative network.
[0020] S30: Generate several query subtasks and verification subtasks based on the query task, distribute the query subtasks and verification subtasks to the first agent in the cooperative network, and collect the intermediate results fed back by the execution subnetwork and the verification results fed back by the verification subnetwork. In this embodiment, the query subtask refers to the execution unit task obtained after decomposing the query task; the verification subtask refers to the execution unit task that verifies and evaluates the query subtask or its result; the intermediate result refers to the stage output generated by the first agent in the execution sub-network during the completion of the query subtask; and the verification result refers to the evaluation information generated by the first agent in the verification sub-network after verifying the intermediate result.
[0021] Specifically, as one implementation method, multiple task decomposition templates can be preset, and the query task can be decomposed into query subtasks and verification subtasks according to the type of query task, and distributed to the corresponding intelligent agents according to preset rules. Result collection can be achieved through message queues. In addition, query subtasks and verification subtasks can also be matched and distributed to the first intelligent agent in the cooperative network that claims to have the corresponding capabilities according to their type or required capabilities, and result collection can be achieved through polling or callback mechanisms.
[0022] S40: Perform conflict identification on intermediate results and verification results, generate dynamic processing instructions based on the conflict identification results, and record process trajectory information; In this embodiment, conflict identification refers to the process of detecting and analyzing contradictions, inconsistencies, or low confidence situations between intermediate results and verification results; dynamic processing instructions refer to instructions generated based on conflict identification results, used to drive the second intelligent agent to process conflicts or integrate results; process trajectory information refers to detailed logs recording key steps, data, and decisions throughout the entire query processing process.
[0023] Specifically, conflict identification can be achieved through string comparison or numerical range comparison. If the intermediate result is inconsistent with the verification result, it is marked as a conflict. The dynamic processing instruction can be a retry instruction. As an implementation method, a confidence threshold can be set. If the confidence of the verification result is lower than the confidence threshold, a conflict is considered to exist. The dynamic processing instruction can generate a preset corresponding instruction based on the conflict classification, such as data inconsistency, logical error, etc. The process trajectory information can record the output of each agent.
[0024] S50: Input the dynamic processing instructions and process trajectory information into the second intelligent agent. The second intelligent agent then performs the corresponding analysis and processing flow on the process trajectory information based on the dynamic processing instructions to generate query result information.
[0025] In this embodiment, the second intelligent agent refers to the intelligent agent used to receive dynamic processing instructions and process trajectory information, and execute the final analysis and processing flow to generate query result information; the analysis and processing flow refers to the specific algorithm or logic selected and executed by the second intelligent agent according to the dynamic processing instructions, used to resolve conflicts or integrate results; the query result information refers to the processed and integrated query answer finally presented to the user.
[0026] Specifically, the second intelligent agent can have built-in fixed processing logic, such as selecting the intermediate result with the highest confidence as the final result; as an implementation method, the second intelligent agent can switch between different preset processing flows according to the identifier in the dynamic processing instruction, such as mode A or mode B, for example, mode A is majority voting, mode B is selecting the first valid result, etc.
[0027] For example, user A submits a query to the query system: "Help me analyze the impact of recent global climate change on agricultural production in a certain region and predict the trend for the next five years." First, in response to user A's query, the pre-trained task generation model parses the query and identifies the query intent as trend analysis and prediction, with the query domain tags being climate science, agricultural economics, and geographic information systems. Simultaneously, the task generation model generates a query capability requirement vector, which quantifies the required capabilities, such as data collection, time series analysis, geospatial analysis, economic model construction, and predictive algorithm application. Based on the above parsing results, a detailed query task is constructed, clarifying the analysis objectives, data scope, and output requirements.
[0028] Furthermore, based on the analysis results, the first agent in the agent pool is screened. For example, a climate-specific agent that is good at climate data analysis, an agriculture-specific agent that is good at agricultural economic modeling, a geography-specific agent that is good at geographic information processing, and a verification-specific agent that has data verification and logical reasoning capabilities are selected. Based on the screening results, a collaborative network is constructed. The climate-specific agent, agriculture-specific agent, and geography-specific agent are assigned to the execution subnetwork to be responsible for specific data processing and analysis, and the verification-specific agent is assigned to the verification subnetwork to be responsible for monitoring the execution process and verifying intermediate results.
[0029] Furthermore, the query task is broken down into multiple query subtasks, such as "collecting climate data for a certain region over the past thirty years," "analyzing the correlation between climate data and agricultural output," "constructing an agricultural production prediction model," and "generating a report on agricultural production trends for the next five years." Simultaneously, for the key aspects of the above query subtasks, corresponding verification subtasks are generated, such as "verifying the completeness of climate data," "verifying the statistical significance of the correlation analysis," and "evaluating the accuracy of the prediction model." The query subtasks are distributed to the corresponding agents in the execution sub-network, and the verification subtasks are distributed to the corresponding agents in the verification sub-network. During execution, the climate-specific agent provides intermediate results on the "average temperature change trend of a certain region over the past thirty years," which are then verified by the verification-specific agent, which provides the corresponding verification results. Similarly, the agriculture-specific agent provides intermediate results on the "model of the impact of climate change on wheat yield," which are then verified by the verification-specific agent, which provides the corresponding verification results.
[0030] Furthermore, after collecting all intermediate and validation results, the validation results of the "Climate Change Impact Model on Wheat Yield" of the agricultural-specific intelligent agent were found to show that "the model parameter selection is controversial, the fit with historical data is average, and the confidence level is moderate." This validation result will be identified as a potential logical consistency conflict or a low-confidence conflict. Based on this conflict identification result, the severity of the conflict will be assessed, and dynamic processing instructions will be generated. These dynamic processing instructions may include conflict identifiers, conflict levels, involved agent IDs, relevant intermediate result indexes, and preset processing mode identifiers. At the same time, the trajectory information of the entire process will be recorded, including query instructions, parsing results, subtask distribution, intermediate results and their versions, validation results, conflict analysis reports, and dynamic processing instructions.
[0031] Finally, the dynamic processing instructions and process trajectory information are input into the second intelligent agent. The second intelligent agent activates the corresponding analysis and processing flow according to the dynamic processing instructions. For example, the second intelligent agent analyzes the process trajectory information to identify the contextual information that leads to disputes in the agricultural-specific intelligent agent model. For example, there may be multiple agricultural economic models or different climate scenario assumptions. The second intelligent agent constructs the argumentation model of the conflicting parties, analyzes the advantages and disadvantages of different models or assumptions, and generates multiple explanatory frameworks based on the argumentation model, such as "agricultural impact prediction based on conservative climate scenario" and "agricultural impact prediction based on radical climate scenario". Furthermore, the second intelligent agent calculates the comprehensive score of the generated explanatory frameworks, and finally selects the explanatory framework with the best comprehensive score and generates query results information based on it to present to user A. The query results information not only includes the prediction data, but may also include explanations of different scenario assumptions and reasons for model selection.
[0032] Based on the above technical solutions and examples, in the query instruction parsing stage, the solution of this application parses the query instruction through a pre-trained task generation model, generating parsing results including query intent classification, query domain labels, and query capability requirement vectors. This is significantly different from existing technologies that only rely on surface keyword matching or simple rule parsing. For example, when user A queries "the impact of global climate change on agricultural production in a certain region," the solution of this application can identify the intent of trend analysis and prediction and multiple fields such as climate science and agricultural economics, and quantify the required atomic capabilities such as data collection and model building. This makes the subsequent task decomposition and agent selection more targeted, and can effectively solve the problems of insufficient task decomposition accuracy and difficulty in adapting to agent expertise in existing technologies.
[0033] Secondly, the introduction of a collaborative network comprising an execution subnetwork and a verification subnetwork provides an immediate and structured verification mechanism for the execution process and intermediate results, thereby improving the reliability of the results. In the example above, the verification-specific agent verifies the intermediate results generated by the climate-specific agent and the agriculture-specific agent in real time and provides feedback on confidence information. This contrasts with the existing technology, which lacks immediate verification and where errors may propagate and accumulate in a single execution link. By involving the verification subnetwork, potential problems can be identified and flagged early, preventing the propagation of erroneous results.
[0034] Furthermore, when the intermediate results of the agricultural-specific intelligent agent are marked as having moderate confidence by the verification-specific intelligent agent, conflict identification is performed and dynamic processing instructions are generated. Subsequently, the second intelligent agent analyzes the conflict context based on process trajectory information, constructs an argumentation model, and generates multiple interpretation frameworks for evaluation. This is significantly different from the rigid strategies in existing technologies, such as simply using voting, weighted averaging, or selecting the result with the highest confidence. This application, through the analysis and reconciliation of the root causes of conflicts, can generate better solutions that transcend the limitations of individual intelligent agents. In the above example, the second intelligent agent can generate predictive data by integrating different scenario assumptions, rather than simply adopting or rejecting the output of a certain intelligent agent. This effectively solves the problems in existing technologies, such as the difficulty in generating better solutions in conflict and the limitation of the comprehensive performance in processing complex open-domain queries.
[0035] In summary, this application achieves deep analysis of user intent and constructs a collaborative mechanism with self-checking capabilities by parsing query instructions to generate intent classification and demand vectors, constructing a collaborative network including execution and verification sub-networks, and performing conflict identification and dynamic processing. This intelligently resolves internal cognitive conflicts and improves the accuracy and reliability of complex query processing.
[0036] In one embodiment, the task generation model includes a semantic understanding layer, a task parsing layer, a capability mapping layer, and a task generation layer. Step S10 includes: S11: The semantic understanding layer performs semantic analysis on the query command and generates a preliminary semantic representation, which includes core entities, actions, and relationships; In this embodiment, the task generation model is a computational model used to transform user query instructions into structured task representations. The task generation model can be implemented in various ways. For example, it can be a large-scale language model based on deep learning, which understands natural language and generates structured outputs through pre-training and fine-tuning; or it can be a hybrid system, combining rule-based expert systems with machine learning components to handle queries of varying complexity. The semantic understanding layer is the processing module layer in the task generation model, whose role is to extract deep semantic information from the original query instructions. The semantic understanding layer can utilize natural language processing techniques, such as named entity recognition, part-of-speech tagging, and dependency parsing, to identify key information in the query; or it can use a pre-trained model based on the Transformer architecture, such as BERT or the GPT series, to capture the semantics of words and phrases through contextual embedding. The preliminary semantic representation refers to the intermediate structured data output by the semantic understanding layer. According to the summary, the core meaning of the query instruction can be: The initial semantic representation can be a semantic framework containing slots for filling the identified core entities, actions, and their relationships; or it can be a graph structure where nodes represent entities and actions, and edges represent semantic relationships between nodes. Core entities refer to the main objects, topics, or concepts mentioned in the query instruction, which can be identified by matching with a domain knowledge base or ontology; or they can be directly extracted from the text using a pre-trained entity extraction model. Actions refer to the user's intent or described behavior expressed in the query instruction, which can be determined using techniques such as verb phrase recognition and semantic role labeling; or they can be achieved by mapping verbs in the query to a predefined set of operations. Relationships refer to the logical connections between core entities and actions, or between different core entities, which can be identified using relationship extraction algorithms, such as pattern matching or machine learning classifiers; or they can be inferred through dependency parsing.
[0037] S12: The task parsing layer generates a task graph based on the preliminary semantic representation, which includes several sub-task nodes and sub-task dependencies. It also feeds back the task objectives and constraint information identified in the process to the semantic understanding layer to obtain query intent classification and query domain labels. In this embodiment, the task parsing layer is the processing module layer in the task generation model, used to further refine the initial semantic representation into an executable task structure. The task parsing layer can employ a planning algorithm to transform the initial semantic representation into a task graph based on a predefined task template or domain knowledge; or it can be based on a state machine or a hierarchical task network planner to decompose the overall query objective into a series of sub-objectives and operations. The task graph is a graphical representation formed after the query instruction is decomposed, clearly showing each sub-task and its interdependencies. The task graph can be a directed acyclic graph, where each node represents a sub-task and edges represent the execution order or data flow dependencies between sub-tasks; or it can be a complex graph structure that allows for the representation of conditional branches or parallel execution paths. Sub-task nodes are the basic building blocks in the task graph, representing the smallest executable task after the query instruction is decomposed. Each subtask node can encapsulate a specific data retrieval operation, computation process, or external service call; or it can represent a specific skill or function that the agent needs to perform. Subtask dependencies define the execution order and conditions between subtasks, which can include sequential dependencies (one task can only start another after the first task is completed), data dependencies (the output of one task is the input of another), or resource dependencies; or they can involve time constraints or logical preconditions. The task objective refers to the final result or state that the user expects to achieve in the query, which can be explicitly extracted from the query instruction; or it can be inferred from the preliminary semantic representation by reasoning about the user's intent. Constraint information refers to any restrictions, conditions, or preferences contained in the query instruction, which can include time range, geographical location, or quality requirements; or it can be resource restrictions or security policies.
[0038] S13: The capability mapping layer maps each subtask node in the task graph to the atomic capability unit required by the corresponding subtask, and integrates and quantizes them to generate a query capability requirement vector. In this embodiment, the capability mapping layer is a processing module layer in the task generation model, used to transform abstract subtasks in the task graph into atomic capability units that can be executed by the agent. The capability mapping layer can maintain a capability knowledge base, mapping different types of subtasks to available atomic capability units; or, it can utilize a machine learning model to predict the required atomic capabilities based on the characteristics of the subtasks. An atomic capability unit refers to the most basic functional module that the agent can execute. An atomic capability unit can be a specific API call, database query, computation function, or data processing operation; or, it can represent specific professional knowledge or skills possessed by the agent. The query capability requirement vector is a quantitative representation of all atomic capabilities required to complete the entire query task. It can be a multi-dimensional vector, with each dimension corresponding to an atomic capability, and its value representing the degree of requirement or importance of that atomic capability; or, it can be a binary vector indicating the set of required capabilities.
[0039] S14: The task generation layer generates query tasks based on the task graph and the query capability requirement vector.
[0040] In this embodiment, the task generation layer is the processing module layer in the task generation model, which is used to integrate all parsed and mapped information into a complete query task. The task generation layer can generate structured task objects based on the task graph, query capability requirement vector and other metadata; or, it can also generate formal plans or scripts that can be directly executed by the multi-agent system.
[0041] Specifically, the semantic understanding layer first performs semantic analysis on the query command, extracts core elements, and generates a preliminary semantic representation; the task parsing layer builds a task graph based on this and provides feedback to the semantic understanding layer to ensure the accuracy of query intent classification and query domain labels; the capability mapping layer transforms the subtasks in the task graph into specific atomic capability requirements and quantifies them into query capability requirement vectors; finally, the task generation layer integrates all the information output by the aforementioned module layers to generate a structured query task.
[0042] Through the above technical solutions, the task generation model can perform multi-level parsing of query instructions, ensuring the accuracy and comprehensiveness of query intent classification, query domain labels, and query capability requirement vectors, thereby improving the efficiency of the entire multi-agent collaborative query method and the accuracy and relevance of query results.
[0043] In one embodiment, step S20 includes: S21: Calculate the capability matching degree of each first agent in the agent pool based on the query capability requirement vector, and evaluate the scenario adaptability of each first agent in the agent pool based on the query intent classification and query domain label. In this embodiment, the query capability requirement vector refers to the quantitative representation of each atomic capability unit required for the query task. For example, the query capability requirement vector can be a multi-dimensional vector, where each dimension represents a specific atomic capability, and its value indicates the strength or importance of that capability. Capability matching degree refers to the quantitative index of the degree of conformity between the capabilities possessed by each first agent in the agent pool and the query capability requirement vector. The capability matching degree can be calculated in various ways. For example, cosine similarity can be used to measure the similarity between the agent capability vector and the query capability requirement vector. Alternatively, it can be obtained by calculating the overlap and importance weighted sum of the capability units covered by the agent and the required capability units based on a predefined capability ontology. Scene adaptability evaluation refers to evaluating the applicability of each first agent in the agent pool under a specific query intent classification and query domain label. Scene adaptability evaluation can be implemented in various ways. For example, it can be based on a preset rule base to match the agent's professional domain, proficient task type with the query intent classification and query domain label. Alternatively, it can use a machine learning model to predict its adaptability by learning the performance of the agent in different scenarios in historical task data.
[0044] S22: Based on the capability matching degree calculation results and the scenario adaptability evaluation results, several candidate agents are selected to form a candidate agent set; In this embodiment, the candidate agent set refers to a group of agents that meet the basic capability and scenario requirements, which are initially selected based on the capability matching degree calculation results and the scenario adaptability evaluation results. The candidate agent set can be obtained by setting a threshold, for example, only agents with capability matching degree higher than a certain preset value and scenario adaptability reaching a certain level are selected; or, a weighted summation method can be used to comprehensively score capability matching degree and scenario adaptability, and select agents with higher scores.
[0045] S23: Retrieve historical collaboration records of candidate agents, calculate collaboration performance scores based on historical collaboration records, and select several preferred agents based on collaboration performance scores to form a preferred agent set; In this embodiment, historical collaboration records refer to stored performance data of intelligent agents in past collaborative tasks. These records may include task completion rate, task time, error rate, frequency of interaction with other intelligent agents, conflict resolution status, and user satisfaction. Their purpose is to provide behavioral evidence of the intelligent agent in a real-world collaborative environment, providing an objective basis for evaluating its collaborative capabilities. Collaborative performance score refers to an indicator that quantitatively evaluates the performance of candidate intelligent agents in collaborative work based on historical collaboration records. The collaborative performance score can be calculated in various ways, such as by statistically analyzing the agent's average success rate and average efficiency in past collaborative tasks; or, based on... Graph neural networks analyze the centrality, influence, and collaborative tightness of agents in a collaborative network; they can also analyze historical conflict resolution through expert systems to assess agents' collaborative tendencies; the optimal agent set refers to the set of agents selected from the candidate agent set after further considering their historical collaborative performance, which are the most suitable agents for executing the current query task and can work efficiently together. The optimal agent set can be formed by setting a minimum threshold for collaborative performance scores, retaining only agents with scores higher than the threshold; or by combining capability matching degree, scenario adaptability, and collaborative performance scores for multi-dimensional ranking, selecting the agents with the highest comprehensive scores.
[0046] S24: Based on the analysis results and the query task, assign roles to the first agent in the preferred agent set and construct a cooperative network.
[0047] In this embodiment, assigning roles refers to assigning specific responsibilities and functions to the first agent in the preferred set of agents in the collaborative network. For example, based on the agent's expertise and task requirements, it can be assigned roles such as execution agent, verification agent, coordination agent, or data provider agent. Its purpose is to clarify the agent's position in the collaborative network and optimize the task process. Building the collaborative network refers to establishing communication and collaboration relationships between agents based on the structure of the query task and the role assignment of agents. Its purpose is to provide a structured framework for collaborative work between agents.
[0048] Specifically, the atomic capabilities of each first agent in the agent pool are matched based on the query capability requirement vector. Simultaneously, the suitability of the agents in specific scenarios is evaluated by combining query intent classification and query domain labels, thus initially screening agents with basic task execution capabilities. To further improve collaboration efficiency and task success rate, the historical collaboration records of the initially screened candidate agents are retrieved and analyzed to calculate the collaboration effectiveness score for each agent. This score reflects the agent's performance in past collaborative tasks, such as its collaboration efficiency, conflict resolution ability, and synergy with other agents. Based on the collaboration effectiveness score, preferred agents with strong problem-solving abilities and excellent performance in actual collaborative environments are selected. Finally, based on the analysis results and the characteristics of the query task, specific roles are assigned to the preferred agents, and a collaborative network is constructed.
[0049] By introducing the above technical solution, the analysis of the agent's historical collaboration records and the calculation of collaboration performance scores are introduced, thereby achieving an accurate evaluation of the agent's performance in the actual collaborative environment. This ensures that the first agent selected in the end not only possesses the professional capabilities and domain knowledge required to complete the task, but also has proven good performance in collaborative work. Therefore, the constructed collaborative network can operate more efficiently, thereby reducing the risk of conflict and rework rate in the task execution process, and improving the overall execution efficiency of complex query tasks and the accuracy and reliability of the final query results.
[0050] In one embodiment, step S24 includes: S241: Identify the first dependency and the second dependency of the query task. The first dependency includes the logical combination relationship between the atomic capabilities required by the query task and the execution order dependency. The second dependency includes the intensity requirement relationship between result verification and process monitoring. In this embodiment, the first dependency relationship clarifies how the minimum functional units required to complete the query task cooperate with each other and in what order they are executed. It can be achieved by performing semantic analysis on the text description of the query task using natural language processing technology, extracting verbs, nouns and their modifiers contained in the task, and identifying atomic capability units and their logical relationships and execution order by combining a predefined task pattern library. The logical combination relationship can be represented by Boolean logic such as AND, OR, XOR, etc. The execution order dependency can be represented as "execute A first and then execute B", or "A and B can be executed in parallel", or it can be represented by a directed acyclic graph, where nodes represent atomic capabilities and edges represent execution order or data flow dependencies. The second dependency relationship clarifies the key verification links and their monitoring level during task execution to ensure the accuracy of the results and the reliability of the process. The intensity requirement relationship can be quantified according to factors such as the criticality of the task, risk level, and historical error rate. For example, for critical steps involving finance or security, the verification and monitoring intensity requirements may be higher. It can also be represented by defining different monitoring levels and verification depths.
[0051] S242: Construct a cooperative execution framework based on the first dependency relationship, where nodes represent atomic capabilities. Based on the capability matching degree, the first agent in the preferred agent set is mapped to the corresponding node of the cooperative execution framework to form an initial execution sub-network. In this embodiment, the collaborative execution framework refers to the blueprint for task execution. It decomposes complex query tasks into manageable atomic capability units and clarifies the structural relationships between these atomic capability units. Specifically, the first dependency relationship can be directly transformed into a directed graph, where each node represents an atomic capability and edges represent dependencies, forming a task flowchart. Alternatively, a Petri net or state machine-based model can be constructed to more accurately describe the concurrency, synchronization, and selection relationships between atomic capabilities. Based on the capability matching degree of the agents, the first agent in the preferred agent set is mapped to the corresponding atomic capability node of the collaborative execution framework, thereby forming an initial execution sub-network. This associates the abstract task framework with specific executors, forming an operable execution plan. For each atomic capability node, the agent with the highest capability matching degree is selected from the preferred agent set for allocation based on its required capability type and level. Alternatively, a multi-objective optimization algorithm can be used to allocate agents while considering capability matching degree, as well as factors such as agent load balancing and historical performance.
[0052] S243: Based on the second dependency relationship, configure verification anchor points for critical path nodes, high-risk capability nodes and convergence nodes in the collaborative execution framework, and assign at least one verification agent to each verification anchor point based on the remaining first agents to form a verification sub-network. In this embodiment, to ensure the reliability of task execution, verification anchors are configured at critical path nodes, high-risk capability nodes, and convergence nodes in the collaborative execution framework based on the second dependency relationship. Verification anchors are key points that require focused attention and verification during task execution, aiming to pre-set verification mechanisms for critical stages and potential risk points in task execution to improve the reliability of task execution. Furthermore, critical path nodes can be identified using graph algorithms, high-risk capability nodes can be marked based on historical data or expert experience, and convergence nodes are where the results of multiple subtasks are merged, which is prone to introducing errors. A verification anchor can be a logical marker indicating completion at the corresponding node. The process needs to be triggered at certain times, or it can be a data interface used to receive data from the verification sub-network. From the remaining first agents, at least one verification agent is assigned to each verification anchor point to build an independent verification sub-network. The aim is to establish an independent verification mechanism to ensure the correctness and reliability of task execution. The assignment of verification agents can be based on their verification capabilities, domain knowledge, and independence from the verified node. For example, agents with different knowledge backgrounds or algorithm models than the executing agent can be selected for verification. Alternatively, a redundant verification strategy can be adopted, assigning multiple verification agents to the same verification anchor point and improving the confidence of the verification results through cross-validation.
[0053] S244: Based on the initial execution subnetwork calculation and optimization of the direct communication overhead and potential conflict risks between its nodes, and while maintaining the first dependency relationship, add or delete cooperative edges between nodes, and simultaneously adjust the monitoring scope of the verification subnetwork to form a cooperative network.
[0054] In this embodiment, after the initial network is constructed, the initial execution subnetwork is further optimized. This involves calculating and analyzing the direct communication overhead and potential conflict risks between nodes, and dynamically adding or removing cooperative edges between nodes while maintaining the first dependency relationship. For example, if frequent and costly communication is found between two agents, direct cooperative edges may be added; if high conflict risks are found in certain cooperative paths, cooperative edges may be adjusted or a coordination mechanism may be introduced. Communication overhead can be evaluated by calculating factors such as geographical distance between agents, network latency, and data transmission volume. Potential conflict risks can be predicted by analyzing task dependencies, resource competition, and historical conflict records between agents. Optimization can be achieved by adjusting cooperative paths between agents, data transmission protocols, or introducing communication proxy agents. Simultaneously, the monitoring scope of the verification subnetwork is also adjusted to ensure that the optimized execution subnetwork is still verified and monitored. This means that when the structure of the execution subnetwork changes, the verification subnetwork also needs to adjust the position of its verification anchor points, the allocation of verification agents, or the depth of verification accordingly to ensure the effectiveness of the verification mechanism.
[0055] Specifically, this application further explores the inherent structure and risk characteristics of query tasks when constructing a multi-agent collaborative network. By identifying the first dependency of the query task, the logical framework and execution order of the task are clarified, enabling the collaboration between agents to follow the inherent logic of the task, thereby avoiding inefficiency and error accumulation caused by blind parallelism or disordered order. At the same time, by identifying the second dependency, verification anchor points are configured in a targeted manner at critical path nodes, high-risk capability nodes, and convergence nodes, and dedicated verification agents are assigned to construct a verification sub-network that is parallel to and independent of the execution process. This enhances the transparency and credibility of the task execution process, ensuring effective monitoring and verification at each key stage of task execution. In addition, the communication overhead and potential conflict risks of the initial execution sub-network are calculated and optimized, and the collaborative edges are dynamically adjusted while maintaining the first dependency of the task, and the monitoring scope of the verification sub-network is adjusted synchronously. This makes the constructed collaborative network not only logically rigorous but also more efficient in actual operation.
[0056] Through the above technical solutions, the solution of this application can not only effectively reduce redundant communication between agents and reduce potential cooperation conflicts, but also ensure that the verification mechanism is always synchronized with the latest state of the execution network, thereby improving the efficiency, accuracy and reliability of multi-agent collaborative processing of complex query tasks.
[0057] In one embodiment, step S30 includes: S31: Based on the first dependency and the second dependency, the query task is decomposed into several atomic query subtasks; In this embodiment, the query task is decomposed into several atomic query subtasks. This aims to break down the complex query task into basic units that are easier to manage and execute. The decomposition process considers the internal logical structure of the task and the verification and monitoring requirements, ensuring that the decomposed subtasks can be executed independently while maintaining the integrity and traceability of the overall task. The decomposition of atomic query subtasks can be carried out using a rule-based decomposition method, that is, predefining multiple task decomposition rules and generating atomic query subtasks based on the type and complexity of the query task, combined with the first dependency and the second dependency. Alternatively, a machine learning-based model can be used to train a task decomposition model by learning from a large number of historical task decomposition cases. This model can output the optimal set of atomic query subtasks and their interrelationships based on the input query task, the first dependency, and the second dependency.
[0058] Furthermore, the atomic query subtasks obtained from the decomposition typically have at least one of the following relationships: sequential relationship, parallel relationship, or conditional dependency relationship.
[0059] S32: Generate corresponding matching verification subtasks based on the task attributes, criticality, and historical error probability of each atomic query subtask; In this embodiment, corresponding matching verification subtasks are generated, aiming to equip each atomic query subtask with a customized verification mechanism to improve the targeting and efficiency of verification. By comprehensively considering the inherent characteristics of the task, its importance to the overall result, and the reliability of past executions, and allocating verification resources accordingly, over-verification or under-verification can be avoided as much as possible. For example, a verification strategy library can be established, which contains a variety of predefined verification subtask templates. Each template corresponds to different task attributes, criticality levels, and historical error probability ranges. After generating atomic query subtasks, the most matching template is searched in the verification strategy library based on its characteristics and instantiated as a specific verification subtask. At the same time, its triggering conditions, verification depth, and required resource level are defined. Alternatively, a reinforcement learning-based method can be used to allow the verification agent to learn how to dynamically adjust the parameters of the verification subtasks based on the real-time status and historical performance of the atomic query subtasks through simulation and actual operation.
[0060] Furthermore, the triggering conditions for verifying subtasks include when the subtask is completed or when a specific intermediate state occurs; the verification depth includes checking only the output format, performing logical reasoning, cross-validation, etc.; and the required resource level includes computing resources and data source access permissions.
[0061] S33: Establish a shared intermediate state storage area between the execution subnetwork and the verification subnetwork to store in real time the intermediate results generated by the first agent in the execution subnetwork and the verification results generated by the first agent in the verification subnetwork.
[0062] In this embodiment, a shared intermediate state storage area is established to provide a unified and real-time information exchange platform, ensuring data synchronization and visibility between the execution sub-network and the verification sub-network. Centralized management of intermediate and verification results facilitates subsequent conflict identification and dynamic intervention, while ensuring data consistency and traceability. This storage area can be implemented as a highly available, low-latency in-memory database using a distributed key-value storage system. Each intermediate and verification result is accompanied by a unique task ID and timestamp as metadata for easy retrieval and association. Alternatively, it can be built based on a message queue system, where the first agent in the execution sub-network publishes intermediate results as messages to specific topics, and the first agent in the verification sub-network subscribes to relevant topics to obtain intermediate results and publish verification results.
[0063] Furthermore, a dynamic monitoring and intervention mechanism can be established, enabling the first agent in the verification sub-network to monitor the execution process of its associated atomic query sub-tasks according to the definition of the verification sub-task, and generate intervention instructions in real time based on the verification results of intermediate results. These intervention instructions are used to trigger the re-execution, parameter adjustment, or execution path change of the associated atomic query sub-tasks. At the same time, all intermediate results, verification results, and intervention instruction records stored in the intermediate state storage area are collected and integrated to form a structured result set for subsequent conflict identification.
[0064] By monitoring and intervening in the verification subnetwork in real time, errors or deviations in the execution subnetwork can be detected and corrected promptly, preventing the accumulation of problems and improving the accuracy and efficiency of queries. This can be achieved through an event-driven architecture. Specifically, when the first agent in the verification subnetwork detects that the intermediate result does not meet expectations, it triggers a predefined intervention event. This intervention event is associated with corresponding intervention instructions, such as re-execution instructions or parameter adjustment instructions. These instructions are received by a pre-defined central coordinator and forwarded to the first agent in the corresponding execution subnetwork, enabling it to perform the corresponding corrective operation. Alternatively, a decision engine can be integrated into the first agent in the verification subnetwork. This decision engine determines the corrective action based on the definition of the verification subtask and the real-time verification results. The results can be analyzed using expert rule systems or pre-trained decision models to determine whether intervention is needed and what intervention measures to take. By structuring and integrating all relevant execution and verification data as well as intervention history, it can be ensured that subsequent conflict identification can accurately judge and handle potential conflicts based on sufficient information. Data warehouse technology can be used to periodically or in real-time extract, transform, and load real-time data from intermediate state storage areas into structured data tables. These data tables will be organized according to dimensions such as task ID, timestamp, and agent ID for easy querying and analysis. Alternatively, a graph database can be used to store the data, modeling atomic query subtasks, intermediate results, verification results, intervention instructions, and their relationships as nodes and edges in a graph.
[0065] Specifically, complex query tasks are decomposed based on first and second dependencies to generate several atomic query subtasks. This decomposition process considers not only the logical structure of the task itself but also incorporates the needs for verification and monitoring, thereby ensuring the effectiveness of subsequent verification. Furthermore, for each atomic query subtask, a corresponding verification subtask is generated and matched based on its task attributes, its criticality to the overall task, and its historical error probability. During the generation process, the triggering conditions, verification depth, and required resource levels of the verification subtask are defined, thereby achieving optimized configuration of verification resources and control of the verification process. During task execution, the intermediate results generated by the first agent in the execution sub-network and the verification results generated by the first agent in the verification sub-network are stored in real time in a shared intermediate state storage area, ensuring data transparency and synchronization during the execution and verification processes.
[0066] Furthermore, the first agent in the verification subnetwork can continuously monitor the execution progress of its associated atomic query subtasks. Once the verification results show that there is a deviation or error in the intermediate results, the first agent in the verification subnetwork will immediately generate an intervention command to trigger the re-execution of the atomic query subtask, parameter adjustment, or change of execution path, thereby correcting the problem in its early stages, avoiding error accumulation, and improving the query process and accuracy. Finally, all intermediate results, verification results, and intervention command records in the shared intermediate state storage area will be collected and integrated to form a structured result set.
[0067] Through the above technical solutions, this application improves the accuracy of task decomposition and the pertinence of verification strategies, avoiding problems that may be caused by rough task decomposition while ensuring the effective use of verification resources. Among them, the shared intermediate state storage area enables the execution sub-network and the verification sub-network to exchange intermediate results and verification results in real time and transparently, improving the visibility of the execution status and data consistency. The introduction of dynamic monitoring and intervention mechanisms enables the generation and execution of intervention instructions based on the verification results during the execution of atomic query subtasks, such as re-execution, parameter adjustment or execution path change, reducing the risk of error propagation and thus improving the accuracy of query results.
[0068] In one embodiment, step S40 includes: S41: Conflict identification is performed on intermediate results and verification results. The conflict identification includes factual conflict detection, logical consistency verification, and confidence weighted evaluation. In this embodiment, conflict identification refers to the process of analyzing intermediate results and verification results generated during multi-agent collaboration to discover inconsistencies, contradictions, or suspicious points. This can be achieved using rule-based matching algorithms, i.e., pre-setting multiple conflict rules, such as "the same entity attribute value should not be both A and B"; or by using machine learning models to train and identify historical conflict patterns to predict conflicts in new results. Conflict identification includes factual conflict detection, logical consistency verification, and confidence-weighted evaluation. Factual conflict detection aims to compare whether there are contradictions in the statements of the same fact in the intermediate results generated by different first agents, ensuring consistency in the statements of the same objective fact by different agents. This can be achieved by constructing a knowledge graph or ontology to standardize the entities and attributes in the intermediate results, and then comparing whether there are contradictions in the standardized information; or by using natural language processing technology to perform semantic similarity calculation and key information extraction on the text descriptions generated by different first agents to identify semantic-level factual conflicts. Logical consistency verification is used to check the statements of the intermediate results in the verification results. To address the questioning of the logical reasoning chain of the results, or whether there are contradictions in the logical inferences between different intermediate results, ensuring that the reasoning chain between the results is reasonable and free from logical contradictions, a formal logical reasoning engine can be used to transform intermediate results and verification results into logical expressions, and then perform automatic reasoning to detect whether there are logical contradictions or cases that do not meet preset axioms. Alternatively, causal graphs or dependency graphs can be used to analyze the causal and dependency relationships between intermediate results and identify abnormal paths that do not conform to logical deduction. Confidence-weighted evaluation aims to integrate the confidence scores fed back from each verification result, identify intermediate results with low confidence or confidence differences exceeding a preset threshold, and mark them as potential conflict points. By quantifying the reliability of the evaluation results, low-quality or high-risk potential conflict points can be identified. This can be achieved by assigning an initial confidence score to each agent based on its historical performance or professional domain, and dynamically adjusting and weighting the confidence scores of intermediate results according to the verification results; or by using a Bayesian network to fuse the confidence scores from different verification agents, calculate the comprehensive confidence score, and set a threshold to mark potential conflicts.
[0069] S42: Based on the conflict identification results, assess the severity, scope of impact, and type of the conflict, and generate corresponding dynamic processing instructions; In this embodiment, conflict types include factual conflicts, logical conflicts, execution conflicts, and cognitive framework conflicts. Factual conflicts refer to direct contradictions in objective facts, data, or specific information between intermediate results provided by different agents. Logical conflicts refer to contradictions in the reasoning process, causal relationships, or conclusion derivations between intermediate results, even if the underlying facts may be correct. Confidence conflicts refer to significant differences in the certainty of the results provided by different agents, or a discrepancy between the verification confidence of the verification subnetwork for the same intermediate result and the self-assessed confidence of the executing agent. Cognitive framework conflicts refer to different agents producing different outputs based on different implicit premises, theoretical models, or solution paradigms; this is common in solving open-domain and innovative problems. For example, for the same economic problem, one agent proposes solution A based on a Keynesian model, while another agent proposes solution B based on an Austrian School model. Dynamic processing instructions are used to provide corresponding guidance information for subsequent processing based on conflict identification results, effectively resolving or mitigating conflicts.
[0070] Furthermore, the dynamic processing instructions include a conflict identifier, a conflict level, the ID of the first agent involved, an index of relevant intermediate results and verification results, and a preset processing mode identifier for the second agent. The conflict identifier uniquely identifies a conflict event for easy tracking and management; it can be a globally unique string or numeric ID. The conflict level quantifies the severity of the conflict, guiding the priority and resource allocation of subsequent processing. The ID of the first agent involved indicates the agent that generated the conflict-related results, facilitating traceability and responsibility identification. The index of relevant intermediate results and verification results provides references to the specific data points involved when the conflict occurred, facilitating rapid location and analysis. The preset processing mode identifier guides the second agent in selecting an appropriate conflict resolution strategy.
[0071] S43: Record process trajectory information based on the results of conflict identification and the generation process of dynamic processing instructions.
[0072] In this embodiment, the process trajectory information records key data and events throughout the entire process from query command parsing to conflict identification and command generation, which are used for subsequent analysis, auditing and optimization.
[0073] Furthermore, the process trajectory information includes parsing results, query tasks, distribution records of query subtasks and verification subtasks, all intermediate results and their versions, all verification results, conflict analysis reports, and dynamic processing instructions.
[0074] Specifically, conflict identification is performed on intermediate and verification results. This includes factual conflict detection, which compares statements about the same fact from different first agents to identify direct inconsistencies at the data level; logical consistency verification, which checks for doubts about the logical reasoning chain of intermediate results in the verification results, or contradictions in the logical inferences between different intermediate results, thus revealing potential errors or irrationalities in the reasoning process; and confidence-weighted evaluation, which integrates the confidence scores from each verification result to identify intermediate results with low confidence or confidence differences exceeding a preset threshold, marking them as potential conflict points to quantify risks and focus processing resources. Based on the conflict identification results, the severity, scope of impact, and type of conflict are further assessed to generate targeted dynamic processing instructions. The processing instructions are not merely simple markers of conflicts; they can include conflict identifiers, conflict levels, the IDs of the first agents involved, relevant intermediate and verification result indexes, and pre-defined processing mode identifiers for the second agents. This allows the second agents to select the most appropriate processing strategy based on the nature and severity of the conflict, avoiding the limitations of a single processing method. Furthermore, to ensure the traceability and transparency of the processing process, the scheme in this application also records detailed process trajectory information based on the conflict identification results and the generation process of dynamic processing instructions. This process trajectory information can include parsing results, query tasks, distribution records of query subtasks and verification subtasks, all intermediate results and their versions, all verification results, conflict analysis reports, and generated dynamic processing instructions. This provides a complete context for conflict resolution and improves the reliability of multi-agent collaborative queries.
[0075] By introducing a multi-dimensional conflict identification mechanism, including factual conflict detection, logical consistency verification, and confidence-weighted evaluation, the above technical solution can accurately identify different forms of conflict in intermediate and verification results, thus avoiding the limitations of a single detection method. Furthermore, dynamic processing instructions are generated based on the conflict identification results, enabling subsequent second agents to select the most appropriate processing strategy according to the nature and severity of the conflict, thereby improving the efficiency and accuracy of conflict resolution. In addition, comprehensive recording of process trajectory information can provide complete data support for conflict tracing, analysis, debugging, and optimization, enhancing the transparency and reliability of the multi-agent collaborative query process.
[0076] In one embodiment, step S50 includes: S51: The second intelligent agent selects and activates the corresponding analysis and processing flow according to the processing mode identifier associated with the dynamic processing instruction. The analysis and processing flow includes conflict-free synthesis and arbitration fusion. In this embodiment, the second intelligent agent is the core unit for final result generation and conflict resolution. The second intelligent agent can employ a large language model combining an encoder and a decoder as its architecture, and through instruction fine-tuning technology, it can master at least two specific analysis and processing flows: conflict-free synthesis and arbitration fusion. The processing mode identifier associated with the dynamic processing instruction guides the second intelligent agent in handling conflicts. By selecting and activating different analysis and processing flows, the second intelligent agent can adopt the most appropriate strategy to generate the final query result based on the nature and severity of the conflict. The processing mode identifier can be an enumeration type or a string. The second intelligent agent can pre-set a mapping table, mapping the processing mode identifier to specific processing functions or modules to select the processing flow. That is, when receiving a dynamic processing instruction, the second intelligent agent parses the processing mode identifier and calls the corresponding processing logic. Alternatively, the processing mode identifier can also be a numerical value representing different processing priorities or complexity levels. The second intelligent agent can dynamically load and execute the corresponding analysis and processing flow based on this numerical value through conditional statements or strategy patterns.
[0077] Furthermore, in the large language model architecture combining encoder and decoder, the encoder of the large language model receives and understands structured input information. This input information is composed of dynamically processed instructions and process trajectory information concatenated according to a preset template, forming a rich contextual prompt text. This prompt text explicitly includes processing mode identifiers, conflict details, the outputs of the involved agents, verification results, and confidence levels. The decoder of the large language model then generates the final query result information based on the context understood by the encoder. Its internal working mechanism is tightly bound to the analysis and processing flow through training and prompt design: when the processing mode identifier in the input prompt points to conflict-free synthesis, the decoding process executes weighted fusion and consistency verification logic. The system weights the importance of each intermediate result in the prompt and its verification confidence level, and verifies the consistency between different results, ultimately outputting a direct and clear answer. When the processing mode indicator in the input prompt points to arbitration fusion, the Big Prophet model enters a creative reasoning state. Its decoding process simulates the cognitive process of deep conflict analysis, constructing an argument model, and generating and evaluating a meta-explanatory framework. The Big Prophet model analyzes opposing arguments and evidence from the input, infers potential higher-level explanations, such as identifying different preconditions for the conclusions of each party, and internally evaluates the rationality, conciseness, and knowledge consistency of these explanations. Finally, it selects the optimal explanatory framework and generates a comprehensive response that can reconcile conflicts and has new insights.
[0078] S52: If the conflict-free synthesis analysis and processing flow is activated, the intermediate results are weighted and fused and consistency is checked based on the intermediate results, the verification results, and the confidence level of the verification results to generate query result information. In this embodiment, the conflict-free synthesis process is suitable for situations with low conflict levels or no obvious conflicts. Its purpose is to effectively integrate intermediate results from different first agents while ensuring consistency, and to improve the accuracy and reliability of the final result by utilizing the verification results and their confidence levels. Weighted fusion can better utilize high-confidence information, while consistency verification ensures the logical consistency of the final result. Weighted fusion can adopt a confidence-based averaging method. For example, for multiple intermediate results of the same fact, a weighted average can be performed based on the confidence levels of their corresponding verification results. Consistency verification can include checking whether the data type, range, and format meet expectations, and whether there are obvious logical contradictions. In addition, Bayesian fusion can also be used for weighted fusion, integrating the confidence levels of intermediate results and verification results from different sources as evidence. Consistency verification can further introduce domain knowledge graphs or ontology to check whether the fused result is consistent with known facts or rules.
[0079] S53: If the analysis and processing flow of arbitration fusion is activated, then the conflict context information is identified based on the process trajectory information, and the conflict context information is analyzed to construct the argumentation model of the conflicting parties. In this embodiment, the arbitration fusion process is used to handle complex and deep-seated conflicts that may involve different logical reasoning, factual basis, and even implicit assumptions. By identifying the conflict context, constructing an argumentation model, and separating the logical chains, factual basis, and implicit assumptions, the second agent can understand the root cause of the conflict and provide a basis for generating a meta-explanation framework. The conflict context information may include the query subtasks at the time of the conflict, the first agents involved, the relevant intermediate results and verification results, and the parameters and environment at the time of generating the intermediate results and verification results. Analyzing the conflict context can be done by performing semantic analysis on the text descriptions in the process trajectory information using natural language processing technology, or by tracing data flow and control flow using graph analysis technology. The argumentation model can be a structured data representation, such as a set of triples or a logic graph, representing the viewpoints, supporting evidence, and reasoning paths of each party. Identifying the conflict context information can be done using knowledge graph technology to extract and associate entities and relationships in the process trajectory information. Constructing the argumentation model can be done using formal logic or informal argumentation frameworks to structurally represent the viewpoints, reasons, evidence, and rebuttals of the conflicting parties.
[0080] Furthermore, by analyzing the conflict context information, multiple independent logical chains, sets of factual evidence, and implicit assumptions of each party that lead to the conflict can be identified and separated. The separation of logical chains, factual evidence, and implicit assumptions can all be achieved through source tracing analysis and causal reasoning algorithms.
[0081] S54: Generate at least one meta-explanatory framework based on the argumentation model, and calculate the comprehensive score of the meta-explanatory framework, wherein the comprehensive score includes an explanatory score, a conciseness score, and a prior knowledge consistency score. In this embodiment, the meta-explanation framework provides one or more possible explanations or solutions for a conflict. By generating multiple meta-explanation frameworks and comprehensively evaluating them, the second agent can assess the merits of different solutions and select the best explanation to generate the final query result. The comprehensive evaluation includes an interpretability score, a conciseness score, and a prior knowledge consistency score. The interpretability score measures the framework's ability to explain the conflict, the conciseness score measures its complexity, and the prior knowledge consistency score ensures that it does not contradict known knowledge. The meta-explanation framework can be structured text containing the causes of the conflict, suggested solutions, and supporting evidence. Generative meta-explanatory frameworks can utilize rule-based reasoning engines to deduce possible explanations based on the logical chains and factual evidence in the argumentation model. The comprehensive score can be calculated through a weighted summation, where the explanatory score can be obtained based on the number of conflict points covered by the framework or the depth of the explanation, the conciseness score can be obtained based on the complexity of the framework, and the prior knowledge consistency score can be obtained by comparing with a pre-defined domain knowledge base. In addition, large-scale language models can be used as generators to generate multiple different meta-explanatory frameworks based on the argumentation model and conflict context, and the calculation of the comprehensive score can be achieved by combining expert systems and machine learning models.
[0082] S55: Generate query results information based on the meta-interpretation framework with the best comprehensive score.
[0083] In this embodiment, selecting the optimal meta-explanation framework avoids simply merging conflicting information, thereby providing a persuasive solution. The query result information can be a structured data object containing the final answer, supporting evidence, and a brief explanation of the conflict. Its generation process can involve extracting and formatting key information from the optimal meta-explanation framework. For example, if the optimal framework explains the correct version of a fact, then that fact is included as part of the query result. Alternatively, the optimal meta-explanation framework can be directly converted into natural language text and included as part of the query result information, providing the user with the answer and the reasoning process and conflict resolution mechanism behind the answer.
[0084] Specifically, the second intelligent agent selects the most suitable processing strategy for the current conflict situation based on the processing mode identifier in the dynamic processing instructions. When the conflict level is low or there is no obvious conflict, the executed conflict-free synthesis process can perform weighted fusion and consistency verification based on intermediate results, verification results and their confidence levels to ensure the accuracy and consistency of the results. When facing complex and deep-seated conflicts, the executed arbitration fusion process can deeply analyze the process trajectory information, identify the conflict context, construct the argumentation model of the conflicting parties, and separate the logical chain, factual basis and implicit assumptions, thereby fundamentally understanding the cause of the conflict. On this basis, multiple meta-explanation frameworks are generated and comprehensively evaluated through explanatory power score, conciseness score and prior knowledge consistency score, and finally the optimal meta-explanation framework is selected to generate query result information.
[0085] Through the above technical solutions, the second intelligent agent can adaptively select the most appropriate processing strategy according to the nature and severity of the conflict. Specifically, the conflict-free synthesis process ensures the accuracy and consistency of results in the absence of conflict or in the case of minor conflict, avoiding unnecessary complex processing. The arbitration fusion process, through in-depth analysis of the conflict context, construction of argumentation models and generative interpretation frameworks, achieves a deep understanding and corresponding resolution of complex conflicts, thereby avoiding errors or inconsistencies that may be caused by simple merging. Through this hierarchical conflict processing mechanism, this application can provide more intelligent and reliable query output when facing multi-source heterogeneous information and potential conflicts, and has the effect of improving the accuracy, reliability and interpretability of query results.
[0086] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0087] In one embodiment, a multi-agent collaborative query system is provided, which corresponds one-to-one with the multi-agent collaborative query method described in the previous embodiment. The multi-agent collaborative query system includes: The task parsing module is used to respond to query commands by parsing the query commands through a pre-trained task generation model, generating parsing results and corresponding query tasks. The parsing results include query intent classification, query domain labels, and query capability requirement vectors. The network construction module is used to select several first agents from a preset agent pool based on the parsing results and query tasks, and to construct a collaborative network, which includes an execution subnetwork and a verification subnetwork. The subtask generation module is used to generate several query subtasks and verification subtasks based on the query task, distribute the query subtasks and verification subtasks to the first agent in the cooperative network, and collect the intermediate results fed back by the execution subnetwork and the verification results fed back by the verification subnetwork. The conflict identification module is used to identify conflicts in intermediate results and verification results, generate dynamic processing instructions based on the conflict identification results, and record process trajectory information. The result generation module is used to input dynamic processing instructions and process trajectory information into the second intelligent agent. The second intelligent agent then performs the corresponding analysis and processing flow on the process trajectory information based on the dynamic processing instructions to generate query result information.
[0088] For specific limitations regarding a multi-agent collaborative query system, please refer to the limitations of a multi-agent collaborative query method described above, which will not be repeated here. Each module in the aforementioned multi-agent collaborative query system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0089] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a query method based on multi-agent cooperation.
[0090] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements a query method based on multi-agent cooperation.
[0091] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A query method based on multi-agent collaboration, characterized in that, Including the following steps: In response to a query command, the query command is parsed using a pre-trained task generation model to generate parsing results and corresponding query tasks. The parsing results include query intent classification, query domain labels, and query capability requirement vectors. Based on the analysis results and query tasks, several first agents are selected from the preset agent pool, and a collaborative network is constructed, which includes an execution subnetwork and a verification subnetwork. Several query subtasks and verification subtasks are generated based on the query task. The query subtasks and verification subtasks are distributed to the first agent in the cooperative network. The intermediate results fed back by the execution subnetwork and the verification results fed back by the verification subnetwork are collected. Conflict identification is performed on intermediate and verification results, dynamic processing instructions are generated based on the conflict identification results, and process trajectory information is recorded; The dynamic processing instructions and process trajectory information are input into the second intelligent agent. The second intelligent agent then performs the corresponding analysis and processing flow on the process trajectory information based on the dynamic processing instructions to generate query result information.
2. The query method based on multi-agent collaboration according to claim 1, characterized in that: The task generation model includes a semantic understanding layer, a task parsing layer, a capability mapping layer, and a task generation layer. In response to a query command, the pre-trained task generation model parses the query command, generating a parsing result and a corresponding query task. The parsing result includes steps such as query intent classification, query domain labels, and query capability requirement vectors. The semantic understanding layer performs semantic analysis on the query command and generates a preliminary semantic representation, which includes core entities, actions, and relationships. The task parsing layer generates a task graph based on the preliminary semantic representation, which includes several sub-task nodes and sub-task dependencies. It also feeds back the task objectives and constraint information identified in the process to the semantic understanding layer to obtain query intent classification and query domain labels. The capability mapping layer maps each subtask node in the task graph to the atomic capability unit required by the corresponding subtask, and integrates and quantizes them to generate a query capability requirement vector. The task generation layer generates query tasks based on the task graph and the query capability requirement vector.
3. The query method based on multi-agent collaboration according to claim 1, characterized in that: Based on the parsing results and the query task, several first agents are selected from a preset agent pool, and a collaborative network is constructed. The collaborative network includes the steps of executing a sub-network and verifying a sub-network, including the following steps: The capability matching degree of each first agent in the agent pool is calculated based on the query capability demand vector, and the scenario adaptability of each first agent in the agent pool is evaluated based on the query intent classification and query domain label. Based on the capability matching degree calculation results and the scenario adaptability evaluation results, several candidate intelligent agents are selected to form a candidate intelligent agent set. Retrieve historical collaboration records of candidate agents, calculate collaboration performance scores based on historical collaboration records, and select several preferred agents based on collaboration performance scores to form a preferred agent set; Based on the analysis results and the query task, roles are assigned to the first agent in the preferred agent set, and a cooperative network is constructed.
4. The query method based on multi-agent collaboration according to claim 3, characterized in that: The step of assigning roles to the first agent in the preferred agent set based on the parsing results and the query task, and constructing a cooperative network, includes the following steps: Identify the first and second dependencies of the query task. The first dependency includes the logical combination relationship between the atomic capabilities required by the query task and the execution order dependency. The second dependency includes the intensity requirement relationship between result verification and process monitoring. A collaborative execution framework is constructed based on the first dependency relationship, where nodes represent atomic capabilities. Based on the capability matching degree, the first agent in the preferred set of agents is mapped to the corresponding node of the collaborative execution framework to form an initial execution sub-network. Based on the second dependency relationship, verification anchors are configured for critical path nodes, high-risk capability nodes and convergence nodes in the collaborative execution framework, and at least one verification agent is assigned to each verification anchor based on the remaining first agents to form a verification sub-network. Based on the initial execution subnetwork calculation and optimization of the direct communication overhead and potential conflict risks between its nodes, while maintaining the first dependency relationship, cooperative edges between nodes are added or removed, and the monitoring scope of the verification subnetwork is adjusted synchronously to form a cooperative network.
5. The query method based on multi-agent collaboration according to claim 4, characterized in that: The steps of generating several query subtasks and verification subtasks based on the query task, distributing the query subtasks and verification subtasks to the first agents in the cooperative network, and collecting the intermediate results fed back by the execution subnetwork and the verification results fed back by the verification subnetwork include the following steps: Based on the first dependency and the second dependency, the query task is decomposed into several atomic query subtasks; Based on the task attributes, criticality, and historical error probability of each atomic query subtask, generate corresponding matching verification subtasks; A shared intermediate state storage area is established between the execution subnetwork and the verification subnetwork to store in real time the intermediate results generated by the first agent in the execution subnetwork and the verification results generated by the first agent in the verification subnetwork.
6. The query method based on multi-agent collaboration according to claim 1, characterized in that: The steps of identifying conflicts between intermediate and verification results, generating dynamic processing instructions based on the conflict identification results, and recording process trajectory information include the following steps: Conflict identification is performed on intermediate results and verification results, including factual conflict detection, logical consistency verification, and confidence-weighted evaluation. Based on the conflict identification results, the severity, scope of impact, and type of conflict are assessed, and corresponding dynamic processing instructions are generated. Record process trajectory information based on the results of conflict identification and the generation process of dynamic processing instructions.
7. The query method based on multi-agent collaboration according to claim 1, characterized in that: The step of inputting dynamic processing instructions and process trajectory information into a second intelligent agent, and having the second intelligent agent execute corresponding analysis and processing procedures on the process trajectory information based on the dynamic processing instructions to generate query result information, includes the following steps: The second intelligent agent selects and activates the corresponding analysis and processing flow based on the processing mode identifier associated with the dynamic processing instruction. The analysis and processing flow includes conflict-free synthesis and arbitration fusion. If the conflict-free synthesis analysis process is activated, the intermediate results are weighted and fused and consistency is checked based on the intermediate results, validation results, and the confidence level of the validation results to generate query result information. If the analysis and processing flow of arbitration fusion is activated, then the conflict context information is identified based on the process trajectory information, and the conflict context information is analyzed to construct the argumentation model of the conflicting parties. At least one meta-explanatory framework is generated based on the argumentation model, and a comprehensive score of the meta-explanatory framework is calculated. The comprehensive score includes an explanatory score, a conciseness score, and a prior knowledge consistency score. Query results are generated based on a meta-interpretation framework that optimizes the overall score.
8. A query system based on multi-agent collaboration, characterized in that, include: The task parsing module is used to respond to query commands by parsing the query commands through a pre-trained task generation model, generating parsing results and corresponding query tasks. The parsing results include query intent classification, query domain labels, and query capability requirement vectors. The network construction module is used to select several first agents from a preset agent pool based on the parsing results and query tasks, and to construct a collaborative network, which includes an execution subnetwork and a verification subnetwork. The subtask generation module is used to generate several query subtasks and verification subtasks based on the query task, distribute the query subtasks and verification subtasks to the first agent in the cooperative network, and collect the intermediate results fed back by the execution subnetwork and the verification results fed back by the verification subnetwork. The conflict identification module is used to identify conflicts in intermediate results and verification results, generate dynamic processing instructions based on the conflict identification results, and record process trajectory information. The result generation module is used to input dynamic processing instructions and process trajectory information into the second intelligent agent. The second intelligent agent then performs the corresponding analysis and processing flow on the process trajectory information based on the dynamic processing instructions to generate query result information.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the multi-agent collaborative query method as described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the multi-agent collaborative query method as described in any one of claims 1-7.