AI agent task tool selection method and device based on optimization algorithm

By generating and cross-mutation operation tool sets based on optimization algorithms, selecting AI agent task tools, solving the problems of large resource consumption and poor immediacy of deep learning models when selecting tools, and achieving more efficient tool selection.

CN118964815AInactive Publication Date: 2024-11-15BEIJING BIG DATA ADVANCED TECH RES INST

Patent Information

Application Number
CN202410959519.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing deep learning model consumes a lot of computing resources when selecting AI agent task tools, poor selection immediacy, accuracy and efficiency.

Method used

Using an optimization algorithm-based method, we generate multiple tool sets to perform cross-mutation operations, determine the fitness based on evaluation indicators and weight values, and select the tool set with the highest fitness as the target tool.

Benefits of technology

Reduces the consumption of computing power resources and improves the immediacy and accuracy of tool selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964815A_ABST
    Figure CN118964815A_ABST
Patent Text Reader

Abstract

The invention provides an AI agent task tool selection method and device based on an optimization algorithm, and the method comprises the steps: responding to a task execution instruction of a target task, and generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools contained in a model library; performing crossover mutation operation on the first tool set individuals to obtain a plurality of second tool set individuals; determining a second evaluation index corresponding to each second tool set individual based on the first evaluation index of the proxy task tool contained in the second tool set individual; based on the second evaluation indexes and the weight values corresponding to the second evaluation indexes, first fitness corresponding to the second tool set individuals is determined; determining a target tool set individual corresponding to the maximum value of the first fitness from the plurality of second tool set individuals; and selecting a target artificial intelligence agent task tool set corresponding to the target tool set individual from the model library.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method and device for selecting an AI agent task tool based on an optimization algorithm. Background Art

[0002] In the past, the problem of tool selection for AI agents when performing complex tasks has always been an important research direction. AI agents perform a variety of tasks through autonomous learning and decision-making. When dealing with complex and dynamically changing task environments, since various types of AI agent task tools usually have different focuses and performance, it is necessary to select appropriate tools.

[0003] In related technologies, AI agents have made significant progress in natural language processing and complex decision support through the emergence of deep learning models (such as large models such as GPT). These large models learn patterns and relationships from large amounts of data, and can adaptively select appropriate agent task tools when faced with different tool selection tasks.

[0004] However, the above method consumes a lot of computing resources in practice, and due to the high computational complexity, the immediacy of the selection is very poor. The accuracy and selection efficiency of using large models to select AI agent task tools are still poor. Summary of the invention

[0005] In view of the above problems, the embodiments of the present application provide an AI agent task tool selection method, device, electronic device and readable storage medium based on an optimization algorithm to overcome the above problems or at least partially solve the above problems.

[0006] In a first aspect, an embodiment of the present application provides an AI agent task tool selection method based on an optimization algorithm, the method comprising:

[0007] In response to a task execution instruction of a target task, generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in a model library;

[0008] Performing a crossover mutation operation on the first tool set individuals to obtain a plurality of second tool set individuals;

[0009] Based on the first evaluation indicators of the proxy task tools included in the second tool set individuals, determining the second evaluation indicators corresponding to the second tool set individuals respectively; wherein the indicator type of the first evaluation indicator corresponds to the task type of the target task;

[0010] Determining first fitness values ​​corresponding to respective individuals of the second tool set based on the second evaluation indicator and the weight values ​​corresponding to the respective second evaluation indicators;

[0011] Determine a target tool set individual corresponding to the maximum value of the first fitness from the plurality of second tool set individuals;

[0012] A target artificial intelligence agent task tool set corresponding to the individual of the target tool set is selected from the model library; wherein the target artificial intelligence agent task tool set is used to execute the target task.

[0013] Optionally, determining a target tool set individual corresponding to the maximum value of the first fitness from the plurality of second tool set individuals comprises:

[0014] Re-execute the step of generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in the model library, so as to iterate the plurality of first tool set individuals to obtain a plurality of iterated first tool set individuals;

[0015] When the number of iterations of the iterated plurality of first tool set individuals reaches a preset number, a target tool set individual corresponding to the maximum value in the first fitness is determined from the plurality of second tool set individuals and the iterated plurality of second tool set individuals.

[0016] Optionally, the indicator types include accuracy, F1 score, reasoning time, and computing resource consumption value, and the first evaluation indicator of the proxy task tool included in the second tool set individual is determined to correspond to each second tool set individual, including:

[0017] Determine the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value respectively corresponding to the proxy task tools included in each of the second tool set individuals; wherein the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value are all included in the first evaluation index;

[0018] Based on the first accuracy rate and the first F1 score, determining a second accuracy rate and a second F1 score corresponding to each of the second tool set individuals;

[0019] Determine, based on the first reasoning time and the first computing resource consumption value, the second reasoning time and the second computing resource consumption value corresponding to each of the second tool set individuals;

[0020] Based on each of the second tool set individuals, the second accuracy, the second F1 score, the second reasoning time, and the second computing resource consumption value are combined to obtain second evaluation indicators corresponding to each of the second tool set individuals.

[0021] Optionally, the determining, based on the first accuracy rate and the first F1 score, second accuracy rates and second F1 scores corresponding to each of the second tool set individuals, respectively, includes:

[0022] Calculating a first average of first accuracy rates of the proxy task tools included in each of the second tool set individuals to obtain second accuracy rates corresponding to each of the second tool set individuals;

[0023] A second average of the first F1 scores of the proxy task tools included in each of the second tool set individuals is calculated to obtain a second F1 score corresponding to each of the second tool set individuals.

[0024] Optionally, determining the second reasoning time and the second computing resource consumption value corresponding to each of the second tool set individuals based on the first reasoning time and the first computing resource consumption value includes:

[0025] Determine the maximum value of the first reasoning times corresponding to the proxy task tools included in each of the second tool set individuals as the second reasoning times corresponding to each of the second tool set individuals;

[0026] The sum of the first computing resource consumption values ​​of the proxy task tools included in each of the second tool set individuals is calculated to obtain the second computing resource consumption values ​​respectively corresponding to each of the second tool set individuals.

[0027] Optionally, the crossover and mutation operation includes a crossover operation and a mutation operation, and the performing the crossover and mutation operation on the first tool set individuals to obtain a plurality of second tool set individuals includes:

[0028] Randomly exchange the artificial intelligence agent task tools included in at least two of the first tool set individuals to obtain a third tool set individual;

[0029] Randomly replace at least one artificial intelligence agent task tool included in the first tool set individual with another artificial intelligence agent task tool to obtain a fourth tool set individual;

