Multi-agent task arrangement method and device based on hybrid expert model

By automatically selecting target expert models and generating an agent orchestration matrix using a hybrid expert model, the problem of insufficient flexibility and adaptability in task orchestration of multi-agent systems is solved, and efficient and accurate task orchestration is achieved.

CN121503530APending Publication Date: 2026-02-10PICC INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511748645.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing multi-agent systems lack flexibility and adaptability in task orchestration. Traditional methods rely on manually pre-setting process templates or modifying underlying code, making it difficult to cope with complex and diverse task requirements.

Method used

A hybrid expert model-based approach is adopted, which selects the most suitable target expert model through the hybrid expert model and combines it with the order model to generate an intelligent agent orchestration matrix, automatically matching professional capabilities and determining the execution order.

Benefits of technology

It significantly improves the automation, flexibility, and accuracy of task orchestration, and solves the problem of poor adaptability of traditional methods when facing complex tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121503530A_ABST
    Figure CN121503530A_ABST
Patent Text Reader

Abstract

The invention provides a multi-agent task arrangement method and device based on a hybrid expert model, and the method comprises the steps: obtaining a task request text inputted by a user, and inputting the task request text into the hybrid expert model, determining at least one target expert model from a plurality of preset expert models according to a preset activation strategy; based on at least one target expert model and an ordering model in the hybrid expert model, generating an agent arrangement matrix for a plurality of preset agents; and according to the agent arrangement matrix, determining at least one target agent for executing a task from the plurality of preset agents and an execution sequence of each target agent, so as to generate a multi-agent cooperative execution process corresponding to the task request text. By means of the method and device, the automation degree, flexibility and accuracy of task arrangement are remarkably improved, and the problem that a traditional method is poor in adaptability when facing complex tasks is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and apparatus for orchestrating multi-agent tasks based on a hybrid expert model. Background Technology

[0002] With the rapid development of artificial intelligence technology, multi-agent systems are being used more and more widely in complex task processing. In multi-agent collaborative work, task orchestration is a key step in achieving efficient collaboration. Currently, two main approaches are used in multi-agent task orchestration: task template-based schemes and open-source agent framework schemes.

[0003] Task templating solutions require manual pre-design of task orchestration templates, breaking down business processes into reusable, standardized modules. This approach relies on template libraries compiled from human experience; however, in real-world applications, business requirements are often diverse and complex, and pre-designed templates may not fully cover all possible task flows. Another approach is task orchestration based on open-source intelligent agent frameworks, where agents communicate and collaborate using fixed-format prompts. Since the framework's internal interaction logic and prompt templates are predefined, adjusting the task orchestration strategy requires modifying the framework's underlying code, lacking flexibility and adaptability. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a multi-agent task orchestration method and apparatus based on a hybrid expert model. By inputting the task request text into the hybrid expert model and automatically selecting the most suitable target expert model according to a preset activation strategy, it can flexibly match professional capabilities according to task semantics. Then, combined with the ordering model, an agent orchestration matrix is ​​generated to accurately determine the agents participating in the task and their execution order, which significantly improves the automation, flexibility and accuracy of task orchestration and effectively solves the problem of poor adaptability of traditional methods when facing complex tasks.

[0005] In a first aspect, embodiments of this application provide a multi-agent task orchestration method based on a hybrid expert model, the multi-agent task orchestration method comprising: Obtain the task request text input by the user, and input the task request text into the hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy; Generate an agent orchestration matrix for multiple preset agents based on at least one of the target expert models and the integrator model in the hybrid expert model; Based on the agent orchestration matrix, at least one target agent and the execution order of each target agent are determined from a plurality of preset agents to generate a multi-agent collaborative execution flow corresponding to the task request text.

