Intelligent agent calling method based on large language model and related device
By using an agent invocation method based on a large language model, tasks are automatically decomposed, agents are matched, and results are aggregated, solving the problem of low efficiency in multi-agent invocation in existing technologies and realizing efficient and flexible multi-agent collaborative work.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QINGDAO JUSHANGHUI NETWORK TECH CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-08
AI Technical Summary
Existing multi-agent invocation schemes are inefficient when faced with scenarios where task types change or invocation order needs to be flexibly adjusted, making it difficult to meet the business requirements of multiple objectives, multiple steps, and dynamic changes.
A large language model-based agent invocation method is adopted. The task decomposer breaks down the natural task statement into sub-task statements, uses the large language model to perform task requirement analysis and agent matching, generates an invocation plan, and calls the agent to process the sub-task through the routing scheduler. Finally, the result aggregator aggregates the processed results.
It enables flexible collaborative work among multiple agents, improves invocation efficiency, ensures the integrity and consistency of task results, and enhances the user experience.
Smart Images

Figure CN121996374A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and related apparatus for invoking intelligent agents based on a large language model. Background Technology
[0002] An intelligent agent is an entity capable of perceiving its environment, analyzing the perceived information, making autonomous decisions, and executing corresponding actions to achieve predetermined goals. It can exist as a software program or be encapsulated as a system module with specific functions. The core characteristic of an intelligent agent is its degree of autonomy, enabling it to complete task processing and decision-making with minimal human intervention. With the development of artificial intelligence technology, especially the improvement of natural language processing and reasoning capabilities, intelligent agents are increasingly widely used in task planning, information processing, and automated decision-making.
[0003] However, as business scenarios become increasingly complex, single agents gradually reveal their limitations in terms of capability boundaries, task parallelism, and complex process handling, making it difficult to meet the needs of multi-objective, multi-step, and dynamically changing business requirements. Therefore, existing technologies have gradually introduced multi-agent collaborative work methods, where multiple agents cooperate to complete complex tasks. Nevertheless, existing multi-agent invocation schemes typically rely on preset invocation logic or fixed collaboration processes, and still suffer from low invocation efficiency when facing scenarios where task types change or invocation order needs to be flexibly adjusted. Therefore, there is an urgent need for a multi-agent invocation method based on LLM (Local Management Model). Summary of the Invention
[0004] In view of the above problems, this application provides a method and related apparatus for invoking intelligent agents based on a large language model, so as to achieve efficient invoking of intelligent agents. The specific solution is as follows:
[0005] The first aspect of this application provides a method for invoking an intelligent agent based on a large language model, including:
[0006] Receive the task natural statement sent by the user, and decompose the task natural statement into sub-task statements based on the task decomposer. The sub-task statements are natural statements.
[0007] The large language model is used to analyze the task requirements of the subtask statements to obtain the subtask requirements. Then, based on the task decomposer, the task requirements are used to generate a list of subtasks.
[0008] The large language model is used to perform agent matching on the subtask list to obtain the calling plan of the agent corresponding to each subtask in the subtask list, and the calling plan is sent to the routing scheduler.
[0009] The routing scheduler calls the agent to process the subtask corresponding to the agent and obtains the processing result;
[0010] The processing results are sent to the result aggregator for aggregation, and the aggregated results are then output.
[0011] Optionally, based on the task decomposer, a task generation operation is performed on the subtask requirements to obtain a list of subtasks, including:
[0012] Perform a task type determination operation on the subtask requirements to determine the task type of the subtasks required to complete the subtask requirements. At least one subtask is required.
[0013] Based on the task type, generate subtasks to complete the subtask requirements, and build at least one subtask list based on the subtasks.
[0014] Optionally, perform agent matching on the subtask list to obtain the invocation plan for the agent corresponding to each subtask in the subtask list, including:
[0015] Determine if a subtask has dependent tasks;
[0016] If a subtask has no dependent tasks, then the subtask is determined to be an executable task;
[0017] If a subtask has dependent tasks, then perform a status check operation on the dependent tasks of the subtask and obtain the status check result.
[0018] If the status check result indicates that the dependent task has been completed, then the subtask is determined to be an executable task.
[0019] If the status check result is that the dependent task has not been completed, the subtask is determined to be an unexecutable task.
[0020] The agents in the agent library are evaluated by a large language model to obtain agents that match the subtasks that are determined to be executable tasks, and a call plan is generated. The agent library includes multiple pre-packaged agents.
[0021] Optionally, agents in the agent library are evaluated using a large language model to obtain agents that match the subtasks determined to be executable tasks, including:
[0022] Based on the intent of the subtask and the function of the agent, search the agent library for agents that can realize the intent of the subtask.
[0023] If only one agent is found, then the agent is identified as the one that matches the subtask.
[0024] If multiple agents are found, their historical success rates and load parameters are obtained, and the historical success rates and load parameters of each agent are weighted and calculated to obtain the comprehensive score of each agent.
[0025] Agents that match the sub-tasks are selected based on their overall scores.
[0026] Optionally, the task decomposer breaks down the natural task statement into subtask statements, including:
[0027] Semantic parsing is performed on the task's natural language statements to obtain recognition results, which include task intent, time dimension, and task object.
[0028] Based on the recognition results, the task natural statements are divided into task units to split the task natural statements into multiple sub-task statements with independent execution semantics.
[0029] Optionally, the agent can be invoked by the routing scheduler to handle the subtask corresponding to the agent, including:
[0030] The operation information of the intelligent agent is input into the conflict detector to obtain the conflict detection result. The conflict detection result is the detection result of the conflict between resource consumption and data access between different intelligent agents during the execution process.
[0031] If the conflict detection result is no conflict, then the agent is invoked to process the subtask corresponding to the agent;
[0032] If the conflict detection result is a conflict, the agent's operation information is analyzed and processed through the large language model to obtain the conflict analysis result, and the conflict analysis result is returned to the conflict detector.
[0033] The conflict detector generates a solution based on the conflict analysis results, adjusts the parameters of the agent based on the solution, and calls the agent with adjusted parameters to process the sub-task corresponding to the agent.
[0034] A second aspect of this application provides an intelligent agent invocation device based on a large language model, comprising:
[0035] The statement analysis module is used to receive the task natural statements sent by the user and decompose the task natural statements into sub-task statements based on the task decomposer. The sub-task statements are natural statements.
[0036] The subtask generation module is used to analyze the task requirements of subtask statements using a large language model, obtain subtask requirements, and generate a list of subtasks based on the task decomposer.
[0037] The call plan generation module is used to perform agent matching operation on the subtask list using a large language model, obtain the call plan of the agent corresponding to each subtask in the subtask list, and send the call plan to the routing scheduler.
[0038] The task processing module is used to call the agent through the routing scheduler to process the subtask corresponding to the agent and obtain the processing result.
[0039] The result integration module is used to send the processing results to the result aggregator for aggregation processing, obtain the aggregated result, and output the aggregated result.
[0040] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the agent invocation method based on a large language model as described in the first aspect or any implementation thereof.
[0041] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0042] The memory is used to store computer programs;
[0043] The processor is used to execute the computer program so that the electronic device can implement the agent invocation method based on a large language model as described in the first aspect or any implementation thereof.
[0044] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the agent invocation method based on a large language model as described in the first aspect or any implementation thereof.
[0045] By employing the above technical solution, compared with the existing technology that typically relies on preset calling logic or fixed collaboration processes for multi-agent invocation schemes, this invention introduces an LLM-based task decomposition, subtask requirement analysis, and agent matching mechanism. This automatically decomposes the user-sent task statements into multiple subtask requirements, generates corresponding agent invocation plans based on the subtask requirements, and then uses a routing scheduler to invoke multiple agents in an orderly manner and aggregate the processing results. This enables flexible collaborative work among multiple agents and improves the invocation efficiency of multi-agent systems. Attached Figure Description
[0046] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0047] Figure 1 A flowchart illustrating an intelligent agent invocation method based on a large language model provided in this application;
[0048] Figure 2 A schematic diagram of the agent invocation process of an agent invocation method based on a large language model provided in this application;
[0049] Figure 3 A schematic diagram of the dependency task judgment process for an agent invocation method based on a large language model provided in this application;
[0050] Figure 4 A schematic diagram of the conflict detection process for an agent invocation method based on a large language model provided in this application;
[0051] Figure 5 A schematic diagram of the structure of an intelligent agent calling a device based on a large language model, provided for this application;
[0052] Figure 6 A schematic block diagram of an electronic device provided in this application. Detailed Implementation
[0053] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0054] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0055] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0056] This application provides a method for invoking intelligent agents based on a large language model, such as... Figure 1 The method may include the following steps:
[0057] S101: Receives the task natural statement sent by the user, and decomposes the task natural statement into sub-task statements based on the task decomposer. The sub-task statements are natural statements.
[0058] A task natural language statement is a statement expressed by a user in natural language to describe the overall task they expect to complete. This task natural language statement can be obtained through text input, speech recognition transcription, or other human-computer interaction methods. It typically contains multiple semantic elements, such as the task objective, the task object, and possibly implicit execution order or time requirements, but does not require the user to explicitly specify specific execution steps or the agent to be invoked. For example, a task natural language statement might be: "Collect market data from the past week and generate an analysis report," "Organize project materials and send them to relevant personnel," or "First query user information, then generate statistical results and output them." Upon receiving the task natural language statement, this application can process it using a task decomposer. The task decomposer can be used to perform semantic parsing and task structure analysis on the task natural language statement to identify multiple independently executable task units within the task, and thereby decompose the task natural language statement into multiple sub-task statements. Sub-task statements are still represented in natural language form, and each sub-task statement corresponds to a subtask with relatively independent semantics, used to describe the specific steps or operations required to complete the overall task. For example, the task statement "Help me collect market data from the past week and generate an analysis report" can be broken down into at least two sub-task statements: "Collect market data from the past week" and "Generate an analysis report based on the market data." In this way, without requiring users to have knowledge of task decomposition or system calls, the task decomposer automatically breaks down the task statement, providing a foundation for subsequent requirements analysis, agent matching, and scheduling execution of sub-tasks.
[0059] S102: Utilize a large language model to perform task requirement analysis on the subtask statements, obtain subtask requirements, and perform task generation operations on the subtask requirements based on the task decomposer to obtain a list of subtasks.
[0060] In this embodiment, after obtaining the subtask statements generated by the task decomposer, a large language model can be used to analyze the task requirements of the subtask statements in order to obtain the corresponding subtask requirements.
[0061] Specifically, subtask statements are descriptions in natural language form, representing only the content of the task to be completed but not explicitly specifying the processing methods required to accomplish it. Therefore, by inputting the subtask statements into a large language model, which performs semantic understanding and analysis, the core requirements for completing the subtask can be identified. Subtask requirements may include, but are not limited to: task objectives, required capabilities, processing objects, and expected output formats.
[0062] For example, when a subtask statement is "Collect market data for the past week," the large language model can analyze the corresponding subtask requirements as follows: It requires performing data query or data collection operations, processing market-related data, covering the past week, and outputting a structured or analyzable dataset. When another subtask statement is "Generate an analysis report based on market data," the large language model can analyze the subtask requirements as follows: It requires analyzing and processing existing data to generate a report with summary or conclusions. Secondly, after obtaining the subtask requirements, a task generation operation is performed based on the task decomposer. The task generation operation transforms the abstract subtask requirements into executable subtask descriptions, thereby generating a subtask list. The subtask list can include one or more subtasks, each corresponding to a specific executable operation, and is used for subsequent agent matching and scheduling. For example, for subtask requirements derived from the subtask statement "collect market data from the past week," the task decomposer can generate data collection subtasks based on these requirements. Similarly, for subtask requirements derived from the subtask statement "generate analysis report," data analysis and content generation subtasks can be generated, and these subtasks can be organized into a subtask list in logical order. This application achieves automatic analysis from subtask statements to subtask requirements. It can accurately extract execution requirements from natural language descriptions and form a schedulable task structure, which is beneficial for improving the accuracy and overall execution efficiency of multi-agent invocation processes.
[0063] It should be noted that analyzing a subtask statement can yield one or more subtask requirements. Based on the subtask requirements of a subtask statement, one or more subtask lists can be generated, and each subtask list can include one or more subtasks.
[0064] S103: Use the large language model to perform agent matching on the subtask list, obtain the calling plan of the agent corresponding to each subtask in the subtask list, and send the calling plan to the routing scheduler.
[0065] Optionally, in this embodiment, after obtaining the subtask list generated by the task decomposer, an agent matching operation is performed on the subtask list using a large language model to determine the agents that can execute each subtask and generate the corresponding invocation plan.
[0066] Specifically, the subtask list includes one or more subtasks, each of which is an independent execution unit required to complete the overall task and is described with explicit task semantics. The system inputs the subtask list into a large language model, which then analyzes each subtask based on its understanding of the subtask semantics to determine the type of capability and processing method required to complete the subtask.
[0067] In this embodiment, the large language model can select an agent from a pre-built agent library that matches the function of a subtask based on the subtask's task objective, processing object, and execution method. The agent library includes multiple pre-packaged agents, each with different functional capabilities, such as data acquisition, data analysis, content generation, or result verification. The large language model determines the target agent capable of completing the subtask by comparing the subtask requirements with the functional descriptions of each agent. Next, after agent matching, the large language model generates a calling plan. The calling plan describes the mapping relationship between subtasks and corresponding agents and may include the execution order of subtasks, the identification information of the called agents, and execution dependencies. For example, when the subtask list contains two subtasks, "acquire data" and "analyze data," the calling plan can explicitly call the agent with data acquisition capabilities to execute the former subtask first, and then call the agent with data analysis capabilities to execute the latter subtask. Finally, the generated calling plan can be sent to the routing scheduler. The routing scheduler is used to uniformly schedule and manage the invocation process of agents according to the invocation plan, so as to ensure that each subtask can be executed by the corresponding agent in a predetermined order and according to the rules. This application realizes the automatic matching between subtasks and agents based on a large language model and forms a structured invocation plan, which provides clear guidance for subsequent invocation of agents to execute subtasks through the routing scheduler.
[0068] S104: The routing scheduler calls the agent to process the subtask corresponding to the agent and obtains the processing result.
[0069] Optionally, in this embodiment, after the routing scheduler receives the calling plan generated by the large language model, the routing scheduler schedules and controls the calling process of the agent according to the calling plan, and sequentially calls the agents corresponding to each subtask to execute the corresponding subtask and obtain the processing result.
[0070] Specifically, the routing scheduler can schedule subtasks according to the execution order of the subtasks determined in the invocation plan. When the invocation plan contains multiple subtasks, the routing scheduler can determine the currently executable subtask based on the dependencies between them and call the agent matching that subtask to perform the processing. For example, for subtasks without dependencies, the routing scheduler can directly trigger the execution of the corresponding agent; for subtasks with dependencies, the corresponding agent is called to perform the processing only after the dependent subtasks are completed. This application implements the process of the routing scheduler uniformly scheduling agents to execute subtasks, enabling multiple agents to work collaboratively in an orderly manner within the same task framework, and ensuring that each subtask is processed by an agent with matching functionality, thereby obtaining a complete and usable processing result.
[0071] S105: Send the processing result to the result aggregator for aggregation processing, obtain the aggregation result, and output the aggregation result.
[0072] Optionally, in this embodiment, after the routing scheduler completes the invocation of each agent and obtains the corresponding processing results, it sends the processing results to the result aggregator for aggregation processing. The processing results may include the subtask execution results, intermediate analysis data, or the final output information of the subtasks returned by different agents.
[0073] The result aggregator is used to integrate and organize the processing results from multiple agents. Specifically, the result aggregator can summarize, sort, merge, or deduplicate the processing results of each subtask according to preset aggregation rules to form an overall processing result corresponding to the original task's natural language statement. For example, when the original task is broken down into multiple subtasks and each subtask is completed by a different agent, the result aggregator can combine the processing results according to the logical order determined during the task decomposition phase, thereby obtaining a complete task execution result.
[0074] In another embodiment, the result aggregator can also perform consistency verification or format unification on the processing results, so that the output results from different agents can be presented in a unified data structure or expression form, which is convenient for subsequent output or display.
[0075] After completing the aggregation process, the result aggregator generates the aggregated result and outputs it to the user or upper-layer application system. The aggregated result can be output in natural language text, structured data, or other readable formats, allowing users to intuitively obtain the task execution results based on the collaborative processing of multiple intelligent agents. This application realizes the unified aggregation and output of the processing results of multiple intelligent agents, ensuring the integrity and consistency of the results after multi-agent collaborative task execution, and improving the usability of the overall task processing flow and user experience.
[0076] like Figure 2 As shown, in another embodiment, the user layer can be comprised of complex tasks submitted by users or applications, expressing task requirements in the form of natural language statements. These natural language statements are first sent to the central coordinator, which then sends a task decomposition request to the task decomposer, simultaneously transmitting the natural language statements to the task decomposer. Upon receiving the natural language statements, the task decomposer parses them, breaking them down into multiple sub-task statements, and sends these sub-task statements to the Large Language Model (LLM). The LLM performs task requirement analysis on the sub-task statements, obtaining the corresponding sub-task requirements, and returns the task understanding results to the task decomposer. Based on the sub-task requirements, the task decomposer generates a list of sub-tasks and further utilizes the LLM to perform agent matching for each sub-task in the list, determining a corresponding agent for each sub-task and generating a corresponding agent invocation plan. Subsequently, the task decomposer sends the agent invocation plan to the central coordinator, which executes the corresponding agent invocation process through a router based on the invocation plan, thereby completing the scheduling and execution of the sub-tasks.
[0077] Optionally, in one embodiment, a task generation operation is performed on the subtask requirements based on the task decomposer to obtain a subtask list, including:
[0078] Perform a task type determination operation on the subtask requirements to determine the task type of the subtasks required to complete the subtask requirements. At least one subtask is required.
[0079] Based on the task type, generate subtasks to complete the subtask requirements, and build at least one subtask list based on the subtasks.
[0080] Specifically, after completing the task requirement analysis of the subtask statement and obtaining the subtask requirements, the task decomposer can perform a task generation operation based on the subtask requirements to construct a list of subtasks for subsequent agent invocation.
[0081] In this embodiment, the task decomposer first determines the task type of the subtask requirements. The task type characterizes the specific category of operations required to complete the subtask requirement, such as information retrieval tasks, data processing tasks, content generation tasks, or external system call tasks. For the same subtask requirement, the required subtasks can include at least one task type, or multiple different task types, to meet the execution needs of complex tasks.
[0082] For example, when the subtask requirement is "to compile and generate a project progress report," the task decomposer can determine the corresponding task type as "data collection task," "data analysis task," or "text generation task." When the subtask requirement is "to query and summarize user information under specified conditions," the task type can be determined as "database query task" or "results summary task." After determining the task type, the task decomposer generates specific subtasks to complete the subtask requirement based on the task type. Subtasks can be represented in the form of natural language or structured descriptions, and each subtask corresponds to a clear execution goal and processing logic. Subsequently, the task decomposer combines and organizes the generated one or more subtasks to construct at least one subtask list, which describes the complete set of subtasks required to complete the subtask requirement and their execution order or dependencies.
[0083] From the above, we can conclude that the task decomposer can transform abstract subtask requirements into a well-structured and executable list of subtasks, providing a clear task input basis for subsequent agent matching and routing scheduling.
[0084] Optionally, in one embodiment, an agent matching operation is performed on the subtask list to obtain a calling plan for the agent corresponding to each subtask in the subtask list, including:
[0085] Determine if a subtask has dependent tasks;
[0086] If a subtask has no dependent tasks, then the subtask is determined to be an executable task;
[0087] If a subtask has dependent tasks, then perform a status check operation on the dependent tasks of the subtask and obtain the status check result.
[0088] If the status check result indicates that the dependent task has been completed, then the subtask is determined to be an executable task.
[0089] If the status check result is that the dependent task has not been completed, the subtask is determined to be an unexecutable task.
[0090] The agents in the agent library are evaluated by a large language model to obtain agents that match the subtasks that are determined to be executable tasks, and a call plan is generated. The agent library includes multiple pre-packaged agents.
[0091] Specifically, in this embodiment, determining whether a subtask has a dependent task can be based on the correlation between the input information and output results of the subtasks. Specifically, each subtask can predefine its required input information and the output results it will produce after execution. The input information and output results can be data, files, parameter sets, or intermediate processing results, etc. When the input information of a subtask is at least partially derived from the output results of another subtask, it can be determined that the subtask has a dependency relationship with the other subtask. For example, if the first subtask is used to "query raw data from the database," and its output result is the queried data set, while the second subtask is used to "analyze the data set and generate statistical results," then the input information of the second subtask depends on the output results of the first subtask. In this case, it can be determined that the second subtask has a dependent task, and its dependent task is the first subtask. Secondly, after determining the dependency relationship, for each subtask in the subtask list, it is further determined whether it has a dependent task. If a subtask does not have any dependent tasks, that is, its input information does not depend on the output results of other subtasks, then the subtask can be directly determined as an executable task. If a subtask has dependent tasks, a status check operation is performed on the dependent tasks to obtain the status check results. The status check operation can be used to determine whether the dependent tasks have been completed and successfully generated their corresponding output results. If the status check result indicates that the dependent tasks have been completed, the current subtask can be determined as an executable task; if the status check result indicates that the dependent tasks have not been completed, the current subtask can be determined as an unexecutable task, and agent matching and invocation for that subtask will be temporarily suspended. Finally, after determining the executable tasks, multiple pre-packaged agents in the agent library are evaluated using a large language model to obtain agents that match the subtasks determined to be executable. The evaluation process can be based on the subtask's intent, input / output requirements, and the agent's functional description. Subsequently, a corresponding agent invocation plan is generated for each subtask determined to be executable, and the invocation plan is sent to the routing scheduler for subsequent execution.
[0092] like Figure 3As shown, in another embodiment, firstly, a list of prerequisite dependent tasks can be obtained, which is based on task presets. Based on the list of prerequisite dependent tasks, it is determined whether the current subtask has any dependent tasks. If no dependent tasks are found, it is directly marked as executable. If the current subtask has dependent tasks, each dependent task is traversed to obtain its task status and perform a status check. If the status check result is available, it continues to determine whether there are other dependent tasks. If no other dependent tasks are found, the subtask is marked as executable. If other dependent tasks are found, the status check operation continues for that dependent task until the subtask has no dependent tasks. If the status check result of the dependent task is unavailable, dependency failed, dependency incomplete, or status unknown, the subtask is added to a waiting queue, and dependency checks are performed on the subtask periodically until it is marked as executable.
[0093] Optionally, in one embodiment, agents in the agent library are evaluated using a large language model to obtain agents that match subtasks determined to be executable tasks, including:
[0094] Based on the intent of the subtask and the function of the agent, search the agent library for agents that can realize the intent of the subtask.
[0095] If only one agent is found, then the agent is identified as the one that matches the subtask.
[0096] If multiple agents are found, their historical success rates and load parameters are obtained, and the historical success rates and load parameters of each agent are weighted and calculated to obtain the comprehensive score of each agent.
[0097] Agents that match the sub-tasks are selected based on their overall scores.
[0098] Specifically, in this embodiment, the agent library includes multiple pre-packaged agents, each corresponding to at least one functional capability description, and can maintain operational status information related to its historical execution. The operational status information includes at least the agent's historical success rate and current load parameters. The historical success rate characterizes the proportion of tasks successfully completed by the agent in its historical task execution process, and the load parameters characterize the number of tasks or resource consumption currently undertaken by the agent.
[0099] When multiple agents capable of fulfilling the intent of a subtask deemed executable are found in the agent library, their historical success rates and load parameters can be obtained. Subsequently, the historical success rates and load parameters can be weighted and calculated to obtain a comprehensive score for each agent. The weight of the historical success rate reflects the priority of task execution reliability, while the weight of the load parameter reflects the system's load balancing requirements.
[0100] For example, in one embodiment, a higher weight can be assigned to historical success rates to prioritize agents that perform stably in similar tasks. Simultaneously, appropriate weights can be assigned to load parameters to avoid assigning new subtasks to agents with excessively high loads. By comparing the comprehensive scores of multiple agents, the agent with the highest comprehensive score is selected as the agent matching the subtask. If only one agent in the agent library can fulfill the intent of the subtask, that agent is directly identified as the agent matching the subtask. Next, after agent selection, a corresponding agent invocation plan can be generated based on the matching results and sent to the routing scheduler for subsequent scheduling and execution of the subtask. By incorporating historical success rates and load parameters for agent evaluation, this embodiment can improve resource utilization efficiency and system stability during multi-agent collaborative execution while ensuring task execution success rates.
[0101] Optionally, in one embodiment, the task natural statement is decomposed into subtask statements based on the task decomposer, including:
[0102] Semantic parsing is performed on the task's natural language statements to obtain recognition results, which include task intent, time dimension, and task object.
[0103] Based on the recognition results, the task natural statements are divided into task units to split the task natural statements into multiple sub-task statements with independent execution semantics.
[0104] Specifically, in this embodiment, the semantic parsing operation can be completed jointly by a task decomposer and a large language model or a pre-defined semantic parsing module. Through semantic understanding and analysis of the task's natural language statements, a recognition result is obtained, which includes at least the task intent, the time dimension, and the task object. The task intent characterizes the core goal or operation type the user wishes to achieve, the time dimension describes the time constraints or sequential relationships involved in task execution, and the task object indicates the specific object or data entity that the task affects.
[0105] For example, when the task statement is "Compile sales data and generate a monthly analysis report within this week," the semantic parsing operation can identify the task intent as "data compilation" and "report generation," the time dimension as "within this week," and the task objects as "sales data" and "monthly analysis report." After obtaining the identification results, the task decomposer can divide the task statement into task units based on the task intent, time dimension, and task objects. Task unit division is used to break down the overall task into multiple sub-task statements with independent execution semantics, so that each sub-task can be scheduled and executed independently. Specifically, the task decomposer can break down the original task into several sub-task statements according to the principle that different task intents correspond to different execution logics, and determine the order or parallel relationship between sub-tasks by combining the time dimension. In other words, the task decomposer can break down the task statement into two sub-task statements: "compile sales data" and "generate a monthly analysis report," where "compile sales data" is the preceding sub-task, and "generate a monthly analysis report" is the subsequent sub-task that depends on the output of the former. Both of these sub-task statements are represented in natural language form and each has clear and independent execution semantics.
[0106] As can be concluded from the above, through the semantic parsing and task unit division methods described above, this embodiment can effectively decompose complex task natural statements into clearly structured and independently executable sub-task statements, providing a reliable foundation for subsequent sub-task requirement analysis, agent matching, and multi-agent collaborative execution.
[0107] Optionally, in one embodiment, the process of invoking an agent to handle a subtask corresponding to the agent via a routing scheduler includes:
[0108] The operation information of the intelligent agent is input into the conflict detector to obtain the conflict detection result. The conflict detection result is the detection result of the conflict between resource consumption and data access between different intelligent agents during the execution process.
[0109] If the conflict detection result is no conflict, then the agent is invoked to process the subtask corresponding to the agent;
[0110] If the conflict detection result is a conflict, the agent's operation information is analyzed and processed through the large language model to obtain the conflict analysis result, and the conflict analysis result is returned to the conflict detector.
[0111] The conflict detector generates a solution based on the conflict analysis results, adjusts the parameters of the agent based on the solution, and calls the agent with adjusted parameters to process the sub-task corresponding to the agent.
[0112] Specifically, in this embodiment, the routing scheduler inputs the operation information of the agent corresponding to the subtask to be executed into the conflict detector. The operation information may include the data resources that the agent needs to access, the write location of the output result, the required computing resources, and the execution timing information. Based on the operation information, the conflict detector detects potential resource occupation conflicts and data access conflicts that may exist between different agents during execution, thereby obtaining the conflict detection result.
[0113] When the conflict detection result is "no conflict," it means that the agent will not encounter resource competition or data dependency conflicts with other agents during the execution of subtasks. In this case, the routing scheduler can directly call the agent to handle its corresponding subtask. When the conflict detection result is "conflict," it means that at least two agents have overlapping resource usage or data access dependencies during execution. For example, the output of one agent is used as input by another agent, but the former has not yet completed execution. In this case, the operational information of the agents can be analyzed using a large language model to obtain conflict analysis results. The conflict analysis results can include the cause of the conflict, the agents involved, and feasible solution strategy suggestions. Subsequently, the conflict detector can generate corresponding solutions based on the conflict analysis results. Solutions can include adjusting the execution order of agents, modifying the parameter configuration of agents, delaying the execution time of some agents, or reallocating related subtasks. After the routing scheduler adjusts the parameters of the agents based on the solutions, it calls the agents with adjusted parameters to handle the subtasks corresponding to those agents.
[0114] like Figure 4 As shown, in another embodiment, Agent1 and Agent2, i.e., Agent 1 and Agent 2, simultaneously request to execute operations. At this time, the conflict detector performs conflict detection on the operations requested by Agent1 and Agent2. If there is no conflict, execution is allowed. If there is a conflict, the type and impact of the conflict can be input into the large language model to analyze the type and impact of the conflict and generate a solution. The parameters of the operations of Agent1 and Agent2 are adjusted according to the solution. If the conflict requires human decision-making, the conflict value coordinator is reported to request human decision-making.
[0115] From the above, it can be concluded that this application can effectively avoid execution conflicts caused by resource competition and data dependence in scenarios where multiple agents execute in parallel, improve the stability and reliability of multi-agent collaborative work, and thus ensure the smooth completion of complex tasks.
[0116] The above describes a method for invoking an intelligent agent based on a large language model, as provided in the embodiments of this application. The following will describe the device for executing the above-described intelligent agent invoking based on a large language model.
[0117] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an intelligent agent invocation device based on a large language model, provided as an embodiment of this application. Figure 5 As shown, the intelligent agent invocation device based on a large language model includes:
[0118] The statement analysis module 301 is used to receive the task natural statement sent by the user and decompose the task natural statement into sub-task statements based on the task decomposer. The sub-task statements are natural statements.
[0119] The subtask generation module 302 is used to perform task requirement analysis on the subtask statement using a large language model to obtain the subtask requirements, and to perform task generation operation on the subtask requirements based on the task decomposer to obtain a list of subtasks.
[0120] The call plan generation module 303 is used to perform agent matching operation on the subtask list using a large language model, obtain the call plan of the agent corresponding to each subtask in the subtask list, and send the call plan to the routing scheduler.
[0121] Task processing module 304 is used to call the agent through the routing scheduler to process the subtask corresponding to the agent and obtain the processing result;
[0122] The result integration module 305 is used to send the processing results to the result aggregator for aggregation processing, obtain the aggregation result, and output the aggregation result.
[0123] In one embodiment, the subtask generation module 302 is specifically used to: perform a task type determination operation on the subtask requirements, which is used to determine the task type of the subtask required to complete the subtask requirements, wherein the required subtask is at least one;
[0124] Based on the task type, generate subtasks to complete the subtask requirements, and build at least one subtask list based on the subtasks.
[0125] In one embodiment, calling the plan generation module 303 is specifically used to: determine whether the subtask has dependent tasks;
[0126] If a subtask has no dependent tasks, then the subtask is determined to be an executable task;
[0127] If a subtask has dependent tasks, then perform a status check operation on the dependent tasks of the subtask and obtain the status check result.
[0128] If the status check result indicates that the dependent task has been completed, then the subtask is determined to be an executable task.
[0129] If the status check result is that the dependent task has not been completed, the subtask is determined to be an unexecutable task.
[0130] The agents in the agent library are evaluated by a large language model to obtain agents that match the subtasks that are determined to be executable tasks, and a call plan is generated. The agent library includes multiple pre-packaged agents.
[0131] In one embodiment, the task processing module 304 is specifically used to: search for an agent in the agent library that can realize the intent of the subtask based on the intent of the subtask and the function of the agent;
[0132] If only one agent is found, then the agent is identified as the one that matches the subtask.
[0133] If multiple agents are found, their historical success rates and load parameters are obtained, and the historical success rates and load parameters of each agent are weighted and calculated to obtain the comprehensive score of each agent.
[0134] Agents that match the sub-tasks are selected based on their overall scores.
[0135] In one embodiment, the statement analysis module 301 is specifically used to: perform semantic parsing on the natural statements of the task to obtain recognition results, which are the task intent, time dimension and task object;
[0136] Based on the recognition results, the task natural statements are divided into task units to split the task natural statements into multiple sub-task statements with independent execution semantics.
[0137] The task processing module 304 is specifically used to: input the operation information of the intelligent agent into the conflict detector, obtain the conflict detection result, which is the detection result of the conflict between resource occupation and data access between different intelligent agents during the execution process;
[0138] If the conflict detection result is no conflict, then the agent is invoked to process the subtask corresponding to the agent;
[0139] If the conflict detection result is a conflict, the agent's operation information is analyzed and processed through the large language model to obtain the conflict analysis result, and the conflict analysis result is returned to the conflict detector.
[0140] The conflict detector generates a solution based on the conflict analysis results, adjusts the parameters of the agent based on the solution, and calls the agent with adjusted parameters to process the sub-task corresponding to the agent.
[0141] This application also provides an electronic device in its embodiments. (See reference...) Figure 6The diagram illustrates a structural schematic of an electronic device suitable for implementing the agent invocation method based on a large language model as described in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0142] like Figure 6 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0143] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0144] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the intelligent agent invocation methods based on a large language model provided in this application.
[0145] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the intelligent agent invocation methods based on a large language model provided in this application.
[0146] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0147] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0148] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0149] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A method for invoking intelligent agents based on a large language model, characterized in that, include: Receive a task statement sent by a user, and decompose the task statement into sub-task statements based on a task decomposer, wherein the sub-task statements are natural statements; The task requirement analysis of the subtask statement is performed using a large language model to obtain the subtask requirements, and the task generation operation is performed on the subtask requirements based on the task decomposer to obtain a subtask list. The large language model is used to perform agent matching on the subtask list to obtain the calling plan of the agent corresponding to each subtask in the subtask list, and the calling plan is sent to the routing scheduler. The routing scheduler invokes the agent to process the subtask corresponding to the agent, and obtains the processing result. The processing result is sent to the result aggregator for aggregation processing to obtain the aggregation result, and the aggregation result is output.
2. The agent invocation method based on a large language model according to claim 1, characterized in that, The step of generating a subtask list based on the subtask requirements using the task decomposer includes: A task type determination operation is performed on the sub-task requirement to determine the task type of the sub-task required to complete the sub-task requirement, wherein the required sub-task is at least one; Based on the task type, generate subtasks to complete the subtask requirements, and construct at least one subtask list based on the subtasks.
3. The agent invocation method based on a large language model according to claim 1, characterized in that, The step of performing agent matching on the subtask list to obtain the invocation plan for the agent corresponding to each subtask in the subtask list includes: Determine if the subtask has any dependent tasks; If the subtask has no dependent tasks, then the subtask is determined to be an executable task; If the subtask has dependent tasks, then a status check operation is performed on the dependent tasks of the subtask to obtain the status check result. If the status check result indicates that the dependent task has been completed, then the subtask is determined to be an executable task. If the status check result is that the dependent task has not been completed, then the subtask is determined to be an unexecutable task; The agents in the agent library are evaluated using the large language model to obtain agents that match the subtasks that are determined to be executable tasks, and a call plan is generated. The agent library includes multiple pre-packaged agents.
4. The agent invocation method based on a large language model according to claim 3, characterized in that, The step of evaluating agents in the agent library using the large language model to obtain agents that match the sub-tasks determined to be executable includes: Based on the intent of the subtask and the function of the agent, search the agent library for an agent that can realize the intent of the subtask. If only one agent is found, then the agent is identified as the agent that matches the subtask. If multiple agents are found, their historical success rates and load parameters are obtained, and the historical success rates and load parameters of the multiple agents are weighted and calculated to obtain the comprehensive score of each of the multiple agents found. Based on the comprehensive score, an agent that matches the sub-task is selected.
5. The agent invocation method based on a large language model according to claim 1, characterized in that, The task decomposer decomposes the natural task statement into subtask statements, including: The task's natural language statement is subjected to semantic parsing to obtain recognition results, which include task intent, time dimension, and task object. Based on the recognition results, the task natural statement is divided into task units to split the task natural statement into multiple sub-task statements with independent execution semantics.
6. The agent invocation method based on a large language model according to claim 1, characterized in that, The step of invoking the agent through the routing scheduler to process the subtask corresponding to the agent includes: The operation information of the intelligent agent is input into the conflict detector to obtain the conflict detection result, which is the detection result of the conflict between resource occupation and data access between different intelligent agents during the execution process; If the conflict detection result is no conflict, then the agent is invoked to process the subtask corresponding to the agent; If the conflict detection result is a conflict, the operation information of the agent is analyzed and operated through the large language model to obtain the conflict analysis result, and the conflict analysis result is returned to the conflict detector. A solution is generated based on the conflict analysis results using a conflict detector. The agent's parameters are then adjusted based on the solution, and the agent with adjusted parameters is invoked to process the sub-task corresponding to the agent.
7. A smart agent invocation device based on a large language model, characterized in that, include: The statement analysis module is used to receive the task natural statement sent by the user, and decompose the task natural statement into sub-task statements based on the task decomposer, wherein the sub-task statements are natural statements. The subtask generation module is used to perform task requirement analysis on the subtask statement using a large language model to obtain subtask requirements, and to perform task generation operation on the subtask requirements based on the task decomposer to obtain a subtask list. The call plan generation module is used to perform agent matching operation on the subtask list using a large language model to obtain the call plan of the agent corresponding to each subtask in the subtask list, and send the call plan to the routing scheduler. The task processing module is used to call the agent through the routing scheduler to process the subtask corresponding to the agent and obtain the processing result; The result integration module is used to send the processing results to the result aggregator for aggregation processing, obtain the aggregation result, and output the aggregation result.
8. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the agent invocation method based on a large language model as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the agent invocation method based on a large language model as described in any one of claims 1 to 6.
10. A computer storage medium, characterized in that, The storage medium carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the agent invocation method based on a large language model as described in any one of claims 1 to 6.