[0030] The first toolset individual, the third toolset individual and the fourth toolset individual that have not been subjected to a crossover operation or a mutation operation are determined as second toolset individuals.

[0031] Optionally, the determining the first fitness corresponding to each of the individuals in the second tool set based on the second evaluation indicator and the weight value corresponding to each of the second evaluation indicators includes:

[0032] Determining a weight value corresponding to the second evaluation indicator based on the indicator type of the second evaluation indicator;

[0033] Based on the weight value, the second evaluation indicators corresponding to each of the individuals in the second tool set are weighted and summed to obtain the first fitness corresponding to each of the individuals in the second tool set.

[0034] Optionally, the generating of a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in the model library includes:

[0035] obtaining a first tool quantity for the tool combination;

[0036] The first number of first tools is extracted from a plurality of artificial intelligence agent task tools included in the model library and combined to obtain a plurality of first tool set individuals.

[0037] Optionally, the method further comprises:

[0038] Performing semantic recognition on the task execution instruction to determine the task action keywords of the target task;

[0039] Based on the task action keywords, the task type corresponding to the target task is determined.

[0040] In a second aspect, an embodiment of the present application provides an AI agent task tool selection device based on an optimization algorithm, characterized in that the device comprises:

[0041] A generation module, for generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in a model library in response to a task execution instruction of a target task;

[0042] A crossover and mutation module, used for performing a crossover and mutation operation on the first tool set individuals to obtain a plurality of second tool set individuals;

[0043] A first determination module is used to determine the second evaluation indicators corresponding to each of the second tool set individuals based on the first evaluation indicators of the proxy task tools included in the second tool set individuals; wherein the indicator type of the first evaluation indicator corresponds to the task type of the target task;

[0044] A second determination module, configured to determine the first fitness corresponding to each of the individuals in the second tool set based on the second evaluation indicator and the weight values ​​corresponding to each of the second evaluation indicators;

[0045] A third determination module is used to determine a target tool set individual corresponding to the maximum value of the first fitness from the plurality of second tool set individuals;

[0046] A selection module is used to select a target artificial intelligence agent task tool set corresponding to the individual of the target tool set from the model library; wherein the target artificial intelligence agent task tool set is used to execute the target task.

[0047] Optionally, the third determining module includes:

[0048] An execution submodule, for re-executing the step of generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in the model library, so as to iterate the plurality of first tool set individuals to obtain a plurality of iterated first tool set individuals;

[0049] The first determination submodule is used to determine a target toolset individual corresponding to the maximum value in the first fitness from the plurality of second toolset individuals and the plurality of second toolset individuals after iteration when the number of iterations of the plurality of first toolset individuals after iteration reaches a preset number.

[0050] Optionally, the indicator types include accuracy, F1 score, inference time, and computing resource consumption value, and the first determination module includes:

[0051] A second determination submodule is used to determine the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value respectively corresponding to the proxy task tools included in each of the second tool set individuals; wherein the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value are all included in the first evaluation index;

[0052] A third determination submodule, configured to determine, based on the first accuracy rate and the first F1 score, second accuracy rates and second F1 scores corresponding to each of the second tool set individuals;

[0053] A fourth determination submodule, configured to determine, based on the first reasoning time and the first computing resource consumption value, second reasoning times and second computing resource consumption values ​​corresponding to each of the second tool set individuals;

[0054] The first combination submodule is used to combine the second accuracy, the second F1 score, the second reasoning time and the second computing resource consumption value based on each of the second tool set individuals to obtain the second evaluation indicators corresponding to each of the second tool set individuals.

[0055] Optionally, the third determining submodule includes:

[0056] A first calculation unit is used to calculate a first average of first accuracy rates of the proxy task tools included in each of the second tool set individuals to obtain second accuracy rates corresponding to each of the second tool set individuals;

[0057] The second calculation unit is used to calculate a second average of the first F1 scores of the proxy task tools included in each of the second tool set individuals to obtain a second F1 score corresponding to each of the second tool set individuals.

[0058] Optionally, the fourth determining submodule includes:

[0059] A third calculation unit is used to determine the maximum value of the first reasoning times corresponding to the proxy task tools included in each of the second tool set individuals as the second reasoning time corresponding to each of the second tool set individuals;

[0060] The fourth calculation unit is used to calculate the sum of the first computing resource consumption values ​​of the proxy task tools included in each of the second tool set individuals, and obtain the second computing resource consumption values ​​corresponding to each of the second tool set individuals.

[0061] Optionally, the crossover-mutation operation includes a crossover operation and a mutation operation, and the crossover-mutation module includes:

[0062] A crossover submodule, used for randomly exchanging the artificial intelligence agent task tools included in at least two of the first tool set individuals to obtain a third tool set individual;

[0063] a mutation submodule, used to randomly replace at least one artificial intelligence agent task tool included in the first tool set individual with another artificial intelligence agent task tool to obtain a fourth tool set individual;

[0064] The fifth determination submodule is used to determine the first tool set individuals that have not been subjected to the crossover operation or the mutation operation, the third tool set individuals, and the fourth tool set individuals as the second tool set individuals.

[0065] Optionally, the second determining module includes:

[0066] a sixth determination submodule, configured to determine a weight value corresponding to the second evaluation indicator based on the indicator type of the second evaluation indicator;

[0067] The seventh determination submodule is used to perform weighted summation of the second evaluation indicators corresponding to each of the individuals in the second tool set based on the weight value to obtain the first fitness corresponding to each of the individuals in the second tool set.

[0068] Optionally, the generating module includes:

[0069] An acquisition submodule, used for acquiring a first tool quantity for the tool combination;

[0070] The second combining submodule is used to extract the first number of first tools from the multiple artificial intelligence agent task tools included in the model library and combine them to obtain multiple first tool set individuals.

[0071] Optionally, the device further comprises:

[0072] A semantic recognition module, used to perform semantic recognition on the task execution instruction and determine the task action keywords of the target task;

[0073] The fourth determination module is used to determine the task type corresponding to the target task based on the task action keyword.

[0074] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the AI ​​agent task tool selection method based on the optimization algorithm as described in any one of the above.

[0075] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the method for selecting an AI agent task tool based on an optimization algorithm as described in any one of the above is implemented.

[0076] The specific beneficial effects are:

[0077] In the embodiment of the present application, in response to the task execution instruction of the target task, based on the multiple artificial intelligence agent task tools included in the model library, multiple first tool set individuals are generated, cross-mutation operations are performed on the first tool set individuals to obtain multiple second tool set individuals, and the second evaluation indicators corresponding to each second tool set individual are determined based on the first evaluation indicators of the agent task tools included in the second tool set individuals; wherein the indicator type of the first evaluation indicator corresponds to the task type of the target task, and the first fitness corresponding to each second tool set individual is determined based on the second evaluation indicator and the weight values ​​corresponding to each second evaluation indicator, and the target tool set individual corresponding to the maximum value of the first fitness is determined from the multiple second tool set individuals, and the target artificial intelligence agent task tool set corresponding to the target tool set individual is selected from the model library; wherein the target artificial intelligence agent task tool set is used to execute the target task, and can be selected according to the task execution instruction of the target task by using an optimization algorithm to obtain the target tool set individual with the largest first fitness, so that the target artificial intelligence agent task tool set can be selected and used to execute the target task. Since the computational complexity of the optimization algorithm is much smaller than the computational complexity of the large model, the above method can reduce the consumption of computing resources to a certain extent, and can also improve the immediacy of agent tool selection. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0079] Figure 1 It is a flowchart of an AI agent task tool selection method based on an optimization algorithm provided in an embodiment of the present application;

[0080] Figure 2 It is a flowchart of another AI agent task tool selection method based on optimization algorithm provided in an embodiment of the present application;

[0081] Figure 3 It is a flowchart of a target task execution method based on an AI agent task tool provided in an embodiment of the present application;

[0082] Figure 4 It is a logic block diagram of an AI agent task tool selection device based on an optimization algorithm provided in an embodiment of the present application;

[0083] Figure 5 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0084] The exemplary embodiments of the present application will be described in more detail below in conjunction with the accompanying drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to enable the scope of the present application to be fully communicated to those skilled in the art.

[0085] Reference Figure 1 , Figure 1 A flowchart of a method for selecting an AI agent task tool based on an optimization algorithm provided in an embodiment of the present application, the method comprising:

[0086] Step 101, in response to the task execution instruction of the target task, generate multiple first tool set individuals based on multiple artificial intelligence agent task tools included in the model library.

[0087] In an embodiment of the present application, a variety of different artificial intelligence (AI) agent task tools can be stored in the model library, and the model library can be connected to the control center so that the control center can call the AI ​​agent task tools in the model library to perform various tasks. Among them, the AI ​​agent (Agent) is a program or system that uses artificial intelligence technology and algorithms to perform specific tasks, solve problems or achieve goals. These agents can be simple programs or complex systems, such as large models such as AutoGPT and BabyAGI, which are designed to simulate and perform tasks similar to human intelligence, or even surpass the capabilities of human intelligence in some cases; the control center can be hardware or software with data processing capabilities, such as cloud platforms, large language models, graphics processing units, etc. The user can send a task execution instruction for the target task to the control center, and the control center can respond to the task execution instruction and generate multiple first tool set individuals according to the multiple artificial intelligence agent task tools contained in the connected model library. Among them, the number of artificial intelligence agent task tools contained in the first tool set individuals can be specified by the user, or it can be randomly determined by the control center.

[0088] Step 102: performing a crossover mutation operation on the first tool set individuals to obtain a plurality of second tool set individuals.

[0089] In an embodiment of the present application, a crossover mutation operation can be performed on the generated multiple first tool set individuals, so as to obtain multiple second tool set individuals. The number of first tool set individuals that perform the crossover mutation operation can be randomly determined or pre-set by an administrator. After the crossover mutation operation is performed, the diversity of individuals can be increased, and individuals can be prevented from falling into a local optimum.

[0090] Step 103, based on the first evaluation indicators of the proxy task tools included in the second tool set individuals, determine the second evaluation indicators corresponding to each of the second tool set individuals; wherein the indicator type of the first evaluation indicator corresponds to the task type of the target task.

[0091] In the embodiment of the present application, each AI agent task tool has its own evaluation index, so the second evaluation index corresponding to each of the second tool set individuals can be determined based on the first evaluation index of the agent task tool included in the second tool set individuals. Among them, the processing effects of each artificial intelligence agent task tool on different tasks are generally different, so the indicator type of the first evaluation index can correspond to the task type of the target task, so that the first evaluation index can more accurately evaluate the processing ability of the agent task tool for the target task.

[0092] For example, if the task type of the target task is to identify animals in pictures, the first evaluation index of the generation class proxy task tool will be lower than the first evaluation index of the target recognition class proxy task tool (that is, the generation class proxy task tool cannot correctly perform target recognition); if the task type of the target task is to repair pictures, the first evaluation index of the image generation class proxy task tool will be higher than the first evaluation index of the target recognition class proxy task tool.

[0093] Step 104: Determine the first fitness corresponding to each of the individuals in the second tool set based on the second evaluation indicator and the weight value corresponding to each of the second evaluation indicators.

[0094] In the embodiment of the present application, the second evaluation index may include multiple types of indicators, and for each type of indicator, a corresponding weight value may be pre-set, so that the first fitness corresponding to each second tool set individual may be calculated and determined according to the second evaluation index and the weight value corresponding to the second evaluation index. The sum of the weight values ​​corresponding to all types of evaluation indicators may be 1. In addition, when calculating the first fitness, all evaluation indicators may be normalized, and the normalization method may be set by the user, which is not limited by the embodiment of the present application.

[0095] Step 105 : determining a target tool set individual corresponding to the maximum value of the first fitness from the plurality of second tool set individuals.

[0096] In an embodiment of the present application, after calculating the first fitness corresponding to each of the second tool set individuals, a target tool set individual corresponding to the maximum value of the first fitness can be screened from multiple second tool set individuals according to the size of the first fitness.

[0097] Step 106, select a target artificial intelligence agent task tool set corresponding to the individual of the target tool set from the model library; wherein the target artificial intelligence agent task tool set is used to execute the target task.

[0098] In an embodiment of the present application, after obtaining the target tool set individuals, the target artificial intelligence agent task tool set corresponding to the target tool set individuals can be selected from the model library so that the control center can use the agent task tools in the target artificial intelligence agent task tool set to perform the target task.

[0099] In an embodiment of the present application, by responding to a task execution instruction of a target task, based on a plurality of artificial intelligence agent task tools included in a model library, a plurality of first tool set individuals are generated, a crossover mutation operation is performed on the first tool set individuals to obtain a plurality of second tool set individuals, and based on the first evaluation indicators of the agent task tools included in the second tool set individuals, the second evaluation indicators corresponding to each second tool set individual are determined; wherein the indicator type of the first evaluation indicator corresponds to the task type of the target task, and based on the second evaluation indicator and the weight values ​​corresponding to each second evaluation indicator, the first fitness corresponding to each second tool set individual is determined, and the target tool set individual corresponding to the maximum value of the first fitness is determined from the plurality of second tool set individuals, and the target artificial intelligence agent task tool set corresponding to the target tool set individual is selected from the model library; wherein the target artificial intelligence agent task tool set is used to execute the target task, and can be screened according to the task execution instruction of the target task by using an optimization algorithm to obtain the target tool set individual with the largest first fitness, so that the target artificial intelligence agent task tool set can be selected and used to execute the target task, and since the computational complexity of the optimization algorithm is much smaller than the computational complexity of the large model, the above method can reduce the consumption of computing resources to a certain extent, and at the same time can improve the immediacy of agent tool selection.