[0006] Furthermore, the step of inputting the task request text into a hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy includes: The task request text is input into the embedding model of the hybrid expert model, and the task request text is converted into a corresponding semantic embedding vector through the embedding model; The semantic embedding vector is input into the routing model of the hybrid expert model, and the routing model calculates the activation probability distribution of each preset expert model based on the softmax function; Based on the activation probability distribution, candidate expert models with activation probabilities greater than or equal to a preset probability threshold are determined from multiple preset expert models. At least one target expert model is determined from the candidate expert models based on the number of candidate expert models and a preset number.

[0007] Furthermore, the hybrid expert model also includes a general expert model, and the multi-agent task orchestration method further includes: If there is no candidate expert model among multiple preset expert models whose activation probability is greater than or equal to a preset probability threshold, the general expert model is determined as the target expert model.

[0008] Furthermore, the step of generating an agent orchestration matrix for multiple preset agents based on at least one of the target expert models and the integrator model in the hybrid expert model includes: The semantic embedding vector is input into at least one of the target expert models to obtain multiple first prediction vectors, and the multiple first prediction vectors are weighted and averaged to obtain a second prediction vector; wherein, the first prediction vector is used to indicate whether each preset agent participates in task orchestration. The semantic embedding vector is input into the ordering model to obtain a third prediction vector, and the third prediction vector is converted into a position encoding matrix; wherein the number of rows and the width of the position encoding matrix are the same as the number of preset agents; The second prediction vector is concatenated with the position encoding matrix along the column direction to obtain the agent arrangement matrix.

[0009] Furthermore, the hybrid expert model is trained through the following steps: Obtain training samples; wherein, the training samples include task text samples and corresponding label arrangement matrices; The task text sample is input into the original embedding model of the original hybrid expert model to obtain the embedding vector sample; The embedded vector samples are input into the original routing model of the original hybrid expert model, and at least one activated expert model is determined from the multiple expert models to be trained in the original hybrid expert model. A prediction orchestration matrix for multiple preset agents is generated based on at least one activated expert model and the original integrity model in the original hybrid expert model. Calculate the loss value of all corresponding elements between the prediction orchestration matrix and the label orchestration matrix, and perform backpropagation training on the original embedding model, the original routing model, the activated expert model and the original ordering model based on the loss value until the preset training completion condition is met, and obtain the trained hybrid expert model.

[0010] Furthermore, the multi-agent task orchestration method also includes: For each expert model to be trained, the cumulative number of activations of the expert model to be trained is recorded. When the cumulative number of activations is greater than or equal to the threshold, the activation probability of the expert model to be trained is set to zero.

[0011] Secondly, embodiments of this application also provide a multi-agent task orchestration device based on a hybrid expert model, the multi-agent task orchestration device comprising: The expert model filtering module is used to obtain the task request text input by the user, input the task request text into the hybrid expert model, and determine at least one target expert model from multiple preset expert models according to a preset activation strategy. An orchestration matrix generation module is used to generate an agent orchestration matrix for multiple preset agents based on at least one target expert model and an ordered model in the hybrid expert model. The execution flow generation module is used to determine at least one target agent for performing the task and the execution order of each target agent from multiple preset agents according to the agent orchestration matrix, so as to generate a multi-agent collaborative execution flow corresponding to the task request text.

[0012] Furthermore, when the expert model filtering module inputs the task request text into the hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy, the expert model filtering module is also used for: The task request text is input into the embedding model of the hybrid expert model, and the task request text is converted into a corresponding semantic embedding vector through the embedding model; The semantic embedding vector is input into the routing model of the hybrid expert model, and the routing model calculates the activation probability distribution of each preset expert model based on the softmax function; Based on the activation probability distribution, candidate expert models with activation probabilities greater than or equal to a preset probability threshold are determined from multiple preset expert models. At least one target expert model is determined from the candidate expert models based on the number of candidate expert models and a preset number.

[0013] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the multi-agent task orchestration method based on the hybrid expert model described above are performed.

[0014] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the multi-agent task orchestration method based on a hybrid expert model as described above.

