Task processing method and device
By enabling agents to work collaboratively, tool matching information is generated to determine the target application tool, thus solving the problems of computational resource consumption and accuracy when agents call external tools, and achieving efficient task processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-03-31
AI Technical Summary
When intelligent agents call external application tools, they need to handle multiple steps such as task understanding, tool function matching, and parameter parsing, which leads to high consumption of computing resources and a decrease in the accuracy of tool selection, making it difficult to support the actual application needs of large-scale tool calls.
The first agent obtains the target task, the second agent generates tool matching information, and the first agent determines the target application tool based on this information and calls it to execute the task. This avoids loading detailed descriptions of all available tools in the context and achieves separation of tool selection and task execution.
It reduces computing resource consumption, improves the accuracy of tool selection and task processing efficiency, and supports the practical application needs of large-scale tool libraries.
Smart Images

Figure CN121766356A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a task processing method and apparatus. Background Technology
[0002] When an agent needs to call external application tools to complete a task, it usually needs to handle multiple stages such as task understanding, tool function matching, and parameter parsing simultaneously in a single inference process. This causes the agent to load detailed descriptions of all available tools in the context, which not only consumes a lot of computing resources, but also leads to a decrease in tool selection accuracy and inference efficiency due to information overload, making it difficult to support the actual application needs of large-scale tool calls. Summary of the Invention
[0003] In view of this, this application provides a task processing method and apparatus.
[0004] According to a first aspect of this application, a task processing method is provided, comprising: a first intelligent agent obtaining a target task; a second intelligent agent generating tool matching information for selecting an application tool based on the target task; the first intelligent agent determining a target application tool for executing the target task based on the tool matching information, invoking the target application tool to execute the target task, and obtaining a response result for the target task.
[0005] A second aspect of this application provides a task processing apparatus, comprising: a first intelligent agent module for obtaining a target task; a second intelligent agent module for generating tool matching information for selecting an application tool based on the target task; the first intelligent agent module is further configured to determine a target application tool for executing the target task based on the tool matching information, call the target application tool to execute the target task, and obtain a response result for the target task.
[0006] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0007] The above and other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0008] Figure 1 The illustration schematically depicts an application scenario of a task processing method and apparatus provided in an embodiment of this application;
[0009] Figure 2 A flowchart illustrating a task processing method provided in an embodiment of this application is shown.
[0010] Figure 3This is a schematic diagram of a practical application scenario provided by an embodiment of this application;
[0011] Figure 4 A block diagram of a task processing device provided in an embodiment of this application;
[0012] Figure 5 This is a structural block diagram of an intelligent agent provided in an embodiment of this application. Detailed Implementation
[0013] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0014] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0015] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0016] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).
[0017] In the embodiments of this application, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0018] Figure 1The illustration schematically depicts an application scenario of a task processing method and apparatus provided in an embodiment of this application.
[0019] like Figure 1 As shown, the application scenario according to this embodiment may include a user terminal device 101, a first intelligent agent 102, and multiple second intelligent agents 103.
[0020] In a typical application scenario, a user inputs a target task through a user terminal device 101. The user terminal device 101 sends the target task to a first intelligent agent 102. Upon receiving the target task, the first intelligent agent 102 broadcasts it to multiple second intelligent agents 103. Each second intelligent agent 103 independently determines whether a candidate application tool is suitable for executing the target task based on the content of the target task and the capabilities of its corresponding candidate application tools, and generates tool matching information for application tool selection. This tool matching information may include the candidate application tool's adaptation identifier, adaptation reason, execution plan, and required parameter information. Each second intelligent agent 103 returns the generated tool matching information to the first intelligent agent 102. The first intelligent agent 102 determines the target application tool to execute the target task based on the received tool matching information. The first intelligent agent 102 sequentially or in parallel calls these target application tools to execute the target task according to the determined execution plan, and summarizes and integrates the execution results of each application tool to obtain a response result for the target task. Finally, the first intelligent agent 102 returns the response result to the user terminal device 101 for display.
[0021] After identifying the target application tool and completing the task, the first intelligent agent 102 can record relevant information about the task execution, including the target task description, the selected target application tool, execution parameters, execution results, and response quality indicators, for subsequent execution process optimization or rapid processing of similar tasks, without having to repeat the complete tool matching process.
[0022] User terminal device 101 can be various electronic devices with network communication capabilities, including but not limited to smartphones, tablets, laptops, desktop computers, smart speakers, etc. First intelligent agent 102 and second intelligent agent 103 can be intelligent agent programs based on large language models, agent programs based on rule engines, or other intelligent programs with task understanding and processing capabilities. They can also be physical devices with data transmission and processing capabilities, such as dedicated intelligent agent servers, edge computing devices, intelligent controllers, etc., which can be deployed on cloud servers, edge computing nodes, or user local devices.
[0023] It should be noted that the task processing method provided in this application mainly involves the collaborative work of a first intelligent agent 102 and a second intelligent agent 103, including steps such as acquiring the target task, generating tool matching information, and determining and invoking the target application tool. In some embodiments, the first intelligent agent 102 and multiple second intelligent agents 103 can be integrated into the same system as different functional modules, or they can be deployed on different servers or devices to communicate and collaborate via a network. In other embodiments, the number of second intelligent agents 103 can be dynamically adjusted according to the number of candidate application tools, with each second intelligent agent 103 responsible for the matching processing of one or more candidate application tools.
[0024] It should be understood that Figure 1 The number of second agents 103 shown is merely illustrative. Depending on implementation needs, any number of second agents 103 can be used. For example, application scenario 100 may include dozens or even hundreds of second agents 103, each corresponding to different candidate application tools to meet the processing requirements of various complex tasks. Furthermore, the deployment locations of each second agent 103 can be diverse. For instance, some second agents 103 may be deployed on cloud servers, while others may be deployed on the user's local device to reduce network latency. A hybrid deployment approach can also be adopted to balance service availability and response speed.
[0025] The following will be based on Figure 1 The following describes the task processing method of the embodiments of this application in detail, based on the described scenario.
[0026] Figure 2 A flowchart illustrating a task processing method provided in an embodiment of this application is shown.
[0027] like Figure 2 As shown, the task processing method may specifically include the following operations.
[0028] By operating S210, the first intelligent agent obtains the target task;
[0029] In operation S220, the second agent generates tool matching information for selecting application tools based on the target task;
[0030] In operation S230, the first intelligent agent determines the target application tool for executing the target task based on the tool matching information, calls the target application tool to execute the target task, and obtains the response result for the target task.
[0031] In operation S210, the target task refers to the specific work or problem that the user expects to complete or solve through the intelligent agent system, which can be understood as the task request issued by the user to the intelligent agent system.
[0032] For example, the target task may include, but is not limited to: analyzing sales data from the past year and generating trend charts, querying flight information from Beijing to Shanghai tomorrow, translating a specified document into English and sending it to a specified email address, etc.
[0033] Optionally, the target task carries task information, including at least one of the following: a description of the target task, indicating the specific goal the user expects to achieve; an identifier or summary of existing input data, indicating the data source or data characteristics required for task execution; task constraints, such as time limits, cost budgets, and result format requirements; and user preferences, such as preferences for tool selection and expectations regarding result presentation. This task information helps the second agent generate tool matching information more accurately and also helps the first agent more rationally determine the target application tool.
[0034] In one feasible implementation, the first intelligent agent receives the target task input by the user through a user terminal device. The user inputs task description text in the interactive interface or speaks the task content by voice. The user terminal device sends the task information to the first intelligent agent, and the first intelligent agent receives and records the target task and the task information it carries.
[0035] It should be noted that after the first intelligent agent obtains the target task, it can perform a preliminary analysis of the target task, such as identifying the task type, extracting key elements, and judging the task complexity. The above preliminary analysis does not involve loading detailed description information of specific application tools, thereby avoiding the problem of context overload.
[0036] In operation S220, tool matching information refers to the structured data output by the second agent after analyzing the target task content and the capabilities of the corresponding candidate application tools. This data is used to provide the first agent with information on whether the candidate application tool is suitable for performing the target task, how to perform the target task, and what conditions are required to perform the target task.
[0037] For example, tool matching information may include, but is not limited to: a candidate application tool's compatibility identifier, used to indicate whether the candidate application tool is suitable for performing the target task; a compatibility reason, used to explain the specific reasons why the candidate application tool is suitable or unsuitable for the target task; an execution plan, used to describe the execution logic or operation steps of the candidate application tool to complete the target task; required parameter information, used to list the input parameters required by the candidate application tool to perform the target task and whether they have been obtained; a confidence score, used to quantify the degree of confidence that the candidate application tool will successfully complete the target task; and potential risk warnings, used to explain the problems or limitations that the candidate application tool may encounter when performing the target task.
[0038] In one feasible implementation, after the first intelligent agent broadcasts the target task to multiple second intelligent agents, each second intelligent agent performs independent matching analysis based on the capability declaration of its corresponding candidate application tool and the task information of the target task.
[0039] Each second agent analyzes the target task's description, constraints, and other information to determine whether its corresponding candidate application tools possess the core capabilities required to complete the target task. If the determination result is a fit, the second agent constructs tool matching information containing the above-mentioned information and returns it to the first agent; if the determination result is an incompatibility, the second agent does not return tool matching information or returns simplified information indicating an incompatibility.
[0040] In another feasible implementation, the first agent selectively sends the target task to some of the second agents based on the complexity or type of the target task.
[0041] For example, the first intelligent agent pre-classifies all second intelligent agents into categories such as data processing, text processing, and image processing. When the target task is "analyze sales data and generate a report," the first intelligent agent only sends this target task to second intelligent agents in the data processing category. The second intelligent agent receiving the target task then performs fine-grained matching based on the specific functions of the candidate application tools and generates corresponding tool matching information.
[0042] It should be noted that in operation S220, the process of the second agent generating tool matching information does not depend on the detailed description information of the candidate application tools provided by the first agent. Instead, each second agent has maintained complete capability information of its corresponding candidate application tool internally, including functional scope, parameter structure, and invocation constraints.
[0043] The above technical solution eliminates the need for the first agent to load description documents for all candidate application tools into the context, thus avoiding the context overload problem caused by the increase in the number of tools in traditional solutions. Furthermore, the generation of tool matching information by each second agent is performed in parallel without interference. Therefore, even if the number of candidate application tools reaches hundreds, the system response time mainly depends on the processing speed of a single second agent, rather than the serial accumulation time of all second agents, thereby ensuring the system's scalability and response efficiency.
[0044] In operation S230, the target application tool refers to one or more candidate application tools ultimately selected by the first agent based on tool matching information to perform the target task. This can be understood as the actual execution tool selected from all candidate application tools that return tool matching information. The response result refers to the output data or operation result generated by the target application tool after performing the target task. This response result can be returned directly to the user, or it can be returned to the user after format conversion or content integration by the first agent.
[0045] In one feasible implementation, after receiving tool matching information returned by multiple second agents, the first agent performs preliminary screening based on the adaptation identifier field in each tool matching information, and includes candidate application tools with the adaptation identifier indicating compatibility into the candidate set. Furthermore, each second agent uniquely corresponds to one application tool, and each second agent, upon determining that its corresponding application tool matches the target task, sends tool matching information to the first agent.
[0046] After receiving the invocation command, the target application tool executes the corresponding operation and returns the execution result to the first intelligent agent. The first intelligent agent obtains the execution result and returns the response result for the target task to the user terminal device based on the execution result.
[0047] In another feasible implementation, the tool matching information received by the first agent shows that multiple candidate application tools are suitable for the target task. The first agent further analyzes factors such as confidence scores, completeness of execution plans, and completeness of required parameter information in each tool matching information to rank or combine the candidate application tools. Further, there is a second agent with a built-in workflow. This workflow performs matching and filtering operations on multiple application tools to obtain tool matching information. This workflow includes at least one of the following nodes: a tool description optimization and standardization node, used to extract information from tool description documents, perform automatic analysis and reconstruction, and generate standardized machine-readable descriptions (such as JSON format); a capability matching and confidence assessment node, used to analyze task and tool capabilities, generate tool matching degree and confidence scores, and provide a list of prioritized recommended tools; a deep parameter analysis and automatic follow-up question generation node, used to detect the completeness of parameters in tool calls and automatically generate follow-up questions to fill in missing parameters; and a tool collaboration scheme recommendation node, which recommends suitable tool combinations or workflows when a single tool cannot complete the task independently. The nodes mentioned above are connected in series or in parallel in the workflow and are executed in the order of workflow execution to complete the matching and filtering operation of application tools and obtain tool matching information.
[0048] For example, the first agent can select the candidate application tool with the highest confidence score and all required parameters as the target application tool, or it can determine the execution order of multiple target application tools based on the dependencies reflected in the execution plan, and call these target application tools in sequence to complete the target task. The execution results of each target application tool are aggregated and integrated by the first agent to generate a unified response result.
[0049] The above approach decouples the decision-making logic of the first agent from the number of candidate application tools. Even if there are a large number of candidate application tools in the system, the first agent only needs to process a small amount of response data from the second agent that returned tool matching information, thus avoiding the occupation of context by a large amount of tool description information.
[0050] Furthermore, the process of the first intelligent agent invoking the target application tool to execute the target task can be synchronous, i.e., waiting for the target application tool to return the execution result before performing subsequent operations; or it can be asynchronous, i.e., initiating a call request to the target application tool while continuing to process other tasks, and obtaining the execution result through callback or polling after the target application tool has completed its execution. When multiple target application tools need to cooperate to complete the target task, the first intelligent agent can arrange serial or parallel execution according to the dependencies in the execution plan to improve task processing efficiency.
[0051] The first intelligent agent determines the target application tool for executing the target task based on tool matching information, calls the target application tool to execute the target task, and obtains the response result for the target task, including: determining a first prompt word based on tool matching information, inputting the first prompt word into the target language model, obtaining tool call information generated by the target language model, calling the target application tool from candidate application tools based on the tool call information to obtain the execution result, determining a second prompt word based on the execution result, inputting the second prompt word into the target language model, and obtaining the response result for the target task generated by the target language model.
[0052] To more clearly illustrate the task processing method provided in the embodiments of this application, a specific example is given below.
[0053] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a practical application scenario provided by an embodiment of this application.
[0054] The user inputs target task 311 through user terminal 310: "Query flight information from Beijing to Shanghai tomorrow".
[0055] The first intelligent agent 320 receives the target task from the user terminal device and parses it to find that the task type is flight query, and the key information includes the departure point is Beijing, the destination is Shanghai, and the departure time is tomorrow.
[0056] The first intelligent agent sends the target task 311 to the second intelligent agent 330. The second intelligent agent 330 corresponds to the flight query tool 331. After analysis, it determines that the flight query tool 331 is suitable for the target task and generates tool matching information 332, which includes: the adaptation identifier is "suitable", the adaptation reason is "supports domestic flight information query", the execution plan is "call the flight query interface to obtain the flight list", and the required parameters are "departure point, destination, and departure date", all of which have been obtained.
[0057] The first intelligent agent 320 receives tool matching information returned by the second intelligent agent 330 and determines that the flight query tool 331 is the target application tool. The first intelligent agent 320 constructs a calling command, passing in the parameters: departure point is Beijing, destination is Shanghai, and departure date is the specific date of tomorrow, and calls the flight query tool. The flight query tool returns a list of flight data that meets the conditions. The first intelligent agent 320 organizes this data into a response result 312: "Tomorrow's flights from Beijing to Shanghai include: CA1234, departing at 08:00; MU5678, departing at 14:00...", and returns the response result to the user terminal 310 device to display to the user.
[0058] By adopting the above-mentioned technical solution, after the first intelligent agent obtains the target task, a dedicated second intelligent agent generates tool matching information for application tool selection based on the target task. The first intelligent agent does not need to load detailed descriptions of all available tools in the context, but directly determines the target application tool and executes the task based on the tool matching information provided by the second intelligent agent. This separates the task understanding and tool function matching processes from the reasoning process of the first intelligent agent, effectively reducing the context length and reasoning complexity of the first intelligent agent, reducing computational resource consumption, and avoiding the problems of decreased tool selection accuracy and reduced reasoning efficiency caused by information overload. This enables the system to support the actual application needs of a large-scale tool library and improves the accuracy and efficiency of task processing.
[0059] Based on the above embodiments, as an optional embodiment, in order to enable the second intelligent agent to more accurately evaluate the applicability of candidate application tools to the target task and select the tool suitable for performing the target task from multiple candidate application tools, the above operation S220 may further include the following operations.
[0060] In operation S310, the second intelligent agent determines the adaptation information of multiple candidate application tools to the target task based on the task information of the target task.
[0061] In operation S320, the second intelligent agent determines at least one target application tool from multiple candidate application tools based on the adaptation information of multiple candidate application tools;
[0062] Operate S330 to generate tool matching information for at least one target application tool.
[0063] In operation S310, the adaptation information refers to the evaluation results of the matching degree of the candidate application tool with the target task, including whether the candidate application tool can complete the target task, how feasible it is to complete the target task, and what preconditions need to be met.
[0064] For example, the adaptation information may include, but is not limited to: functional adaptability assessment results, which indicate whether the functional scope of the candidate application tool covers the requirements of the target task; input-output compatibility assessment results, which indicate whether the candidate application tool can process the input data types provided by the target task and output results in a format that meets the requirements; constraint satisfaction status, which indicates whether the execution time, resource consumption, and other characteristics of the candidate application tool meet the constraints of the target task; and capability confidence, which quantifies the likelihood that the candidate application tool will successfully complete the target task.
[0065] In one feasible implementation, after receiving the target task, the second intelligent agent extracts task information from the target task, including parsing key verbs and nouns in the target description to identify the task type and operation object, extracting the format and content features of the input data, and identifying elements such as time limits and format requirements in the task constraints.
[0066] Optionally, the second agent compares and analyzes the extracted task information with the capability claims of multiple candidate application tools it manages. For each candidate application tool, the second agent determines whether the declared functionality of the candidate application tool includes the core capabilities required for the target task. For example, if the target task is "generating visual charts," the agent determines whether the candidate application tool has data visualization capabilities.
[0067] Based on the above judgment results, the second intelligent agent generates adaptation information for each candidate application tool and records the evaluation results of the candidate application tool in terms of functional adaptability, input-output compatibility, and constraint satisfaction.
[0068] It should be noted that in determining the adaptation information, the second agent analyzes the capability data of the candidate application tools maintained internally, without requesting additional tool description information from the first agent, thus avoiding the context burden on the first agent.
[0069] In operation S320, after the second agent obtains the adaptation information of each candidate application tool, it first filters out the candidate application tools whose functional adaptability evaluation results are adapted, and excludes the candidate application tools whose functions are not adapted.
[0070] For candidate application tools that are functionally compatible, the second agent further examines their input-output compatibility evaluation results and constraint fulfillment. If a candidate application tool fails to meet any of the requirements regarding input-output compatibility or constraint fulfillment, the second agent marks the candidate application tool as either unsuitable or conditionally compatible. Conditionally compatible candidate application tools are retained but their priority is reduced.
[0071] Optionally, the second agent sorts the remaining candidate application tools according to their capability confidence and selects one or more candidate application tools with the highest capability confidence as the target application tool.
[0072] In another feasible implementation, the second agent also considers the feasibility of collaboration between candidate application tools when determining the target application tool.
[0073] If a single candidate application tool cannot independently fulfill all the requirements of the target task, but the capabilities of multiple candidate application tools can complement each other, the second agent identifies the collaborative relationships between these candidate application tools. For example, one candidate application tool may be responsible for data extraction, another for data analysis, and a third for result visualization. The second agent then combines these collaborative candidate application tools into the set of target application tools.
[0074] Optionally, when determining the target application tool, the second intelligent agent can also adjust the priority of candidate application tools according to user preferences.
[0075] It should be noted that the target application tool identified by the second intelligent agent can be one or more. When multiple target application tools are identified, the second intelligent agent also determines the execution order or parallel relationship between these target application tools, so that the subsequently generated tool matching information can clearly describe the execution scheme of the target application tools.
[0076] In operation S330, the second agent generates tool matching information for the target application tool, integrates the adaptation information obtained in operations S310 and S320 with the screening results of the target application tool, and constructs structured tool matching information to return to the first agent.
[0077] In one feasible implementation, the second intelligent agent generates corresponding tool matching information for each target application tool. This tool matching information includes the identifier of the target application tool, used to uniquely identify it; the adaptation information of the target application tool, including functional adaptability, input / output compatibility, constraint satisfaction, and capability confidence; and the execution plan of the target application tool, describing the operational flow of the target application tool in completing the target task.
[0078] In another feasible implementation, when the second agent determines multiple target application tools that need to cooperate to complete the target task, the tool matching information generated by the second agent also includes a description of the cooperation relationship between the multiple target application tools.
[0079] Optionally, the description of the collaboration relationship includes the execution order of the various target application tools; the data dependencies between the various target application tools; and the feasibility of parallel execution of the various target application tools.
[0080] The second agent integrates the above-mentioned collaborative relationship description into the tool matching information, so that after receiving the tool matching information, the first agent can directly understand how to schedule these target application tools to complete the target task.
[0081] Optionally, when generating tool matching information, the second intelligent agent may also include prompts regarding the risks or limitations that the target application tool may encounter when performing the target task.
[0082] For example, if a target application tool experiences performance degradation when processing large-scale data, the second agent can add a warning to the tool matching information: "Execution time may be longer when the amount of input data exceeds a certain threshold." This warning helps the first agent make more informed decisions when invoking the target application tool or provides expected management to the user.
[0083] It should be noted that the tool matching information generated by the second agent is based on its internal understanding of the capabilities of candidate application tools and analysis of the target task requirements. This tool matching information provides the first agent with a filtered and evaluated decision basis, so that the first agent does not need to traverse and analyze all candidate application tools on its own, thereby significantly reducing the computational complexity and context occupation of the first agent.
[0084] By adopting the above technical solution, the second intelligent agent can systematically complete the entire process from task information extraction, candidate application tool adaptability evaluation, target application tool screening to tool matching information generation, providing the first intelligent agent with tool selection suggestions based on in-depth analysis, enabling the first intelligent agent to quickly determine the target application tool to be called based on reliable tool matching information, thereby improving the accuracy and efficiency of task processing.
[0085] Based on the above embodiments, as an optional embodiment, in order to support the efficient processing of a large-scale candidate application tool library, avoid the processing delay caused by a single second agent managing too many candidate application tools, and reduce the context burden on the first agent in the tool selection process, the above task processing method may further include the following operations.
[0086] In operation S410, the first intelligent agent broadcasts the target task to multiple second intelligent agents; each second intelligent agent corresponds to at least one candidate application tool.
[0087] In operation S420, each second agent determines the adaptability information of the candidate application tool to the target task based on the capabilities of the corresponding candidate application tool, and obtains the tool matching information.
[0088] In operation S410, broadcasting refers to the operation of the first agent sending the target task to multiple second agents simultaneously. It can be understood as the process by which the first agent distributes the target task content to all or some of the second agents at the same time.
[0089] Optionally, when broadcasting the target task, the first agent can use either full broadcast or selective broadcast. Full broadcast means sending the target task to all second agents in the system; selective broadcast means that the first agent sends the target task to only some second agents based on the characteristics of the target task.
[0090] In selective broadcasting scenarios, the first agent can select the second agent based on the task type of the target task. For example, if the target task is data processing, the first agent will only broadcast the target task to the second agent that manages candidate application tools for data processing, and will not send the target task to the second agent that manages candidate application tools for image processing or text processing, thereby reducing the processing overhead of irrelevant second agents.
[0091] It should be noted that the correspondence between each second agent and at least one candidate application tool can be pre-configured during system initialization or dynamically adjusted during system operation. In the pre-configuration method, the system administrator assigns a candidate application tool to each second agent and stores this correspondence in a configuration file or database. In the dynamic adjustment method, when a new candidate application tool is added to the system, it can be assigned to an existing second agent, or a new second agent can be created to manage the candidate application tool.
[0092] In operation S420, after receiving the target task, the second agent A extracts the task information from the target task and compares this task information with the capability declaration of its corresponding candidate application tool. The second agent A determines whether its corresponding candidate application tool has the core functions to complete the target task, whether it can process the input data type provided by the target task, and whether it can output the result format required by the target task.
[0093] If the second agent A determines that its corresponding candidate application tool is suitable for the target task, then the second agent A generates tool matching information containing adaptation information and returns the tool matching information to the first agent. If the second agent A determines that its corresponding candidate application tool is not suitable for the target task, then the second agent A does not return tool matching information, or returns simplified information indicating that the adaptation is not suitable.
[0094] Meanwhile, other second agents, such as second agent B and second agent C, also perform the same adaptability analysis on their respective candidate application tools, and each generate tool matching information or does not return any information. The processing of each second agent is parallel in time; that is, the processing of second agent A does not need to wait for the completion of second agent B, and the processing of second agent B does not need to wait for the completion of second agent C.
[0095] In another feasible implementation, when a second agent corresponds to multiple candidate application tools, the second agent needs to analyze the adaptability of each candidate application tool to the target task one by one.
[0096] The second agent E returns the tool matching information of the candidate application tools that are suitable for the target task from the three candidate application tools to the first agent. If none of the three candidate application tools are suitable, the second agent E does not return tool matching information.
[0097] It should be noted that when determining the adaptation information, each second agent makes an independent judgment based entirely on the candidate application tool capability data maintained internally. It does not need to interact with other second agents or request additional task descriptions or tool descriptions from the first agent.
[0098] The above processing method ensures that there is no dependency between the second agents, enabling true parallel processing and thus guaranteeing that the system's response speed does not decrease linearly with the increase in the number of second agents.
[0099] Optionally, after receiving tool matching information returned by multiple second agents, the first agent can sort or filter the tool matching information according to the order of receipt, the capability confidence level in the tool matching information, or other priority criteria, so as to determine the target application tool to be called in the future.
[0100] By adopting the above technical solution, the first intelligent agent simultaneously sends the target task to multiple second intelligent agents via broadcast. Each second intelligent agent independently and in parallel analyzes the suitability of its corresponding candidate application tools for the target task, and only the second intelligent agents with suitable applications return tool matching information. This processing method eliminates the need for the first intelligent agent to send task requests to each second intelligent agent individually and wait for responses, as well as the need to load the description information of all candidate application tools into the context. This significantly reduces the processing complexity and context occupancy of the first intelligent agent, and improves the system's response efficiency and scalability in scenarios with large-scale tool libraries.
[0101] Based on the above embodiments, as an optional embodiment, in order to enable the second intelligent agent to more accurately understand the capabilities of candidate application tools and improve the accuracy of adaptation information evaluation, while reducing matching deviations caused by inconsistent tool description formats, the above task processing method may further include the following operations.
[0102] By operating S510, the second agent obtains the common first description parameters of each candidate application tool;
[0103] In operation S520, the second agent processes the first description parameters based on the target task to obtain the second description parameters for the target task;
[0104] In operation S530, the second intelligent agent determines the adaptation information of each candidate application tool to the target task based on the second description parameters.
[0105] In operation S510, the first description parameter refers to the general capability description information configured when the candidate application tool is created or registered. This description information is independent of the specific task and is used to describe the basic functional scope, calling specifications and usage constraints of the candidate application tool.
[0106] Optionally, the first description parameter includes at least one of the functional parameters, specification parameters, and constraint parameters of the candidate application tool.
[0107] For example, functional parameters may include, but are not limited to: the business function categories supported by the candidate application tool, such as data query, data analysis, format conversion, visualization generation, etc.; the input data types that the candidate application tool can process, such as text, numerical values, images, tables, etc.; and the output result types that the candidate application tool can output, such as text reports, charts, files, etc.
[0108] For example, the specification parameters may include, but are not limited to: the name of the calling method of the candidate application tool; the parameter name, data type, and value range of each input parameter; the data structure and field description of the output result; and calling examples or parameter combination examples.
[0109] For example, constraint parameters may include, but are not limited to: the limitations of the candidate application tool on the size of the input data; the expected execution time of the candidate application tool; the available time range of the candidate application tool or the status of the external resources it depends on; and the scenarios or known limitations that the candidate application tool does not support.
[0110] In one feasible implementation, the second agent reads the first description parameters of its corresponding candidate application tool from the tool registry during the system initialization phase. The tool registry stores the first description parameters of all candidate application tools in the system, which are written by the tool developer or the tool management module during the registration of the candidate application tool. After obtaining the first description parameters, the second agent stores them in a local cache for easy access later.
[0111] It should be noted that the first description parameter is general and task-independent; the first description parameter of the same candidate application tool remains consistent when handling different target tasks. This feature allows the first description parameter to be reused during system operation without needing to be repeatedly obtained for each target task.
[0112] In operation S520, the second description parameter refers to the task-related description information generated by the second agent after transforming and optimizing the first description parameter based on the task information of the target task. This description information highlights the relevance between the candidate application tool and the target task and is used to assist in the subsequent determination of adaptation information.
[0113] In one feasible implementation, the second agent extracts task information such as task type, target description, and task constraints from the target task, and compares this task information with the functional parameters in the first description parameters. The second agent identifies the functional descriptions in the first description parameters that are related to the target task, extracts the relevant functional descriptions to form the functionally relevant part of the second description parameters, and filters out functional descriptions that are irrelevant to the target task.
[0114] For example, if the functional parameters in the first description parameter of the candidate application tool include "support sales data analysis, inventory data analysis, and user behavior analysis", and the task type of the target task is sales data processing, then when the second intelligent agent generates the second description parameter, it sets the functional related part to "support sales data analysis" and does not include the description of inventory data analysis and user behavior analysis.
[0115] Optionally, when processing the standardized parameters in the first description parameters, the second agent adjusts the focus of the parameter description based on the characteristics of the input data already provided by the target task. If the target task already contains some input data, the second agent marks in the second description parameters which input parameters can be obtained from the target task and which input parameters still need to be supplemented, thereby making the second description parameters more consistent with the execution conditions of the current task.
[0116] It should be noted that the process of the second agent generating the second description parameters is a transformation rather than a replacement of the first description parameters. The first description parameters remain unchanged within the second agent, while the second description parameters are temporary descriptive information generated for a specific target task to support the determination of adaptation information for the current task. When the second agent receives a new target task, it can generate different second description parameters based on the same set of first description parameters.
[0117] In operation S530, the second agent uses the second description parameter, combined with the task information of the target task, to evaluate the degree of adaptation of the candidate application tool to the target task, and generates adaptation information.
[0118] In one feasible implementation, the second agent semantically matches the function-related parts of the second description parameters with the target description of the target task. The second agent determines whether the function described in the second description parameters covers the operations required by the target task. If it covers, the function adaptability evaluation result is determined to be adaptable; otherwise, the function adaptability evaluation result is determined to be unsuitable.
[0119] Optionally, the second agent further analyzes the canonical parameter-related parts of the second description parameters to determine whether the input parameters required by the candidate application tool can be obtained from the target task or the current context. If all required input parameters are available, the second agent determines that the input-output compatibility evaluation result is compatible; if there are missing required input parameters, the second agent determines that the input-output compatibility evaluation result is conditionally compatible and records the missing parameter information.
[0120] Optionally, the second agent checks the constraint-related parts of the second description parameters to determine whether there is a conflict between the constraint parameters of the candidate application tool and the task constraints of the target task. If there is no conflict, the second agent determines that the constraint conditions are satisfied; if there is a conflict, the second agent determines that the constraint conditions are not satisfied and records the specific details of the conflict.
[0121] The second intelligent agent's comprehensive functional adaptability evaluation results, input-output compatibility evaluation results, and constraint satisfaction status are used to generate candidate application tools' adaptability information for the target task.
[0122] By adopting the above technical solution, after the second intelligent agent obtains the general first description parameters of the candidate application tools, it processes the first description parameters based on the target task to generate targeted second description parameters, and determines the adaptation information based on the second description parameters. This allows the evaluation process of the adaptation information to fully combine the characteristics of the target task and the capability details of the candidate application tools, avoiding the problems of rough matching and insufficient accuracy caused by directly using general description information, and improving the accuracy of tool selection and the success rate of task execution.
[0123] Based on the above embodiments, as an optional embodiment, in order to automatically update the second description parameters when the first description parameters of the candidate application tool change, avoid the failure of adaptation information due to inconsistent parameter descriptions, and reduce the repetitive processing overhead of the second intelligent agent, the above task processing method may further include the following operations.
[0124] In operation S610, the second agent generates a mapping relationship between the first description parameter and the second description parameter;
[0125] In operation S620, the second agent responds to the change in the first description parameter of the target application tool and generates an updated second description parameter based on the changed first description parameter and the mapping relationship.
[0126] In operation S610, the mapping relationship refers to the association between the contents of the first description parameter and the corresponding contents of the second description parameter recorded by the second agent in the process of processing the first description parameter based on the target task to generate the second description parameter. This association is used to indicate which parts of the first description parameter are converted into which parts of the second description parameter, and the corresponding rules applied in the conversion process.
[0127] Optionally, the mapping relationship may include a first mapping relationship and a second mapping relationship.
[0128] The first mapping relationship is used to characterize the correspondence between the parameter names of candidate application tools and the standardized parameter names. The parameter names used by the candidate application tools in the first description parameters may be inconsistent with the standardized parameter names adopted by the system. When generating the second description parameters, the second agent converts the parameter names of the candidate application tools into standardized parameter names and records this conversion correspondence as the first mapping relationship.
[0129] For example, the parameter name of a certain input parameter in the first description parameter of the candidate application tool is "start_date", while the standardized parameter name of the system is "start date". When the second agent generates the second description parameter, it converts "start_date" to "start date" and generates a first mapping relationship to record the correspondence: {"start_date": "start date"}.
[0130] The second mapping relationship is used to characterize the correspondence between business task types and the functional capabilities of candidate application tools. When analyzing the matching relationship between the task type of the target task and the functional parameters in the first description parameters, the second agent identifies which functional capabilities are applicable to which business task types and records this applicability relationship as the second mapping relationship.
[0131] For example, the functional parameters in the first description parameters of the candidate application tool include "support sales data analysis". The second intelligent agent determines that the function is applicable to the target task with a business task type of "data analysis" or "sales report generation", and generates a second mapping relationship to record the correspondence: {"sales data analysis": ["data analysis", "sales report generation"]}.
[0132] In one feasible implementation, when the second agent performs operation S520, it records the mapping relationship of the extraction and conversion process whenever it extracts content from the first description parameter and converts it into the corresponding content in the second description parameter. The second agent maintains a mapping relationship data structure, which contains the correspondence between each field or parameter item in the first description parameter and the corresponding field or parameter item in the second description parameter, as well as the task information features involved in the conversion process.
[0133] Optionally, the mapping relationship data structure also includes a transformation timestamp to record the time when the mapping relationship was generated, so as to determine the validity of the mapping relationship later.
[0134] In operation S620, a change in the first description parameter refers to a modification, addition, or deletion of the functional parameters, specification parameters, or constraint parameters of the candidate application tool. This change may be caused by version upgrades, feature expansions, or configuration adjustments of the candidate application tool.
[0135] In one feasible implementation, the second intelligent agent detects whether the first descriptive parameters have changed by listening to parameter update notifications from candidate application tools or periodically querying the first descriptive parameters of the candidate application tools. When a change in the first descriptive parameters is detected, the second intelligent agent obtains the changed first descriptive parameters and identifies the specific parameter items or fields that have changed.
[0136] Optionally, the second agent compares the changed parameter with the first description parameter recorded in the mapping relationship to determine whether the change involves a parameter already recorded in the mapping relationship. If the change involves a parameter in the mapping relationship, the second agent determines that the change will affect the second description parameter; if the change does not involve a parameter in the mapping relationship, the second agent determines that the change does not affect the second description parameter and there is no need to update the second description parameter.
[0137] If it is determined that the change affects the second description parameter, the second agent generates an updated second description parameter based on the changed first description parameter and the existing mapping relationship. The second agent then processes the relevant content in the changed first description parameter according to the conversion rules recorded in the mapping relationship, using the same conversion method to generate the corresponding content in the updated second description parameter.
[0138] Optionally, after generating the updated second description parameters, the second agent re-executes operation S530 based on the updated second description parameters to determine the updated adaptation information. If the updated adaptation information differs significantly from the original adaptation information, for example, if the functional adaptability evaluation result changes from adapted to unsuitable, or the capability confidence level decreases significantly, the second agent sends a notification to the first agent, informing them that the adaptation information of the candidate application tool has changed.
[0139] By adopting the above technical solution, the second agent generates and maintains the mapping relationship between the first description parameter and the second description parameter. When the first description parameter of the candidate application tool changes, the second agent automatically generates the updated second description parameter based on the mapping relationship and the changed first description parameter. This avoids the problems of outdated description information and invalid adaptation information caused by changes in tool parameters, reduces the processing complexity of the second agent in parameter update scenarios, ensures the consistency between the second description parameter and the actual capabilities of the candidate application tool, and improves the system's adaptability to dynamic changes in tools.
[0140] Based on the above embodiments, as an optional embodiment, in order to ensure that the target application tool has complete input parameters when performing the target task, avoid execution failure or result error due to missing parameters, and improve the automation level of task processing and user experience, the above task processing method may also include the following operations.
[0141] By operating S710, the second agent obtains the parameter calling conditions of each target application tool; the parameter calling conditions represent the input parameters required by the target application tool to perform the target task.
[0142] If the parameter calling conditions do not meet the target conditions, the second agent sends a parameter completion request to the initiator of the target task when operating S720.
[0143] In operation S710, parameter call conditions refer to the input parameter requirements that the target application tool needs to meet to successfully execute the target task, including the parameter name, data type, value range of the required input parameters, and the current acquisition status of these required input parameters.
[0144] In one feasible implementation, after determining the target application tool, the second intelligent agent extracts the relevant parts of the specification parameters from the second description parameters corresponding to the target application tool to obtain the input parameter list of the target application tool. This input parameter list contains all the input parameters declared by the target application tool, from which the second intelligent agent identifies required input parameters and optional input parameters. Required input parameters are those that are indispensable for the execution of the target application tool, while optional input parameters are those that the target application tool can use default values or skip if they are missing.
[0145] Optionally, the second agent matches the input data already included in the target task or the data extracted from the task information of the target task with the required input parameters. The second agent determines which required input parameters the data provided by the target task can satisfy, marks the satisfied required input parameters as acquired, and marks the unsatisfied required input parameters as pending acquisition.
[0146] Optionally, the second agent generates parameter calling conditions, which include a list of required input parameters, the data type and value range of each required input parameter, and the current acquisition status of each required input parameter.
[0147] For example, assuming the target application is a flight search tool, its required input parameters include departure location, destination, and departure date. The second agent extracts the specific dates (departure location: Beijing, destination: Shanghai, departure date: tomorrow) from the target task "query flight information from Beijing to Shanghai," confirming that all three required input parameters have been obtained. The second agent generates the parameter call condition as follows: {Required input parameters: [departure location, destination, departure date], Acquisition status: {departure location: obtained, destination: obtained, departure date: obtained}}.
[0148] In another feasible implementation, the second agent also considers the dependencies between input parameters when acquiring parameter call conditions. The validity of some input parameters depends on the values of other input parameters. The second agent records this dependency in the parameter call conditions and considers the satisfaction of the dependency when determining the parameter acquisition status.
[0149] It should be noted that the parameter calling conditions are determined for specific target application tools and specific target tasks. Different target application tools have different required input parameters, and the acquisition status of the required input parameters may also be different when the same target application tool is processing different target tasks.
[0150] In operation S720, the target condition refers to the condition in which all required input parameters in the parameter call condition are in the acquired state. When the parameter call condition meets the target condition, it means that the target application tool has complete input parameters to perform the target task; when the parameter call condition does not meet the target condition, it means that at least one required input parameter is in the pending state, and the target application tool lacks the input data required to perform the target task.
[0151] In one feasible implementation, the second agent checks the acquisition status of each required input parameter in the parameter call condition and counts the number of required input parameters in the pending acquisition state. If the number of required input parameters in the pending acquisition state is zero, the second agent determines that the parameter call condition meets the target condition; if the number of required input parameters in the pending acquisition state is greater than zero, the second agent determines that the parameter call condition does not meet the target condition.
[0152] Optionally, after determining that the parameter call conditions do not meet the target conditions, the second agent generates a parameter completion request. The parameter completion request is a natural language query statement for missing input parameters, used to query the initiator of the target task for the values of the missing required input parameters.
[0153] The second agent constructs a natural language query statement based on the parameter names and data types of the required input parameters in the pending state. This query statement uses a language consistent with human interaction habits, clearly explaining the missing parameter content and the method of providing the parameters.
[0154] For example, if the target application tool is a data analysis tool, its required input parameters include data source and analysis dimension. However, if the target task only provides the data source and not the analysis dimension, the second agent generates a parameter completion request: "Please provide the dimension you wish to analyze, such as by time, by region, or by product category."
[0155] In another feasible implementation, when generating the parameter completion request, the second agent also provides optional values or value examples for the parameters. If the range of values for the required input parameter is a finite enumeration, the second agent lists the optional values in the query statement; if the range of values for the required input parameter is a continuous value or open text, the second agent provides typical value examples in the query statement to help the initiating end understand the expected format of the parameter.
[0156] Optionally, the second agent sends the generated parameter completion request to the initiator of the target task. The initiator can be a user terminal device or another system module that submits the target task to the first agent. The second agent forwards the parameter completion request to the initiator through the first agent, or sends the parameter completion request directly to the initiator.
[0157] Optionally, after sending a parameter completion request, the second agent waits for the initiating end to return the completed parameter data. Upon receiving the parameter completion request, the initiating end allows the user to input the missing parameter information or retrieves the missing parameter information from other data sources, and then returns the completed parameter data to the second agent. Upon receiving the completed parameter data, the second agent updates the acquisition status of the corresponding required input parameter in the parameter invocation conditions to "acquired," and then transmits the completed parameter data to the target application tool for task execution.
[0158] By adopting the above technical solution, the second intelligent agent obtains the parameter calling conditions of the target application tool and checks whether they meet the target conditions. When it finds that the required input parameters are missing, it generates a parameter completion request in natural language and sends it to the initiating end. This realizes automatic checking of parameter integrity and interactive completion of missing parameters, avoids task execution failure due to incomplete parameters, reduces the number of round trips in task processing, and improves the automation level and one-time success rate of task processing.
[0159] Based on the above embodiments, as an optional embodiment, in order to enable the first intelligent agent to more comprehensively understand the compatibility of candidate application tools and make more accurate tool selection decisions, and at the same time to facilitate the first intelligent agent to obtain the execution scheme of candidate application tools to support subsequent task orchestration, the above task processing method may further include the following operations.
[0160] The second agent determines the recommended responses of multiple candidate application tools relative to the target task; the recommended responses are obtained by combining at least one of the following fields;
[0161] The adaptation identifier field is used to characterize the degree of adaptation of the candidate application tool to the target task;
[0162] The "Adaptation Reason" field is used to characterize the basis for the candidate application tool's ability to adapt to the target task.
[0163] The execution plan field is used to characterize the execution logic of the candidate application tool to complete the target task.
[0164] In this embodiment, the self-recommendation response is structured adaptation information generated by the second agent. This response represents the candidate application tool's willingness and ability to perform the target task to the first agent. The fields included in the self-recommendation response are used to describe the matching status between the candidate application tool and the target task from different dimensions. In some implementations, each second agent uniquely corresponds to one candidate application tool.
[0165] The adaptation identifier field is used to characterize the degree to which candidate application tools are adapted to the target task. The adaptation identifier field reflects, quantitatively or qualitatively, the extent to which the candidate application tools match the target task in terms of their ability to complete it.
[0166] In one feasible implementation, the fit identification field takes the form of a numerical value, such as a fit score or capability confidence level.
[0167] The "Adaptation Reason" field is used to characterize the basis for the candidate application tool's ability to adapt to the target task. This field explains why the candidate application tool is suitable for performing the target task and what functional capabilities it possesses that match the requirements of the target task.
[0168] In one feasible implementation, the adaptation reason field includes a description of the match between the functions supported by the candidate application tool and the functions required by the target task. For example, if the target task is "generating sales data analysis reports", the adaptation reason field of the candidate application tool can be "This tool supports multi-dimensional analysis of sales data, can perform data statistics by time, region, and product category, and supports the generation of charts and report documents".
[0169] Optionally, the adaptation reason field may also include the performance or success stories of the candidate application tool in historical tasks.
[0170] The execution plan field characterizes the execution logic of the candidate application tool to complete the target task. It describes the specific execution steps or processing flow that the candidate application tool will take, enabling the first agent to understand how the candidate application tool achieves the target task.
[0171] In one feasible implementation, the execution plan field contains a sequence of execution steps for the candidate application tool. For example, if the target task is a flight query, the execution plan field could be "Step 1: Call the flight information query interface based on the departure point, destination, and departure date; Step 2: Filter the list of flights that meet the criteria; Step 3: Sort by departure time and return the top 10 results".
[0172] Optionally, the execution plan field may also include the input parameters that the candidate application tool needs to call and the expected output format. For example, the execution plan field may include "Input parameters: departure point (text), destination (text), departure date (date format); Output result: a flight list containing fields such as flight number, departure time, arrival time, and price".
[0173] By adopting the above technical solution, the second intelligent agent generates a self-recommendation response containing an adaptation identifier field, an adaptation reason field, and an execution plan field. This enables the first intelligent agent not only to know the adaptation degree of the candidate application tools, but also to understand the basis for adaptation and the specific execution method. This supports the first intelligent agent in making more accurate and evidence-based tool selection decisions, and improves the transparency of intelligent agent collaboration and the predictability of task processing.
[0174] Based on the above embodiments, as an optional embodiment, in order to cope with the complexity and diversity of the target tasks and enable the first intelligent agent to flexibly organize the calling method of the target application tools in order to efficiently complete the target tasks that cannot be completed by a single tool or require the cooperation of multiple tools, the above task processing method may further include the following operations.
[0175] The first intelligent agent generates the execution flow of the target task, and calls the target application tool to execute the target task based on the execution flow to obtain the response result for the target task; wherein, the execution flow includes at least one of the following: a serial flow of calling at least one target application tool in sequence; a parallel flow of calling at least two target application tools in parallel; a branch flow of different target application tools.
[0176] In this embodiment, the execution flow is a tool invocation orchestration scheme generated by the first intelligent agent based on the requirements of the target task and the determined target application tools. This execution flow defines the invocation order, invocation method, and data transmission method of the target application tools.
[0177] A serial process refers to an execution method in which at least one target application tool is called sequentially in a predetermined order, wherein the target application tool called later can use the output of the target application tool called earlier as input parameters.
[0178] In one feasible implementation, when the first agent determines that the target task requires multiple processing steps and that there are dependencies between the steps, it generates a sequential process. The first agent maps each processing step to a corresponding target application tool and determines the invocation order of the target application tools according to the dependencies between the steps.
[0179] Parallel processing refers to an execution method that simultaneously calls at least two target application tools, where the calls to each target application tool are independent of each other and there is no sequential dependency. After the calls are completed, the output results of each target application tool are aggregated.
[0180] In one feasible implementation, when the first intelligent agent determines that the target task contains multiple independent subtasks, it generates a parallel process. The first intelligent agent assigns each subtask to the corresponding target application tool and simultaneously initiates calls to each target application tool, then summarizes the results after all target application tools return them.
[0181] Branching process refers to the execution method of selecting and calling different target application tools according to specific conditions. The first agent judges the conditions based on the parameter characteristics of the target task or the intermediate execution results, and selects the corresponding target application tool to call according to the judgment results.
[0182] In one feasible implementation, when the first agent determines that there are multiple possibilities for the processing path of the target task, it generates a branching process. The first agent defines the branching conditions and the target application tools corresponding to each branch, and selects to enter the appropriate branch based on the actual situation during execution.
[0183] Optionally, the execution flow generated by the first intelligent agent can combine multiple flow types. For example, the execution flow can include a hybrid flow that first calls multiple data query tools in parallel to obtain data from different sources, and then calls data merging tools and data analysis tools in sequence for processing.
[0184] By adopting the above technical solution, the first intelligent agent generates an execution flow including serial, parallel, and branching processes, and orchestrates the invocation of target application tools based on the execution flow, thereby supporting the decomposition and collaborative processing of complex tasks, improving the flexibility and efficiency of task processing, and enabling the intelligent agent to cope with diverse task requirements and changing execution scenarios.
[0185] Based on the above embodiments, as an optional embodiment, in order to ensure the execution quality of the target task, avoid result quality problems caused by improper tool selection or unreasonable execution process design, and enable the first intelligent agent to have self-optimization and adjustment capabilities to improve the accuracy and reliability of task processing, the above task processing method may further include the following operations.
[0186] The first agent determines the quality indicators of the response results for the target task; if the quality indicators of the response results do not meet the preset conditions, the first agent updates the execution process.
[0187] The updated execution flow changes in at least one of the following: the selection of the target application tool; the order in which the target application tools are called; and the calling parameters of the target application tool.
[0188] In this embodiment, the quality index is a quantitative or qualitative indicator used by the first intelligent agent to evaluate the quality level of the response result. This quality index reflects the degree to which the response result meets the requirements of the target task.
[0189] In one feasible implementation, the quality indicators include at least one of the following: completeness, accuracy, and timeliness of the response results. Completeness refers to whether the response results contain all the information elements required by the target task; accuracy refers to the degree of consistency between the information in the response results and objective facts or expected results; timeliness refers to the generation time of the response results or the freshness of the information in the response results.
[0190] For example, if the target task is to query flight information, the first intelligent agent determines the quality indicators including: in terms of completeness, checking whether the response result contains necessary fields such as flight number, departure time, arrival time, and price; in terms of accuracy, checking whether the flight information in the response result is consistent with the airline database; and in terms of timeliness, checking whether the response time is within 3 seconds.
[0191] Optionally, the first intelligent agent compares the quality indicators with preset conditions, which are qualification thresholds or standards set for each quality indicator. If the value of the quality indicator meets the preset conditions, it indicates that the response result is of qualified quality; if the value of the quality indicator does not meet the preset conditions, it indicates that the response result has defects.
[0192] In one feasible implementation, after determining that the quality indicators do not meet the preset conditions, the first intelligent agent analyzes the reasons for the quality problem of the response result and updates the execution process accordingly. The update method of the execution process includes at least one of adjusting the selection of the target application tool, adjusting the calling order of the target application tool, and adjusting the calling parameters of the target application tool.
[0193] A change in the selection of the target application tool refers to the first agent replacing a target application tool in the original execution flow, adding a new target application tool, or removing a target application tool.
[0194] For example, if the first agent finds that the accuracy of the data returned by the currently selected data query tool does not meet the preset conditions, the first agent will replace the data query tool with another candidate application tool with higher accuracy in the adaptation information in the updated execution process.
[0195] The change in the calling order of the target application tools refers to the first agent adjusting the calling order of multiple target application tools in the original execution flow, or changing the target application tools that were originally called serially to be called in parallel, or changing the target application tools that were originally called in parallel to be called serially.
[0196] For example, if the first intelligent agent discovers that the original execution flow calls the data analysis tool first and then the data cleaning tool, resulting in inaccurate analysis results, the first intelligent agent adjusts the calling order in the updated execution flow to call the data cleaning tool first and then the data analysis tool.
[0197] The change in the calling parameters of the target application tool refers to the first agent modifying the value, format, or combination of the input parameters passed to the target application tool.
[0198] Optionally, after updating the execution flow, the first intelligent agent re-invokes the target application tool to execute the target task based on the updated execution flow, obtains a new response result, and re-determines the quality indicators of the new response result. If the new quality indicators meet the preset conditions, the first intelligent agent outputs a new response result; if the new quality indicators still do not meet the preset conditions, the first intelligent agent can continue to update the execution flow until the quality indicators meet the preset conditions or the preset maximum number of updates is reached.
[0199] By adopting the above technical solution, the first intelligent agent determines the quality indicators of the response results and compares them with preset conditions. When quality problems are found, the execution process is updated, thereby realizing quality monitoring and adaptive optimization of task execution, improving the quality level of the response results and the reliability of task processing, and enhancing the agent's self-correction and continuous improvement capabilities.
[0200] Please refer to Figure 4 , Figure 4 This is a block diagram of a task processing device provided in an embodiment of this application.
[0201] This application also discloses a task processing device 400, including:
[0202] The first intelligent agent module 401 is used to obtain the target task;
[0203] The second intelligent agent module 402 is used to generate tool matching information for selecting application tools based on the target task;
[0204] The first intelligent agent module 401 is further configured to determine the target application tool for executing the target task based on the tool matching information, call the target application tool to execute the target task, and obtain a response result for the target task.
[0205] In one feasible implementation, the second intelligent agent module 402 is specifically used for: determining the adaptation information of multiple candidate application tools to the target task based on the task information of the target task; determining at least one target application tool from the multiple candidate application tools based on the adaptation information of the multiple candidate application tools; and generating tool matching information of the at least one target application tool.
[0206] In one feasible implementation, the first intelligent agent module 401 is specifically used to: broadcast the target task to a plurality of second intelligent agent modules 402; each second intelligent agent module 402 corresponds to at least one candidate application tool; each second intelligent agent module 402 determines the adaptation information of the candidate application tool for the target task based on the capabilities of the corresponding candidate application tool, and obtains the tool matching information.
[0207] In one feasible implementation, the second intelligent agent module 402 is specifically used for: obtaining a common first description parameter for each candidate application tool; processing the first description parameter based on the target task to obtain a second description parameter for the target task; and determining the adaptation information of each candidate application tool for the target task based on the second description parameter.
[0208] In one feasible implementation, the second intelligent agent module 402 is further configured to: generate a mapping relationship between the first description parameter and the second description parameter; and generate an updated second description parameter based on the changed first description parameter and the mapping relationship in response to a change in the first description parameter of the candidate application tool.
[0209] In one feasible implementation, the second intelligent agent module 402 is further configured to: obtain the parameter calling conditions of each target application tool; the parameter calling conditions characterize the input parameters required by the target application tool to execute the target task; if the parameter calling conditions do not meet the target conditions, send a parameter completion request to the initiator of the target task.
[0210] In one feasible implementation, the second intelligent agent module 402 is specifically used to: determine the self-recommendation response of the plurality of candidate application tools relative to the target task.
[0211] In one feasible implementation, the first intelligent agent module 401 is specifically used to: generate the execution flow of the target task, so as to call the target application tool to execute the target task based on the execution flow, and obtain a response result for the target task.
[0212] In one feasible implementation, the first intelligent agent module 401 is further configured to: determine the quality index of the response result for the target task; and update the execution process if the quality index of the response result does not meet the preset conditions.
[0213] Figure 5 This is a structural block diagram of an intelligent agent provided in an embodiment of this application.
[0214] In the embodiments of this application, inspired by the von Neumann architecture in modern computer theory, such as... Figure 5 As shown, the intelligent agent 500 may include multiple core modules: an input module 510, a control module 520, and an output module 530.
[0215] It should be noted that both the first and second intelligent agents in the embodiments of this application can adopt the following methods: Figure 5The two agent architectures shown are similar in structure, but differ in functional positioning and processing logic. The first agent focuses on task management, tool selection decisions, and execution process orchestration, while the second agent focuses on tool capability matching, adaptation information generation, and parameter completion processing.
[0216] In the example, the input module 510 is responsible for receiving or sensing information such as calls, queries, requests, instructions, signals, problem information, or data from the outside world (e.g., users or the external environment), and converting it into a format that the intelligent agent 500 can understand and process. The input module 510 is the primary link for the intelligent agent 500 to interact with the outside world. It enables the intelligent agent 500 to efficiently and accurately obtain the necessary "sensory" information from the outside world and respond to this information.
[0217] In one feasible implementation, when agent 500 acts as the first agent, input module 510 receives a target task sent by a user terminal device. This target task carries task information, including a target description, input data identifiers, and task constraints. Input module 510 also receives tool matching information returned by the second agent. This tool matching information includes structured data such as an adaptation identifier field, an adaptation reason field, and an execution plan field.
[0218] In another feasible implementation, when agent 500 acts as the second agent, input module 510 is used to receive a target task broadcast by the first agent, which includes information such as task type and task content. Input module 510 is also used to receive notifications of changes to the first description parameters of candidate application tools, so as to update tool capability information in a timely manner.
[0219] In the example, the control module 520 is the core support for the intelligent agent 500's ability to handle complex tasks. The control module 520 is used to execute corresponding processing logic based on the input information received by the input module 510 and generate output information.
[0220] In one feasible implementation, when agent 500 acts as the first agent, control module 520 parses the task information of the target task, determines the target application tool based on tool matching information, generates the execution flow of the target task, schedules the target application tool to execute the target task, and evaluates the quality indicators of the response results. If the quality indicators do not meet the preset conditions, control module 520 is also used to update the execution flow and adjust the selection, calling order, or calling parameters of the target application tool.
[0221] In another feasible implementation, when agent 500 acts as the second agent, control module 520 determines the compatibility information of multiple candidate application tools with the target task based on the task information of the target task, selects at least one target application tool from the multiple candidate application tools, and generates tool matching information for the target application tool. Control module 520 is also used to obtain the parameter calling conditions of each target application tool, determine whether the parameter calling conditions meet the target conditions, and if not, generate a parameter completion request.
[0222] In the example, output module 530 can be used to output the output information generated by output control module 520.
[0223] In one feasible implementation, when agent 500 acts as the first agent, output module 530 is used to return a response result for the target task to the user terminal device. This response result can be the direct output of the target application tool after executing the target task, or it can be a processed result after format conversion or content integration. Output module 530 is also used to send a broadcast message of the target task to the second agent.
[0224] In another feasible implementation, when agent 500 acts as the second agent, output module 530 returns generated tool matching information to the first agent. This tool matching information includes the compatibility identifier, compatibility reason, and execution plan of the target application tool. Output module 530 is also used to send a parameter completion request to the initiator of the target task to obtain the missing parameters required to execute the target task.
[0225] In the example, the control module 520 may include a control unit 521, a storage unit 522, and a processing unit 523.
[0226] During operation, the control unit 521 will continuously interact with the storage unit 522, the arithmetic unit 523, and / or the output module 530. However, in the embodiments of this application, the control unit 521 initiates communication with the storage unit 522, the arithmetic unit 523, and / or the output module 530 as a single initiator, and there may be no communication coupling between the storage unit 522, the arithmetic unit 523, and the output module 530.
[0227] In the example, the performance of control unit 521 can be closely related to the large model on which agent 500 is based. To fully leverage the capabilities of the large language model, the internal structure of control unit 521 can be designed to be highly configurable and scalable to handle various types of tasks and requirements in real-world scenarios.
[0228] In one feasible implementation, when agent 500 acts as the first agent, control unit 521, based on the reasoning capabilities of a large language model, parses the adaptation identifier, adaptation reason, and execution plan in the tool matching information, determines the most suitable target application tool, and generates an execution flow that includes serial, parallel, or branching processes. Control unit 521 is also responsible for monitoring the quality indicators of the response results and triggering the update logic of the execution flow when the quality indicators do not meet preset conditions.
[0229] In another feasible implementation, when agent 500 acts as the second agent, control unit 521, based on the semantic understanding capability of a large language model, performs matching analysis between the task information of the target task and the first description parameters of the candidate application tools to generate second description parameters for the target task, and determines adaptation information based on the second description parameters. Control unit 521 is also responsible for generating the mapping relationship between the first description parameters and the second description parameters, and automatically updating the second description parameters based on the mapping relationship when the first description parameters change.
[0230] Storage unit 522 can be responsible for remembering information such as historical dialogues, event streams, tool description information, and task execution records.
[0231] In one feasible implementation, when agent 500 acts as the first agent, storage unit 522 is used to store data such as task information of the target task, received tool matching information, determined target application tool information, generated execution flow, and quality indicators of response results. Storage unit 522 is also used to store execution records and quality evaluation results of historical tasks, so that control unit 521 can refer to historical experience to optimize decisions when processing new tasks.
[0232] In another feasible implementation, when agent 500 acts as the second agent, storage unit 522 is used to store data such as first description parameters of candidate application tools, second description parameters generated for different tasks, mapping relationships between the first and second description parameters, and parameter calling conditions. Storage unit 522 is also used to cache generated tool matching information for rapid response when similar tasks arrive.
[0233] It should be noted that the complete capability information of the candidate application tools maintained in the storage unit 522 of the second agent enables the second agent to independently complete the tool capability matching and adaptation information generation without requesting additional tool description information from the first agent, thereby avoiding the context burden on the first agent.
[0234] The computation unit 523 can be viewed as a predefined tool library containing various tools and functional modules that the agent 500 can call during task execution.
[0235] In one feasible implementation, when agent 500 acts as the first agent, the computing unit 523 includes a task parsing tool, a tool matching information analysis tool, an execution flow generation tool, a quality index calculation tool, and a result format conversion tool. The control unit 521 can invoke the appropriate tools from the computing unit 523 to assist in completing the task processing as needed for the current processing stage.
[0236] In another feasible implementation, when agent 500 acts as a second agent, the computing unit 523 includes tools for task information extraction, semantic matching, adaptation information evaluation, parameter conversion, and parameter completion request generation. The control unit 521 can invoke these tools to implement the complete process from target task analysis to tool matching information generation.
[0237] Optionally, when agent 500 acts as the second agent, the computing unit 523 also includes the candidate application tool itself. The second agent is not only responsible for evaluating the adaptability of the candidate application tool, but can also directly call the candidate application tool to perform operations such as parameter verification and functional testing, so as to improve the accuracy of adaptability information evaluation.
[0238] In the example, when agent 500 needs to format or render output data, it can call relevant format conversion and display tools from processing unit 523 and feed them back to control module 520. Then, control module 520 can use the fed-back tools to process the data and pass the rendered result to output module 530. It is understandable that although large language models have excellent language understanding and generation capabilities, like humans, the tasks they can solve without any tools are very limited. When agent 500 is given the ability to call tools, it can perform tasks such as result formatting, parameter validation, and semantic matching.
[0239] The intelligent agent 500 according to the embodiments of this application can simply and effectively improve the level of intelligence, and enhance flexibility and versatility. By instantiating the intelligent agent 500 into a first intelligent agent and a second intelligent agent respectively, and configuring different control logic, storage content and tool sets for the two, the responsibilities of task management and tool matching can be separated, avoiding the context overload problem caused by a single intelligent agent managing a large-scale tool library, and improving the scalability and task processing efficiency of the system.
[0240] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this application is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this application, and all such substitutions and modifications should fall within the scope of this application.
Claims
1. A task processing method, comprising: The first intelligent agent obtains the target task; The second intelligent agent generates tool matching information for selecting application tools based on the target task; The first intelligent agent determines the target application tool for executing the target task based on the tool matching information, calls the target application tool to execute the target task, and obtains a response result for the target task.
2. The method according to claim 1, wherein the second intelligent agent generates tool matching information for application tool selection based on the target task, comprising: Based on the task information of the target task, the second intelligent agent determines the adaptation information of multiple candidate application tools for the target task; The second intelligent agent determines at least one target application tool from the plurality of candidate application tools based on the adaptation information of the plurality of candidate application tools; Generate tool matching information for the at least one target application tool.
3. The method according to claim 1, further comprising: The first intelligent agent broadcasts the target task to multiple second intelligent agents; Each of the second intelligent agents corresponds to at least one candidate application tool; The second agent generates tool matching information for application tool selection based on the target task, including: Each of the second intelligent agents determines the adaptation information of the candidate application tool for the target task based on the capabilities of the corresponding candidate application tool, thereby obtaining tool matching information.
4. The method according to claim 2 or 3, further comprising: The second intelligent agent acquires common first description parameters for each of the candidate application tools; The second agent processes the first description parameters based on the target task to obtain a second description parameter for the target task; The second intelligent agent determines the adaptation information of each candidate application tool for the target task based on the second description parameters.
5. The method according to claim 4, further comprising: The second agent generates a mapping relationship between the first description parameter and the second description parameter; The second agent responds to a change in the first description parameter of the target application tool and generates an updated second description parameter based on the changed first description parameter and the mapping relationship.
6. The method according to claim 2 or 3, further comprising: The second intelligent agent acquires the parameter calling conditions of each of the target application tools; The parameter calling conditions characterize the input parameters required for the target application tool to execute the target task; If the parameter calling conditions do not meet the target conditions, the second agent sends a parameter completion request to the initiator of the target task.
7. The method according to claim 2 or 3, further comprising: The second agent determines a plurality of candidate application tools’ self-recommendation responses relative to the target task; the self-recommendation response is obtained by combining at least one of the following fields; The adaptation identifier field is used to characterize the degree of adaptation of the candidate application tool to the target task; The adaptation reason field is used to characterize the basis for the candidate application tool's ability to adapt to the target task; The execution scheme field is used to characterize the execution logic of the candidate application tool in completing the target task.
8. The method according to claim 1, further comprising: The first intelligent agent generates an execution flow for the target task, and invokes the target application tool based on the execution flow to execute the target task, thereby obtaining a response result for the target task; wherein the execution flow includes at least one of the following: A serial process that sequentially calls at least one target application tool; Parallel processes that invoke at least two target application tools in parallel; Branching processes for different target application tools.
9. The method according to claim 8, further comprising: The first intelligent agent determines the quality indicators of the response results for the target task; If the quality index of the response result does not meet the preset conditions, the first agent updates the execution process; The updated execution process changes in at least one of the following: The selection of the target application tool; The order in which the target application tools are invoked; The calling parameters of the target application tool.
10. A task processing apparatus, comprising: The first intelligent agent module is used to obtain the target task; The second intelligent agent module is used to generate tool matching information for selecting application tools based on the target task; The first intelligent agent module is further configured to determine the target application tool for executing the target task based on the tool matching information, call the target application tool to execute the target task, and obtain a response result for the target task.