[0100] Reference Figure 2 , Figure 2 A flowchart of another AI agent task tool selection method based on an optimization algorithm provided in an embodiment of the present application, the method may include:

[0101] Step 201, in response to the task execution instruction of the target task, generate multiple first tool set individuals based on multiple artificial intelligence agent task tools included in the model library.

[0102] In the embodiments of the present application, the implementation content of this step can refer to the embodiment content of step 101, which will not be repeated here.

[0103] Optionally, step 201 may include the following sub-steps:

[0104] Sub-step 2011, obtaining the first tool quantity for the tool combination.

[0105] In an embodiment of the present application, the first number of tools for the tool combination can be preset and stored in a storage device. The tool combination refers to the process of combining multiple AI agent task tools. The control center can read the first number of tools for the tool combination in the storage device, or obtain the first number of tools specified by the user.

[0106] Sub-step 2012, extracting the first number of first tools from the multiple artificial intelligence agent task tools included in the model library and combining them to obtain multiple first tool set individuals.

[0107] In an embodiment of the present application, a first number of first tools can be extracted from a plurality of artificial intelligence agent task tools included in the model library, and the first tools can be combined to obtain a plurality of first tool set individuals. The number of extracted first tools is equal to the number of first tools, and a random extraction method can be used for extraction. In addition, each round of extraction can form a first tool set individual, and after multiple rounds of extraction, multiple first tool set individuals can be obtained.

[0108] For example, if the number of first tools is 2, then 2 first tools can be extracted from the multiple artificial intelligence agent task tools included in the model library and combined to obtain a first tool set individual. Repeat the extraction multiple times, and each time you extract 2 first tools, you can extract and combine them, and then you can get multiple first tool set individuals. Obviously, the number of first tool set individuals can be the same as the number of extraction rounds.

[0109] In an embodiment of the present application, by obtaining the first tool quantity for the tool combination, the first tools of the first tool quantity are extracted from the multiple artificial intelligence agent task tools contained in the model library and combined to obtain multiple first tool set individuals. Then, the first tool set individuals containing the first tool quantity of artificial intelligence agent task tools can be generated according to demand, thereby avoiding the generation of unnecessary redundant individuals, reducing the selection time of the artificial intelligence agent task tools to a certain extent, and improving the selection efficiency of the artificial intelligence agent task tools.

[0110] Step 202: performing a crossover mutation operation on the first tool set individuals to obtain a plurality of second tool set individuals.

[0111] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 102, which will not be repeated here.

[0112] Optionally, step 202 may include the following sub-steps:

[0113] Sub-step 2021, randomly exchange the artificial intelligence agent task tools included in at least two of the first tool set individuals to obtain a third tool set individual.

[0114] In an embodiment of the present application, a crossover-mutation operation may include a crossover operation and a mutation operation, wherein a crossover operation may be to randomly exchange artificial intelligence agent task tools contained in at least two first tool set individuals to obtain a third tool set individual.

[0115] For example, if there are two first tool set individuals, namely {Tool 1, Tool 2} and {Tool 3, Tool 4}, then after random exchange, the third tool set individuals can be {Tool 1, Tool 3} and {Tool 2, Tool 4}; if three first tool set individuals are cross-operated and the third first tool set individual is {Tool 5, Tool 6}, then the third tool set individuals can be {Tool 1, Tool 3}, {Tool 6, Tool 4} and {Tool 2, Tool 5}.

[0116] Sub-step 2022: randomly replace at least one artificial intelligence agent task tool included in the first tool set individual with another artificial intelligence agent task tool to obtain a fourth tool set individual.

[0117] In an embodiment of the present application, the mutation operation may be to randomly replace an artificial intelligence agent task tool included in at least one first tool set individual with another artificial intelligence agent task tool to obtain a fourth tool set individual.

[0118] For example, if the first tool set individual is {tool 1, tool 2}, then after the mutation operation, the fourth tool set individual obtained may be {tool 1, tool 3} or {tool 1, tool 4}.

[0119] Sub-step 2023: determining the first toolset individuals, the third toolset individuals and the fourth toolset individuals that have not been subjected to the crossover operation or the mutation operation as the second toolset individuals.

[0120] In the embodiments of the present application, there are usually a certain number of first tool set individuals that have not undergone crossover or mutation operations. Therefore, the first tool set individuals that have not undergone crossover or mutation operations, the third tool set individuals obtained by performing crossover operations, and the fourth tool set individuals obtained by performing mutation operations can be collectively determined as second tool set individuals. If all first tool set individuals have undergone crossover and mutation operations, the third tool set individuals and the fourth tool set individuals can be uniformly determined as second tool set individuals.

[0121] In an embodiment of the present application, the artificial intelligence agent task tools included in at least two first tool set individuals are randomly exchanged to obtain a third tool set individual, and the artificial intelligence agent task tool included in at least one first tool set individual is randomly replaced with another artificial intelligence agent task tool to obtain a fourth tool set individual. The first tool set individuals, the third tool set individuals, and the fourth tool set individuals that have not undergone crossover or mutation operations are determined as second tool set individuals. The first tool set individuals can be crossover or mutation operations can be performed to finally obtain second tool set individuals, thereby improving the data richness of the second tool set individuals and avoiding the final result from falling into a local optimum.

[0122] Step 203: perform semantic recognition on the task execution instruction to determine the task action keywords of the target task.

[0123] In the embodiment of the present application, the task execution instruction is usually input into the control center in natural language, so the task execution instruction can be semantically recognized to determine the task action keyword of the target task, where the action keyword may refer to the action of executing the target task.

[0124] For example, if the task execution instruction is "Please identify all animal types in the picture", then the task action keyword is "Identify animal types"; if the task execution instruction is "Please increase the image resolution of the picture", then the character action keyword is "Increase image resolution".

[0125] Step 204: Determine the task type corresponding to the target task based on the task action keyword.

[0126] In an embodiment of the present application, the task type corresponding to the target task can be determined according to the task action keywords of the task execution instruction, wherein the task type can correspond to multiple artificial intelligence agent task tools in the model library.

[0127] Continuing with the above example, if the task action keyword is "identify animal type", then the task type of the target task is "target recognition"; if the task action keyword is "increase image resolution", then the task type of the target task is "image generation".