[0015] This application provides a multi-agent task orchestration method and apparatus based on a hybrid expert model. First, a task request text input by a user is obtained and input into a hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy. Then, an agent orchestration matrix for multiple preset agents is generated based on at least one target expert model and an ordering model in the hybrid expert model. Finally, at least one target agent to perform the task and the execution order of each target agent are determined from the multiple preset agents according to the agent orchestration matrix to generate a multi-agent collaborative execution flow corresponding to the task request text.

[0016] Compared to traditional template-based task orchestration methods or open-source frameworks using fixed prompts, this application adapts to diverse task requirements without relying on manually preset process templates or modifications to underlying code. By inputting task request text into a hybrid expert model and automatically selecting the most suitable target expert model based on a preset activation strategy, it can flexibly match professional capabilities according to task semantics. Furthermore, by combining an ordering model to generate an agent orchestration matrix, it accurately determines the agents participating in the task and their execution order, significantly improving the automation, flexibility, and accuracy of task orchestration, and effectively solving the problem of poor adaptability of traditional methods when facing complex tasks.

[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a multi-agent task orchestration method based on a hybrid expert model, provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a multi-agent task orchestration device based on a hybrid expert model provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments 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 represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.

[0021] First, the applicable application scenarios for this application will be introduced. This application can be applied to the field of artificial intelligence technology.

[0022] With the rapid development of artificial intelligence technology, multi-agent systems are being used more and more widely in complex task processing. In multi-agent collaborative work, task orchestration is a key step in achieving efficient collaboration. Currently, multi-agent task orchestration mainly adopts two mainstream methods: task template-based schemes and open-source agent framework schemes.

[0023] Research has revealed that task templating solutions require manual pre-design of task orchestration templates, breaking down business processes into reusable, standardized modules. This approach relies on template libraries compiled from human experience; however, in real-world applications, business requirements are often diverse and complex, and pre-designed templates may not fully cover all possible task flows. Another approach utilizes an open-source agent framework for task orchestration, where agents communicate and collaborate using fixed-format prompts. Since the framework's internal interaction logic and prompt templates are predefined, adjusting the task orchestration strategy requires modifying the framework's underlying code, lacking flexibility and adaptability.

[0024] Based on this, the embodiments of this application provide a multi-agent task orchestration method based on a hybrid expert model, which significantly improves the automation, flexibility and accuracy of task orchestration, and effectively solves the problem of poor adaptability of traditional methods when facing complex tasks.

[0025] Please see Figure 1 , Figure 1 This is a flowchart illustrating a multi-agent task orchestration method based on a hybrid expert model, provided as an embodiment of this application. Figure 1 As shown in the embodiments of this application, the multi-agent task orchestration method includes: S101, Obtain the task request text input by the user, and input the task request text into the hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy.

[0026] It's important to note that the task request text refers to the task description entered by the user in natural language. Hybrid Expert Models (MoE) are neural network architectures that distribute input data among multiple expert models for processing. Each expert focuses on a specific task or subset of data, thereby improving the overall model performance. The core idea of ​​MoE is to use a gating network to determine which expert participates in processing specific input data. By integrating the predictions of multiple experts, the MoE model can leverage the strengths of each expert across different data subsets or tasks, thus improving the overall model performance. Preset activation policies determine which expert models are activated to participate in the current task processing.

[0027] Regarding step S101 above, in specific implementation, the task request text submitted by the user through the interface or other interactive methods is received, and the task request text is input into a pre-trained hybrid expert model. Based on a preset activation strategy, the hybrid expert model selects one or more target expert models from all preset expert models that match the current task.

[0028] As an optional embodiment, regarding step S101 above, the step of inputting the task request text into a hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy includes: Step 1011: Input the task request text into the embedding model of the hybrid expert model, and convert the task request text into a corresponding semantic embedding vector through the embedding model.

[0029] Regarding step 1011 above, in specific implementation, the task request text is input into the embedding model of the hybrid expert model. The embedding model is a neural network module that maps text into high-dimensional semantic vectors, capturing the semantic information of the text. As an example, the embedding model can adopt a Transformer structure, which is not specifically limited in this application. The task request text is converted into the corresponding semantic embedding vector through the embedding model.

[0030] Step 1012: Input the semantic embedding vector into the routing model of the hybrid expert model, and the routing model calculates the activation probability distribution of each preset expert model based on the softmax function.

[0031] Step 1013: Based on the activation probability distribution, determine the candidate expert models whose activation probability is greater than or equal to the preset probability threshold from multiple preset expert models.

[0032] Regarding steps 1012-1013 above, in specific implementation, the semantic embedding vector is input into the routing model. The routing model consists of fully connected layers and outputs the original scores of each preset expert model, which are then normalized to an activation probability distribution using the Softmax function. For example, if there are 5 expert models, the output activation probability distribution will be in the form of [0.1, 0.8, 0.05, 0.03, 0.02]. Then, based on the activation probability distribution, candidate expert models with activation probabilities greater than or equal to a preset probability threshold are selected from the multiple preset expert models.

[0033] Step 1014: Determine at least one target expert model from the candidate expert models based on the number of candidate expert models and a preset number.

[0034] Regarding step 1014 above, in specific implementation, after the candidate expert models are determined, at least one target expert model is determined from the candidate expert models based on the number of candidate expert models and a preset number. Specifically, let the preset number be k, the number of candidate expert models be m, and the number of target expert models be min(m, k).

[0035] Thus, based on steps 1011-1014 above, semantic embedding vectorization of the task request text and calculation of the activation probability distribution of each expert model using a routing model achieve expert matching based on semantic similarity. By setting a probability threshold to filter candidate expert models and combining this with quantity constraints to further determine the target experts, the controllability and stability of the model's decision-making are enhanced, avoiding the problem of low-relevance experts being falsely activated. This not only improves the accuracy of expert selection but also provides a high-quality input foundation for the subsequent generation of the orchestration matrix, thereby improving the overall rationality and efficiency of task orchestration.

[0036] As an optional embodiment, the hybrid expert model further includes a general expert model, and the multi-agent task orchestration method further includes: If there is no candidate expert model among multiple preset expert models whose activation probability is greater than or equal to a preset probability threshold, the general expert model is determined as the target expert model.

[0037] Here, a general expert model refers to an expert model with extensive knowledge, used to handle novel or fuzzy tasks that cannot be clearly categorized.

[0038] Regarding the above steps, in specific implementation, when none of the candidate expert models among multiple preset expert models have an activation probability greater than or equal to a preset probability threshold, it indicates that the current task does not fall within the professional scope of any existing expert. In this case, a general expert model is designated as the target expert model, enabling it to provide an initial response to the unknown task and preventing service interruption due to task identification failure. Thus, activation occurs when all specialized expert models have not reached the activation threshold, ensuring an effective response even when facing unknown, marginal, or cross-domain tasks, avoiding task interruption or failure due to a lack of available experts.

[0039] S102, Generate an agent orchestration matrix for multiple preset agents based on at least one of the target expert models and the ordered model in the hybrid expert model.

[0040] Here, the ordering model is the sub-model in the hybrid expert model responsible for generating the execution order information of the agents, and its output is a vector representing the position of each agent in the task execution process. The agent orchestration matrix is ​​a two-dimensional matrix, with rows corresponding to preset agents and columns containing two parts: the first part indicates whether the agent participated in the task, and the second part is the position code, i.e., the execution order in the task, which is used to guide the construction of multi-agent collaborative processes.

[0041] Regarding step S102 above, in specific implementation, an agent orchestration matrix for multiple preset agents is generated using at least one target expert model and the ordered model in the hybrid expert model determined in step S101. According to the embodiments provided in this application, each preset agent has a pre-existing agent number, and the length and width of the orchestration matrix are consistent with the number of agents. Each row represents the current agent's position in the orchestration chain, and is concatenated with a vector indicating whether the agent participates in the task to form a complete orchestration matrix. Specifically, assuming there are N preset agents, the length and width of the orchestration matrix are (N, N+1). The first column represents whether the agent is activated, and the subsequent columns represent the orchestration position. This setting ensures that only when the first column is 1, indicating activation, will the corresponding orchestration position appear subsequently; otherwise, the entire row of the orchestration matrix is ​​0.

[0042] As an optional embodiment, regarding step S102 above, generating an agent orchestration matrix for multiple preset agents based on at least one of the target expert models and the ordered model in the hybrid expert model includes: Step 1021: Input the semantic embedding vector into at least one of the target expert models to obtain multiple first prediction vectors, and perform a weighted average of the multiple first prediction vectors to obtain a second prediction vector.

[0043] Regarding step 1021 above, in specific implementation, each target expert model outputs a first prediction vector based on the semantic embedding vector. This first prediction vector indicates whether each pre-defined agent participates in task orchestration. Specifically, the length of the first prediction vector is equal to the total number of pre-defined agents, and the element values ​​in the first prediction vector indicate whether the corresponding pre-defined agent is activated. For example, an element value of 1 indicates that the corresponding pre-defined agent is activated to participate in the corresponding task, while an element value of 0 indicates that the corresponding pre-defined agent does not participate in the corresponding task. Then, a weighted average is performed on the first prediction vectors output by each target expert model to obtain a second prediction vector.

[0044] Step 1022: Input the semantic embedding vector into the ordering model to obtain the third prediction vector, and convert the third prediction vector into a position encoding matrix.

[0045] Here, the third prediction vector is the vector output by the ordering model, representing the order of each agent in the task process.

[0046] Regarding step 1022 above, in specific implementation, the sequencing model receives the same semantic embedding vector and outputs a third prediction vector. Then, the third prediction vector is converted into a positional encoding matrix, making it a structured form that can be concatenated with the second prediction vector. The number of rows and the width of the positional encoding matrix are the same as the number of preset agents.

[0047] Step 1023: Concatenate the second prediction vector with the position encoding matrix along the column direction to obtain the agent arrangement matrix.

[0048] In specific implementation of step 1023 above, the second prediction vector (shape 1×N) and the position encoding matrix (shape N×N) are concatenated in the column direction to form the final agent arrangement matrix (shape N×(N+1)), where the first column indicates whether the agent participates in the task and the last N columns are the position codes.

[0049] According to the embodiments provided in this application, the hybrid expert model is trained through the following steps: A: Obtain training samples.

[0050] Here, the training samples include task text samples and the corresponding label arrangement matrix.

[0051] B: Input the task text sample into the original embedding model of the original hybrid expert model to obtain the embedding vector sample.

[0052] C: Input the embedded vector samples into the original routing model of the original hybrid expert model, and determine at least one activated expert model from the multiple expert models to be trained in the original hybrid expert model.

[0053] Regarding steps A through C above, in practical implementation, training samples are first acquired by collecting a large number of task text samples from real-world scenarios and their corresponding label arrangement matrices. The label arrangement matrices are generated by domain experts or historical execution logs to ensure they accurately reflect the ideal agent participation and execution order. Then, the task text samples are input into the original embedding model to obtain embedding vector samples. These embedding vector samples are then input into the original routing model to determine at least one activated expert model. The method for determining the embedding vector samples and the activated expert model is the same as in the previous steps and achieves the same technical effect, so it will not be elaborated further here.

[0054] Here, as an optional embodiment, the multi-agent task orchestration method further includes: For each expert model to be trained, the cumulative number of activations of the expert model to be trained is recorded. When the cumulative number of activations is greater than or equal to the threshold, the activation probability of the expert model to be trained is set to zero.

[0055] The cumulative activation count refers to the total number of times each expert model to be trained is selected during the entire training process.

[0056] To implement the above steps, during training, the cumulative activation count of each expert model to be trained is continuously monitored. Once the activation count of an expert model exceeds a preset threshold, its activation probability is forcibly reset to zero in subsequent training, temporarily prohibiting it from participating in task processing. In this way, by monitoring the cumulative activation count of each expert model to be trained and setting its activation probability to zero when it exceeds a set threshold, load balancing control of the expert models is achieved. This prevents some expert models from being overused, causing resource bottlenecks or overfitting risks, allows other underutilized experts to get more training opportunities, promotes load balancing among experts, avoids models getting trapped in local optima, and improves the generalization ability and stability of the overall system.

[0057] D: Generate a prediction orchestration matrix for multiple preset agents based on at least one of the activated expert models and the original ordered model in the original hybrid expert model.

[0058] E: Calculate the loss value of all corresponding elements between the prediction orchestration matrix and the label orchestration matrix, and perform backpropagation training on the original embedding model, the original routing model, the activated expert model and the original ordering model based on the loss value until the preset training completion condition is met, and obtain the trained hybrid expert model.

[0059] Regarding steps D-E above, in specific implementation, a prediction orchestration matrix for multiple preset agents is generated based on at least one activated expert model and the original integrity model in the original hybrid expert model. Here, the method for generating the prediction orchestration matrix is ​​the same as the method for generating the agent orchestration matrix in the above steps, and achieves the same technical effect, so it will not be elaborated further. Then, the loss value between the prediction orchestration matrix and the label orchestration matrix is ​​calculated. Specifically, the loss value is the average L2 distance of each element point in the matrix. Then, based on the loss value, backpropagation training is performed on the original embedding model, the original routing model, the activated expert model, and the original integrity model, adjusting the model parameters of each model, and repeating the above training process until the preset training completion condition is met, resulting in a trained hybrid expert model. Here, the preset training completion condition can be training to a preset number of times or the loss value reaching a preset value; no specific limitation is made here.

[0060] S103, determine at least one target agent to perform the task and the execution order of each target agent from the plurality of preset agents according to the agent orchestration matrix, so as to generate a multi-agent collaborative execution process corresponding to the task request text.

[0061] Regarding step S103 above, in specific implementation, after the agent orchestration matrix is ​​determined, at least one target agent that needs to execute the current task is determined based on the matrix, and the execution order is determined according to its position code, thus forming a multi-agent collaborative execution process corresponding to the task request text.

[0062] The multi-agent task orchestration method based on a hybrid expert model provided in this application first obtains a task request text input by a user and inputs the task request text into a hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy. Then, an agent orchestration matrix for multiple preset agents is generated based on at least one target expert model and an ordering model in the hybrid expert model. Finally, at least one target agent to perform the task and the execution order of each target agent are determined from the multiple preset agents according to the agent orchestration matrix to generate a multi-agent collaborative execution flow corresponding to the task request text.

[0063] Compared to traditional template-based task orchestration methods or open-source frameworks using fixed prompts, this application adapts to diverse task requirements without relying on manually preset process templates or modifications to underlying code. By inputting task request text into a hybrid expert model and automatically selecting the most suitable target expert model based on a preset activation strategy, it can flexibly match professional capabilities according to task semantics. Furthermore, by combining an ordering model to generate an agent orchestration matrix, it accurately determines the agents participating in the task and their execution order, significantly improving the automation, flexibility, and accuracy of task orchestration, and effectively solving the problem of poor adaptability of traditional methods when facing complex tasks.

[0064] Please see Figure 2 , Figure 2 This is a schematic diagram of a multi-agent task orchestration device based on a hybrid expert model, provided as an embodiment of this application. Figure 2 As shown, the multi-agent task orchestration device 200 includes: The expert model screening module 201 is used to obtain the task request text input by the user and input the task request text into the hybrid expert model so as to determine at least one target expert model from multiple preset expert models according to a preset activation strategy. The orchestration matrix generation module 202 is used to generate an agent orchestration matrix for multiple preset agents based on at least one of the target expert models and the ordered model in the hybrid expert model; The execution process generation module 203 is used to determine at least one target agent for performing the task and the execution order of each target agent from multiple preset agents according to the agent orchestration matrix, so as to generate a multi-agent collaborative execution process corresponding to the task request text.

[0065] Furthermore, when the expert model filtering module 201 inputs the task request text into the hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy, the expert model filtering module 201 is also used for: The task request text is input into the embedding model of the hybrid expert model, and the task request text is converted into a corresponding semantic embedding vector through the embedding model; The semantic embedding vector is input into the routing model of the hybrid expert model, and the routing model calculates the activation probability distribution of each preset expert model based on the softmax function; Based on the activation probability distribution, candidate expert models with activation probabilities greater than or equal to a preset probability threshold are determined from multiple preset expert models. At least one target expert model is determined from the candidate expert models based on the number of candidate expert models and a preset number.

[0066] Furthermore, the hybrid expert model also includes a general expert model, and the expert model screening module 201 is further used for: If there is no candidate expert model among multiple preset expert models whose activation probability is greater than or equal to a preset probability threshold, the general expert model is determined as the target expert model.

[0067] Furthermore, when the orchestration matrix generation module 202 generates an agent orchestration matrix for multiple preset agents based on at least one of the target expert models and the ordered model in the hybrid expert model, the orchestration matrix generation module 202 is also used to: The semantic embedding vector is input into at least one of the target expert models to obtain multiple first prediction vectors, and the multiple first prediction vectors are weighted and averaged to obtain a second prediction vector; wherein, the first prediction vector is used to indicate whether each preset agent participates in task orchestration. The semantic embedding vector is input into the ordering model to obtain a third prediction vector, and the third prediction vector is converted into a position encoding matrix; wherein the number of rows and the width of the position encoding matrix are the same as the number of preset agents; The second prediction vector is concatenated with the position encoding matrix along the column direction to obtain the agent arrangement matrix.

[0068] Furthermore, the multi-agent task orchestration device 200 also includes a model training module, which is used to train the hybrid expert model through the following steps: Obtain training samples; wherein, the training samples include task text samples and corresponding label arrangement matrices; The task text sample is input into the original embedding model of the original hybrid expert model to obtain the embedding vector sample; The embedded vector samples are input into the original routing model of the original hybrid expert model, and at least one activated expert model is determined from the multiple expert models to be trained in the original hybrid expert model. A prediction orchestration matrix for multiple preset agents is generated based on at least one activated expert model and the original integrity model in the original hybrid expert model. Calculate the loss value of all corresponding elements between the prediction orchestration matrix and the label orchestration matrix, and perform backpropagation training on the original embedding model, the original routing model, the activated expert model and the original ordering model based on the loss value until the preset training completion condition is met, and obtain the trained hybrid expert model.

[0069] Furthermore, the model training module is also used for: For each expert model to be trained, the cumulative number of activations of the expert model to be trained is recorded. When the cumulative number of activations is greater than or equal to the threshold, the activation probability of the expert model to be trained is set to zero.

[0070] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device 300 includes a processor 310, a memory 320, and a bus 330.

[0071] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 and the memory 320 communicate via the bus 330. When the machine-readable instructions are executed by the processor 310, they can perform the operations described above. Figure 1 The steps of the multi-agent task orchestration method based on a hybrid expert model in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0072] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the multi-agent task orchestration method based on a hybrid expert model in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0073] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0074] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0075] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0076] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0077] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0078] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, 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 covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A multi-agent task orchestration method based on a hybrid expert model, characterized in that, The multi-agent task orchestration method includes: Obtain the task request text input by the user, and input the task request text into the hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy; Generate an agent orchestration matrix for multiple preset agents based on at least one of the target expert models and the integrator model in the hybrid expert model; Based on the agent orchestration matrix, at least one target agent and the execution order of each target agent are determined from a plurality of preset agents to generate a multi-agent collaborative execution flow corresponding to the task request text.