[0128] In an embodiment of the present application, by performing semantic recognition on task execution instructions, the task action keywords of the target task are determined, and based on the task action keywords, the task type corresponding to the target task is determined. The task type of the target task can be determined according to the task instructions of the target task, thereby improving the accuracy of the target task type and improving the accuracy and usability of the final target artificial intelligence agent task tool set.

[0129] Step 205, based on the first evaluation indicators of the proxy task tools included in the second tool set individuals, determine the second evaluation indicators corresponding to each of the second tool set individuals; wherein the indicator type of the first evaluation indicator corresponds to the task type of the target task.

[0130] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 103, which will not be repeated here.

[0131] Optionally, step 205 may include the following sub-steps:

[0132] Sub-step 2051, determines the first accuracy rate, first F1 score, first reasoning time and first computing resource consumption value respectively corresponding to the proxy task tools contained in each individual of the second tool set; wherein the first accuracy rate, the first F1 score, the first reasoning time and the first computing resource consumption value are all included in the first evaluation indicator.

[0133] In an embodiment of the present application, accuracy refers to the probability that the result obtained by the artificial intelligence agent task tool matches the expected result, and the F1 score can be an indicator used in statistics to measure the accuracy of a binary classification model. It takes into account both the accuracy and recall of the classification model. The F1 score can be regarded as a harmonic average of the model accuracy and recall, with a maximum value of 1 and a minimum value of 0. Reasoning time refers to the time required for an artificial intelligence agent task tool to perform a task. The computing power resource consumption value refers to the computing power resources required for an artificial intelligence agent task tool to perform a task. Each artificial intelligence agent task tool in the model library can include four evaluation indicators: accuracy, F1 score, reasoning time, and computing power resource consumption value. On this basis, the first accuracy, first F1 score, first reasoning time, and first computing power resource consumption value corresponding to the agent task tools contained in each second tool set individual can be determined first.

[0134] Sub-step 2052: determining, based on the first accuracy rate and the first F1 score, second accuracy rates and second F1 scores corresponding to each of the second tool set individuals.

[0135] In an embodiment of the present application, the second accuracy and the second F1 score corresponding to each second tool set individual can be determined according to the first accuracy and the first F1 score. The second accuracy can be the arithmetic mean of the first accuracy, and the second F1 score can be the arithmetic mean of the first F1 score. In addition, the second accuracy can also be obtained by normalizing the sum of the first accuracy, and the second F1 score can also be obtained by normalizing the sum of the first F1 scores.

[0136] Optionally, sub-step 2052 may include the following sub-steps:

[0137] Sub-step A1: calculating a first average of first accuracy rates of the proxy task tools included in each of the second tool set individuals, to obtain second accuracy rates corresponding to each of the second tool set individuals.

[0138] In an embodiment of the present application, a first average value of the first accuracy of the proxy task tools included in the second tool set individual can be calculated, and the first average value is used as the second accuracy of the second tool set individual. By traversing all the second tool set individuals according to the above method, the second accuracy corresponding to each second tool set individual can be obtained.

[0139] Sub-step A2: calculating a second average of the first F1 scores of the proxy task tools included in each of the second tool set individuals to obtain a second F1 score corresponding to each of the second tool set individuals.

[0140] In an embodiment of the present application, the second average of the first F1 scores of the proxy task tools included in the second tool set individual can be calculated, and the second average is used as the second F1 score of the second tool set individual. By traversing all the second tool set individuals according to the above method, the second F1 scores corresponding to each second tool set individual can be obtained.

[0141] In an embodiment of the present application, by calculating the first average of the first accuracy rates of the proxy task tools included in each second tool set individual, the second accuracy rates corresponding to each second tool set individual are obtained, and by calculating the second average of the first F1 scores of the proxy task tools included in each second tool set individual, the second F1 scores corresponding to each second tool set individual are obtained. The second accuracy rates and second F1 scores corresponding to each second tool set individual can be calculated by averaging, thereby improving the accuracy and availability of the second accuracy rates and second F1 scores.

[0142] Sub-step 2053, based on the first reasoning time and the first computing resource consumption value, determine the second reasoning time and the second computing resource consumption value corresponding to each of the second tool set individuals.

[0143] In an embodiment of the present application, the second reasoning time and the second computing resource consumption value corresponding to each second tool set individual can be determined according to the first reasoning time and the first computing resource consumption value. The second reasoning time can be the sum of the first reasoning time, and the second computing resource consumption value can be the maximum value of the first computing resource consumption value, or the second reasoning time can be the maximum value of the first reasoning time, and the second computing resource consumption value can be the sum of the first computing resource consumption value.

[0144] Optionally, sub-step 2053 may include the following sub-steps:

[0145] Sub-step B1: determining the maximum value of the first reasoning times corresponding to the proxy task tools included in each of the second tool set individuals as the second reasoning time corresponding to each of the second tool set individuals.

[0146] In an embodiment of the present application, the maximum value of the first reasoning time corresponding to the proxy task tools included in the second tool set individual can be determined, and then the maximum value is used as the second reasoning time corresponding to the second tool set individual. By traversing all the second tool set individuals according to the above method, the second reasoning time corresponding to each second tool set individual can be obtained.

[0147] Sub-step B2, calculating the sum of the first computing resource consumption values ​​of the proxy task tools included in each of the second tool set individuals, and obtaining the second computing resource consumption values ​​corresponding to each of the second tool set individuals.

[0148] In an embodiment of the present application, the sum of the first computing resource consumption values ​​of the proxy task tools included in the second tool set individuals can be calculated, and the sum value can be used as the second computing resource consumption value corresponding to the second tool set individuals. By traversing all the second tool set individuals according to the above method, the second computing resource consumption values ​​corresponding to each second tool set individual can be obtained.

[0149] In an embodiment of the present application, by determining the maximum value of the first reasoning time corresponding to the proxy task tools included in each second tool set individual as the second reasoning time corresponding to each second tool set individual, the sum of the first computing power resource consumption values ​​of the proxy task tools included in each second tool set individual is calculated to obtain the second computing power resource consumption value corresponding to each second tool set individual. The maximum value of the first reasoning time can be determined as the second reasoning time of the second tool set individual, and the sum of the first computing power resource consumption values ​​can be determined as the second computing power resource consumption value of the second tool set individual, thereby improving the accuracy and availability of the second reasoning time and the second computing power resource consumption value.

[0150] Sub-step 2054, based on each of the second tool set individuals, the second accuracy, the second F1 score, the second reasoning time and the second computing resource consumption value are combined to obtain second evaluation indicators corresponding to each of the second tool set individuals.

[0151] In an embodiment of the present application, the second accuracy, second F1 score, second reasoning time, and second computing resource consumption value can be combined according to each second tool set individual to obtain the second evaluation index corresponding to each second tool set individual. Specifically, for any second tool set individual, the second accuracy, second F1 score, second reasoning time, and second computing resource consumption value corresponding to the second tool set individual can be summarized into a mathematical set and combined as the second evaluation index of the second tool set individual. By traversing all the second tool set individuals according to the above method, the second evaluation index corresponding to each second tool set individual can be obtained.

[0152] In an embodiment of the present application, by determining the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value respectively corresponding to the proxy task tools included in each second tool set individual; wherein the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value are all included in the first evaluation index, based on the first accuracy rate and the first F1 score, the second accuracy rate and the second F1 score respectively corresponding to each second tool set individual are determined, based on the first reasoning time and the first computing resource consumption value, the second reasoning time and the second computing resource consumption value respectively corresponding to each second tool set individual are determined, based on each second tool set individual, the second accuracy rate, the second F1 score, the second reasoning time, and the second computing resource consumption value are combined to obtain the second evaluation index respectively corresponding to each second tool set individual, and the second accuracy rate, the second F1 score, the second reasoning time, and the second computing resource consumption value of the corresponding second tool set individual can be determined according to the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value of each proxy task tool included in the second tool set individual, thereby improving the accuracy and reliability of the second evaluation index of the second tool set individual.

[0153] Step 206: Determine the first fitness corresponding to each of the individuals in the second tool set based on the second evaluation indicator and the weight value corresponding to each of the second evaluation indicators.

[0154] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 104, which will not be repeated here.

[0155] Optionally, step 206 may include the following sub-steps:

[0156] Sub-step 2061: determining a weight value corresponding to the second evaluation indicator based on the indicator type of the second evaluation indicator.

[0157] In the embodiment of the present application, each indicator type may have a corresponding weight value, so that the weight values ​​corresponding to each second evaluation indicator may be determined according to the indicator type of the second evaluation indicator. It should be noted that, since the indicator types of each second evaluation indicator are the same, the weight values ​​corresponding to each second evaluation indicator may also be the same.

[0158] For example, the weight value of accuracy can be 0.25, the weight value of F1 score can be 0.25, the weight value of inference time can be 0.3, and the weight value of computing resource consumption can be 0.2. Then the weight value corresponding to the second evaluation indicator can be {0.25, 0.25, 0.3, 0.2}.

[0159] Sub-step 2062: Based on the weight value, weighted sum of the second evaluation indicators corresponding to each of the individuals in the second tool set is performed to obtain the first fitness corresponding to each of the individuals in the second tool set.

[0160] In an embodiment of the present application, the second evaluation indicators corresponding to the second tool set individuals may be weighted and summed according to the weight values ​​corresponding to the second tool set individuals, so as to obtain the first fitness corresponding to the second tool set individuals.

[0161] Continuing with the above example, if the weight values ​​are {0.25, 0.25, 0.3, 0.2} and the second evaluation index is {0.98, 0.96, 20, 5}, the first fitness is 0.25×0.98+0.25×0.96+0.3×20+0.2×5=7.485.

[0162] In a possible embodiment, before weighted summing the second evaluation indicators corresponding to the second tool set individuals, the second evaluation indicators may be normalized. Since the accuracy and F1 score range from (0, 1), the accuracy and F1 score do not need to be normalized. When normalizing the inference time and computing power resource consumption values, a softmax function or other normalization function may be used for normalization, or the administrator may pre-set the upper limit of the inference time and computing power resource consumption value, and then divide the inference time and computing power resource consumption value by the upper limit value to normalize the inference time and computing power resource consumption value.

[0163] In an embodiment of the present application, a weight value corresponding to the second evaluation indicator is determined based on the indicator type of the second evaluation indicator, and based on the weight value, the second evaluation indicators corresponding to each individual of the second tool set are weighted and summed to obtain the first fitness corresponding to each individual of the second tool set. The first fitness corresponding to each individual of the second tool set can be calculated according to the weight value corresponding to the indicator type of the second evaluation indicator and the second evaluation indicator, thereby improving the accuracy and reliability of the first fitness.

[0164] Step 207, re-execute the step of generating multiple first tool set individuals based on the multiple artificial intelligence agent task tools contained in the model library, so as to iterate the multiple first tool set individuals to obtain multiple first tool set individuals after iteration.

[0165] In an embodiment of the present application, after obtaining the first fitness of the second tool set individual, since the second tool set individual may not contain a tool set individual that meets the fitness requirements of the target task at this time, the step of "generating multiple first tool set individuals based on multiple artificial intelligence agent task tools included in the model library" can be re-executed to iterate the first tool set individuals to increase the data diversity of the tool set individuals and avoid local optimality.

[0166] Step 208, when the number of iterations of the iterated plurality of first tool set individuals reaches a preset number, determining a target tool set individual corresponding to the maximum value in the first fitness from the plurality of second tool set individuals and the iterated plurality of second tool set individuals.

[0167] In an embodiment of the present application, after multiple iterations of the first tool set individuals, if the number of iterations of the multiple first tool set individuals after iteration reaches a preset number, a target tool set individual corresponding to the maximum value of the first fitness can be screened from the multiple second tool set individuals and the multiple second tool set individuals after iteration.

[0168] In an embodiment of the present application, the step of generating multiple first tool set individuals based on multiple artificial intelligence agent task tools included in the model library is re-executed to iterate the multiple first tool set individuals to obtain multiple first tool set individuals after iteration. When the number of iterations of the multiple first tool set individuals after iteration reaches a preset number, the target tool set individual corresponding to the maximum value in the first fitness is determined from the multiple second tool set individuals and the multiple second tool set individuals after iteration. The first tool set individuals can be iterated, and the target tool set individuals can be screened after the iteration, thereby improving the conformity and reliability of the target tool set individuals with the target tasks.

[0169] Step 209, select a target artificial intelligence agent task tool set corresponding to the individual of the target tool set from the model library; wherein the target artificial intelligence agent task tool set is used to execute the target task.

[0170] In the embodiment of the present application, the implementation content of this step can refer to the implementation content of step 106, which will not be repeated here.