2. The multi-agent task orchestration method according to claim 1, characterized in that, The step of inputting the task request text into a hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy includes: The task request text is input into the embedding model of the hybrid expert model, and the task request text is converted into a corresponding semantic embedding vector through the embedding model; The semantic embedding vector is input into the routing model of the hybrid expert model, and the routing model calculates the activation probability distribution of each preset expert model based on the softmax function; Based on the activation probability distribution, candidate expert models with activation probabilities greater than or equal to a preset probability threshold are determined from multiple preset expert models. At least one target expert model is determined from the candidate expert models based on the number of candidate expert models and a preset number.

3. The multi-agent task orchestration method according to claim 2, characterized in that, The hybrid expert model also includes a general expert model, and the multi-agent task orchestration method further includes: If there is no candidate expert model among multiple preset expert models whose activation probability is greater than or equal to a preset probability threshold, the general expert model is determined as the target expert model.

4. The multi-agent task orchestration method according to claim 2, characterized in that, The step of generating an agent orchestration matrix for multiple preset agents based on at least one of the target expert models and the ordered model in the hybrid expert model includes: The semantic embedding vector is input into at least one of the target expert models to obtain multiple first prediction vectors, and the multiple first prediction vectors are weighted and averaged to obtain a second prediction vector; wherein, the first prediction vector is used to indicate whether each preset agent participates in task orchestration. The semantic embedding vector is input into the ordering model to obtain a third prediction vector, and the third prediction vector is converted into a position encoding matrix; wherein the number of rows and the width of the position encoding matrix are the same as the number of preset agents; The second prediction vector is concatenated with the position encoding matrix along the column direction to obtain the agent arrangement matrix.

5. The multi-agent task orchestration method according to claim 1, characterized in that, The hybrid expert model is trained using the following steps: Obtain training samples; wherein, the training samples include task text samples and corresponding label arrangement matrices; The task text sample is input into the original embedding model of the original hybrid expert model to obtain the embedding vector sample; The embedded vector samples are input into the original routing model of the original hybrid expert model, and at least one activated expert model is determined from the multiple expert models to be trained in the original hybrid expert model. A prediction orchestration matrix for multiple preset agents is generated based on at least one activated expert model and the original integrity model in the original hybrid expert model. Calculate the loss value of all corresponding elements between the prediction orchestration matrix and the label orchestration matrix, and perform backpropagation training on the original embedding model, the original routing model, the activated expert model and the original ordering model based on the loss value until the preset training completion condition is met, and obtain the trained hybrid expert model.

6. The multi-agent task orchestration method according to claim 5, characterized in that, The multi-agent task orchestration method also includes: For each expert model to be trained, the cumulative number of activations of the expert model to be trained is recorded. When the cumulative number of activations is greater than or equal to the threshold, the activation probability of the expert model to be trained is set to zero.

7. A multi-agent task orchestration device based on a hybrid expert model, characterized in that, The multi-agent task orchestration device includes: The expert model filtering module is used to obtain the task request text input by the user, input the task request text into the hybrid expert model, and determine at least one target expert model from multiple preset expert models according to a preset activation strategy. An orchestration matrix generation module is used to generate an agent orchestration matrix for multiple preset agents based on at least one target expert model and an ordered model in the hybrid expert model. The execution flow generation module is used to determine at least one target agent for performing the task and the execution order of each target agent from multiple preset agents according to the agent orchestration matrix, so as to generate a multi-agent collaborative execution flow corresponding to the task request text.

8. The multi-agent task orchestration device according to claim 7, characterized in that, When the expert model screening module inputs the task request text into a hybrid expert model to determine at least one target expert model from multiple preset expert models according to a preset activation strategy, the expert model screening module is further configured to: The task request text is input into the embedding model of the hybrid expert model, and the task request text is converted into a corresponding semantic embedding vector through the embedding model; The semantic embedding vector is input into the routing model of the hybrid expert model, and the routing model calculates the activation probability distribution of each preset expert model based on the softmax function; Based on the activation probability distribution, candidate expert models with activation probabilities greater than or equal to a preset probability threshold are determined from multiple preset expert models. At least one target expert model is determined from the candidate expert models based on the number of candidate expert models and a preset number.

9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the multi-agent task orchestration method based on any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the multi-agent task orchestration method based on a hybrid expert model as described in any one of claims 1 to 6.