[0171] Reference Figure 3 , Figure 3It is a flow chart of a target task execution method based on an AI agent task tool provided by an embodiment of the present application. In the figure, the target task execution method based on the AI ​​agent task tool may include steps such as target task, task planning, model selection, task execution, response generation, and display results. The target task refers to inputting the natural language text corresponding to the target task into the large language model; task planning means that the large language model can perform semantic recognition on the natural language text corresponding to the target task, so as to judge the task type of the target task, and then plan the task goal according to the task type; model selection means that the large language model can select a suitable model from the model library through an optimization algorithm according to the task type to form a model combination; task execution means that the large language model can execute the target task according to the selected model combination; response generation means that the large language model can generate the task result of the target task according to the output of the model combination after the model combination completes the target task; displaying the result means that after the task result is generated, the task result can be displayed to the user.

[0172] Reference Figure 4 , Figure 4 A logical block diagram of an AI agent task tool selection device based on an optimization algorithm provided in an embodiment of the present application, the device 400 may include:

[0173] A generation module 401 is used to generate a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in a model library in response to a task execution instruction of a target task;

[0174] A crossover and mutation module 402 is used to perform a crossover and mutation operation on the first tool set individuals to obtain a plurality of second tool set individuals;

[0175] A first determination module 403 is used to determine the second evaluation indicators corresponding to each of the second tool set individuals based on the first evaluation indicators of the proxy task tools included in the second tool set individuals; wherein the indicator type of the first evaluation indicator corresponds to the task type of the target task;

[0176] A second determination module 404 is used to determine the first fitness corresponding to each of the second tool set individuals based on the second evaluation index and the weight value corresponding to each of the second evaluation indexes;

[0177] A third determination module 405 is used to determine a target tool set individual corresponding to the maximum value of the first fitness from the plurality of second tool set individuals;

[0178] A selection module 406 is used to select a target artificial intelligence agent task tool set corresponding to the individual of the target tool set from the model library; wherein the target artificial intelligence agent task tool set is used to execute the target task.

[0179] Optionally, the third determining module 405 includes:

[0180] An execution submodule, for re-executing the step of generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in the model library, so as to iterate the plurality of first tool set individuals to obtain a plurality of iterated first tool set individuals;

[0181] The first determination submodule is used to determine a target toolset individual corresponding to the maximum value in the first fitness from the plurality of second toolset individuals and the plurality of second toolset individuals after iteration when the number of iterations of the plurality of first toolset individuals after iteration reaches a preset number.

[0182] Optionally, the indicator types include accuracy, F1 score, inference time, and computing resource consumption value. The first determination module 403 includes:

[0183] A second determination submodule is used to determine the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value respectively corresponding to the proxy task tools included in each of the second tool set individuals; wherein the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value are all included in the first evaluation index;

[0184] A third determination submodule, configured to determine, based on the first accuracy rate and the first F1 score, second accuracy rates and second F1 scores corresponding to each of the second tool set individuals;

[0185] A fourth determination submodule, configured to determine, based on the first reasoning time and the first computing resource consumption value, second reasoning times and second computing resource consumption values ​​corresponding to each of the second tool set individuals;

[0186] The first combination submodule is used to combine the second accuracy, the second F1 score, the second reasoning time and the second computing resource consumption value based on each of the second tool set individuals to obtain the second evaluation indicators corresponding to each of the second tool set individuals.

[0187] Optionally, the third determining submodule includes:

[0188] A first calculation unit is used to calculate a first average of first accuracy rates of the proxy task tools included in each of the second tool set individuals to obtain second accuracy rates corresponding to each of the second tool set individuals;

[0189] The second calculation unit is used to calculate a second average of the first F1 scores of the proxy task tools included in each of the second tool set individuals to obtain a second F1 score corresponding to each of the second tool set individuals.

[0190] Optionally, the fourth determining submodule includes:

[0191] A third calculation unit is used to determine the maximum value of the first reasoning times corresponding to the proxy task tools included in each of the second tool set individuals as the second reasoning time corresponding to each of the second tool set individuals;

[0192] The fourth calculation unit is used to calculate the sum of the first computing resource consumption values ​​of the proxy task tools included in each of the second tool set individuals, and obtain the second computing resource consumption values ​​corresponding to each of the second tool set individuals.

[0193] Optionally, the crossover and mutation operation includes a crossover operation and a mutation operation, and the crossover and mutation module 402 includes:

[0194] A crossover submodule, used for randomly exchanging the artificial intelligence agent task tools included in at least two of the first tool set individuals to obtain a third tool set individual;

[0195] a mutation submodule, used to randomly replace at least one artificial intelligence agent task tool included in the first tool set individual with another artificial intelligence agent task tool to obtain a fourth tool set individual;

[0196] The fifth determination submodule is used to determine the first tool set individuals that have not been subjected to the crossover operation or the mutation operation, the third tool set individuals, and the fourth tool set individuals as the second tool set individuals.

[0197] Optionally, the second determining module 404 includes:

[0198] a sixth determination submodule, configured to determine a weight value corresponding to the second evaluation indicator based on the indicator type of the second evaluation indicator;

[0199] The seventh determination submodule is used to perform weighted summation of the second evaluation indicators corresponding to each of the individuals in the second tool set based on the weight value to obtain the first fitness corresponding to each of the individuals in the second tool set.

[0200] Optionally, the generating module 401 includes:

[0201] An acquisition submodule, used for acquiring a first tool quantity for the tool combination;

[0202] The second combining submodule is used to extract the first number of first tools from the multiple artificial intelligence agent task tools included in the model library and combine them to obtain multiple first tool set individuals.

[0203] Optionally, the device 400 further includes:

[0204] A semantic recognition module, used to perform semantic recognition on the task execution instruction and determine the task action keywords of the target task;

[0205] The fourth determination module is used to determine the task type corresponding to the target task based on the task action keyword.

[0206] The AI ​​agent task tool selection device based on the optimization algorithm in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a GPU BOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmentedreality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personaldigital assistant, PDA), etc., and can also be a server, a network attached storage (Network AttachedStorage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0207] The AI ​​agent task tool selection device based on the optimization algorithm in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, a Linux, a Windows operating system, etc., and can also be other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0208] The AI ​​agent task tool selection device based on the optimization algorithm provided in the embodiment of the present application can achieve Figures 1 to 3To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0209] The present application embodiment provides an electronic device, see Figure 5 The electronic device 50 includes: a processor 501, a memory 502, and a computer program 5021 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the program, the AI ​​agent task tool selection method based on the optimization algorithm of the aforementioned embodiment is implemented.

[0210] An embodiment of the present application also provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps in the AI ​​agent task tool selection method based on the optimization algorithm as disclosed in the embodiment of the present application.

[0211] The embodiment of the present application also provides a computer program product, which, when running on an electronic device, enables a processor to implement the steps in the AI ​​agent task tool selection method based on the optimization algorithm as disclosed in the embodiment of the present application.

[0212] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0213] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0214] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0215] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0216] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0217] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0218] The above is a detailed introduction to the AI ​​agent task tool selection method and device based on the optimization algorithm provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for selecting AI agent task tools based on optimization algorithm, characterized in that: The method comprises: In response to a task execution instruction of a target task, generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in a model library; Performing a crossover mutation operation on the first tool set individuals to obtain a plurality of second tool set individuals; Based on the first evaluation indicators of the proxy task tools included in the second tool set individuals, determining the second evaluation indicators corresponding to the second tool set individuals respectively; wherein the indicator type of the first evaluation indicator corresponds to the task type of the target task; Determining first fitness values ​​corresponding to respective individuals of the second tool set based on the second evaluation indicator and the weight values ​​corresponding to the respective second evaluation indicators; Determine a target tool set individual corresponding to the maximum value of the first fitness from the plurality of second tool set individuals; A target artificial intelligence agent task tool set corresponding to the individual of the target tool set is selected from the model library; wherein the target artificial intelligence agent task tool set is used to execute the target task.

2. The method according to claim 1, characterized in that The step of determining a target tool set individual corresponding to the maximum value of the first fitness from the plurality of second tool set individuals comprises: Re-execute the step of generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in the model library, so as to iterate the plurality of first tool set individuals to obtain a plurality of iterated first tool set individuals; When the number of iterations of the iterated plurality of first tool set individuals reaches a preset number, a target tool set individual corresponding to the maximum value in the first fitness is determined from the plurality of second tool set individuals and the iterated plurality of second tool set individuals.

3. The method according to claim 1, characterized in that The indicator types include accuracy, F1 score, reasoning time and computing resource consumption value. The first evaluation indicator of the proxy task tool included in the second tool set individual is determined to correspond to each second tool set individual, including: Determine the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value respectively corresponding to the proxy task tools included in each of the second tool set individuals; wherein the first accuracy rate, the first F1 score, the first reasoning time, and the first computing resource consumption value are all included in the first evaluation index; Based on the first accuracy rate and the first F1 score, determining a second accuracy rate and a second F1 score corresponding to each of the second tool set individuals; Determine, based on the first reasoning time and the first computing resource consumption value, the second reasoning time and the second computing resource consumption value corresponding to each of the second tool set individuals; Based on each of the second tool set individuals, the second accuracy, the second F1 score, the second reasoning time, and the second computing resource consumption value are combined to obtain second evaluation indicators corresponding to each of the second tool set individuals.

4. The method according to claim 3, characterized in that The determining, based on the first accuracy rate and the first F1 score, second accuracy rates and second F1 scores corresponding to each of the second tool set individuals, respectively, includes: Calculating a first average of first accuracy rates of the proxy task tools included in each of the second tool set individuals to obtain second accuracy rates corresponding to each of the second tool set individuals; A second average of the first F1 scores of the proxy task tools included in each of the second tool set individuals is calculated to obtain a second F1 score corresponding to each of the second tool set individuals.

5. The method according to claim 3, characterized in that: The determining, based on the first reasoning time and the first computing resource consumption value, the second reasoning time and the second computing resource consumption value corresponding to each of the second tool set individuals respectively includes: Determine the maximum value of the first reasoning times corresponding to the proxy task tools included in each of the second tool set individuals as the second reasoning times corresponding to each of the second tool set individuals; The sum of the first computing resource consumption values ​​of the proxy task tools included in each of the second tool set individuals is calculated to obtain the second computing resource consumption values ​​respectively corresponding to each of the second tool set individuals.

6. The method according to claim 1, characterized in that The crossover and mutation operation includes a crossover operation and a mutation operation. The crossover and mutation operation is performed on the first tool set individuals to obtain a plurality of second tool set individuals, including: Randomly exchange the artificial intelligence agent task tools included in at least two of the first tool set individuals to obtain a third tool set individual; Randomly replace at least one artificial intelligence agent task tool included in the first tool set individual with another artificial intelligence agent task tool to obtain a fourth tool set individual; The first toolset individual, the third toolset individual and the fourth toolset individual that have not been subjected to a crossover operation or a mutation operation are determined as second toolset individuals.

7. The method according to claim 1, characterized in that The determining, based on the second evaluation index and the weight values ​​corresponding to the second evaluation indexes, the first fitness corresponding to the individuals of the second tool set respectively includes: Determining a weight value corresponding to the second evaluation indicator based on the indicator type of the second evaluation indicator; Based on the weight value, the second evaluation indicators corresponding to each of the individuals in the second tool set are weighted and summed to obtain the first fitness corresponding to each of the individuals in the second tool set.

8. The method according to claim 1, characterized in that The method of generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in the model library includes: obtaining a first tool quantity for the tool combination; The first number of first tools is extracted from a plurality of artificial intelligence agent task tools included in the model library and combined to obtain a plurality of first tool set individuals.

9. The method according to claim 1, characterized in that: The method further comprises: Performing semantic recognition on the task execution instruction to determine the task action keywords of the target task; Based on the task action keywords, the task type corresponding to the target task is determined.

10. An AI agent task tool selection device based on optimization algorithm, characterized in that: The device comprises: A generation module, for generating a plurality of first tool set individuals based on a plurality of artificial intelligence agent task tools included in a model library in response to a task execution instruction of a target task; A crossover and mutation module, used for performing a crossover and mutation operation on the first tool set individuals to obtain a plurality of second tool set individuals; A first determination module is used to determine the second evaluation indicators corresponding to each of the second tool set individuals based on the first evaluation indicators of the proxy task tools included in the second tool set individuals; wherein the indicator type of the first evaluation indicator corresponds to the task type of the target task; A second determination module, configured to determine the first fitness corresponding to each of the individuals in the second tool set based on the second evaluation indicator and the weight values ​​corresponding to each of the second evaluation indicators; A third determination module is used to determine a target tool set individual corresponding to the maximum value of the first fitness from the plurality of second tool set individuals; A selection module is used to select a target artificial intelligence agent task tool set corresponding to the individual of the target tool set from the model library; wherein the target artificial intelligence agent task tool set is used to execute the target task.

Citation Information

Patent Citations

  • Manufacturing resource optimization method and device, storage medium and electronic equipment

    CN114066042A

  • Flow threshold determination method and device based on genetic algorithm

    CN114745310A

  • Multi-task scheduling method and system based on genetic algorithm

    CN116401037A

  • Multi-agent task processing method and device, computer equipment and storage medium

    CN117992231A

  • Device for selecting component in super e-marketplace

    JP2002352123A

Cited By

  • Tool creation and evolution combined reasoning application method, system, equipment and medium

    CN119623637A

  • Recall method, electronic equipment and related device

    CN121581188A