Search

CN-121996374-A - Agent calling method and related device based on large language model

CN121996374ACN 121996374 ACN121996374 ACN 121996374ACN-121996374-A

Abstract

The application discloses an agent calling method and a related device based on a large language model, and relates to the field of artificial intelligence, wherein the method comprises the steps of receiving a task natural sentence sent by a user, decomposing the task natural sentence into subtask sentences based on a task decomposer, analyzing the task requirements of the subtask sentences by using the large language model to obtain subtask requirements, and performing task generation operation on the subtask requirements based on the task decomposer to obtain a subtask list; the method comprises the steps of carrying out agent matching operation on a subtask list by utilizing a large language model, obtaining an agent calling plan corresponding to each subtask in the subtask list, sending the calling plan to a routing scheduler, calling the agent to process the subtask corresponding to the agent through the routing scheduler to obtain a processing result, sending the processing result to a result aggregator to carry out aggregation processing to obtain an aggregation result, and outputting the aggregation result. The application realizes flexible call of different agents based on a large language model.

Inventors

  • LIU PENG
  • SUN DANFENG
  • CUI XIUYUAN

Assignees

  • 青岛巨商汇网络科技有限公司

Dates

Publication Date
20260508
Application Date
20251231

Claims (10)

  1. 1. An agent calling method based on a large language model, comprising the steps of: receiving a task natural sentence sent by a user, and decomposing the task natural sentence into a subtask sentence based on a task decomposer, wherein the subtask sentence is a natural sentence; performing task demand analysis on the subtask sentences by using a large language model to obtain subtask demands, and performing task generation operation on the subtask demands based on the task decomposer to obtain a subtask list; performing agent matching operation on the subtask list by using a large language model to obtain an agent calling plan corresponding to each subtask in the subtask list, and sending the calling plan to a routing scheduler; invoking the intelligent agent to process subtasks corresponding to the intelligent agent through the routing dispatcher to obtain a processing result; And sending the processing result to a result aggregator for aggregation processing to obtain an aggregation result, and outputting the aggregation result.
  2. 2. The large language model based agent calling method of claim 1, wherein the task generating operation is performed on the subtask requirements based on the task decomposer to obtain a subtask list, and the method comprises the following steps: performing task type determining operation on the subtask requirements, wherein the task type determining operation is used for determining the task types of the subtasks required for completing the subtask requirements, and at least one subtask is required; Based on the task type, generating a subtask for completing the subtask requirement, and constructing at least one subtask list based on the subtask.
  3. 3. The method for invoking agents based on a large language model according to claim 1, wherein said performing an agent matching operation on said subtask list to obtain an agent invocation plan corresponding to each subtask in the subtask list comprises: Judging whether the subtasks have dependent tasks or not; if the subtask has no dependent task, judging the subtask to be an executable task; if the subtask has a dependent task, performing a state checking operation on the dependent task of the subtask to obtain a state checking result; If the state check result is that the dependent task is completed, judging that the subtask is an executable task; If the state check result is that the dependent task is not completed, judging that the subtask is an unexecutable task; and evaluating the agents in the agent library through the large language model to obtain agents matched with the subtasks judged to be executable tasks, and generating a calling plan, wherein the agent library comprises a plurality of pre-packaged agents.
  4. 4. The large language model based agent calling method as set forth in claim 3, wherein the evaluating agents in an agent library by the large language model to obtain agents matching the subtasks determined to be executable tasks includes: Searching an agent capable of realizing the intention of the subtask in an agent library based on the intention of the subtask and the function of the agent; if only one agent is found, determining the agent as the agent matched with the subtask; If a plurality of agents are found, acquiring the historical success rate and the load parameters of the plurality of agents, and respectively carrying out weighted calculation on the historical success rate and the load parameters of the plurality of agents to obtain the respective comprehensive scores of the plurality of found agents; And selecting an agent matched with the subtask based on the composite score.
  5. 5. The large language model based agent invocation method of claim 1, wherein the task-based decomposer decomposes the task natural sentence into subtask sentences, comprising: carrying out semantic analysis operation on the task natural sentences to obtain recognition results, wherein the recognition results are task intention, time dimension and task objects; and dividing task units of the task natural sentences based on the identification result so as to split the task natural sentences into a plurality of subtask sentences with independent execution semantics.
  6. 6. The large language model based agent invocation method of claim 1, wherein said invoking, by said routing scheduler, said agent to process a subtask corresponding to said agent comprises: Inputting the operation information of the intelligent agents into a conflict detector to obtain a conflict detection result, wherein the conflict detection result is a detection result of conflict between resource occupation and data access of different intelligent agents in the execution process; If the conflict detection result is that no conflict exists, calling the intelligent agent to process a subtask corresponding to the intelligent agent; If the conflict detection result is conflict, analyzing the operation information of the intelligent agent through a large language model to obtain a conflict analysis result, and returning the conflict analysis result to a conflict detector; And generating a solution based on the conflict analysis result through a conflict detector, carrying out parameter adjustment on the intelligent agent based on the solution, and calling the intelligent agent after parameter adjustment to process subtasks corresponding to the intelligent agent.
  7. 7. An agent calling device based on a large language model, comprising: The sentence analysis module is used for receiving a task natural sentence sent by a user, decomposing the task natural sentence into sub-task sentences based on a task decomposer, wherein the sub-task sentences are natural sentences; The subtask generation module is used for analyzing the task requirements of the subtask sentences by using a large language model to obtain subtask requirements, and performing task generation operation on the subtask requirements based on the task decomposer to obtain a subtask list; The call plan generating module is used for carrying out agent matching operation on the subtask list by utilizing a large language model, obtaining a call plan of an agent corresponding to each subtask in the subtask list, and sending the call plan to the routing dispatcher; The task processing module is used for calling the intelligent agent to process subtasks corresponding to the intelligent agent through the routing scheduler to obtain a processing result; and the result integration module is used for sending the processing result to a result aggregator for aggregation processing to obtain an aggregation result and outputting the aggregation result.
  8. 8. A computer program product comprising computer readable instructions which, when run on an electronic device, cause the electronic device to implement the large language model based agent invocation method of any of claims 1 to 6.
  9. 9. An electronic device comprising at least one processor and a memory coupled to the processor, wherein: the memory is used for storing a computer program; the processor is configured to execute the computer program to enable the electronic device to implement the large language model-based agent invocation method of any one of claims 1 to 6.
  10. 10. A computer storage medium carrying one or more computer programs which, when executed by an electronic device, enable the electronic device to implement the large language model based agent invocation method of any one of claims 1 to 6.

Description

Agent calling method and related device based on large language model Technical Field The application relates to the technical field of artificial intelligence, in particular to an agent calling method and a related device based on a large language model. Background An agent is an entity that is able to perceive the environment in which it is located, analyze based on the perceived information, and autonomously make decisions so as to perform corresponding actions to achieve a predetermined goal, and may exist in the form of a software program or may be packaged as a system module having a specific function. The intelligent agent is characterized by having a certain degree of autonomy, and can complete task processing and decision execution under the condition of less manual intervention. Along with the development of artificial intelligence technology, especially the improvement of natural language processing and reasoning capability, the application of the intelligent body in the aspects of task planning, information processing, automatic decision making and the like is increasingly wide. However, with the increasing complexity of business scenarios, single agents gradually exhibit limitations in terms of capability boundaries, task parallelism, and complex flow processing, which makes it difficult to meet multi-objective, multi-step, and dynamically changing business requirements. Therefore, in the prior art, a multi-agent cooperative work mode is gradually introduced, and complex tasks are completed through the multi-agent division cooperation. However, the existing multi-agent calling scheme generally relies on preset calling logic or fixed collaborative processes, and when the task type change or the calling sequence needs to be flexibly changed, the problem of low calling efficiency still exists. Therefore, there is a need for a multi-agent call method based on LLM. Disclosure of Invention In view of the above problems, the present application provides an agent calling method and related device based on a large language model, so as to achieve the purpose of efficient calling of an agent. The specific scheme is as follows: The first aspect of the present application provides an agent calling method based on a large language model, including: receiving a task natural sentence sent by a user, and decomposing the task natural sentence into a subtask sentence based on a task decomposer, wherein the subtask sentence is a natural sentence; Task demand analysis is carried out on subtask sentences by using a large language model to obtain subtask demands, and task generation operation is carried out on the subtask demands based on a task decomposer to obtain a subtask list; Performing agent matching operation on the subtask list by using the large language model to obtain an agent calling plan corresponding to each subtask in the subtask list, and sending the calling plan to the routing scheduler; calling an agent to process subtasks corresponding to the agent through a routing scheduler to obtain a processing result; and sending the processing result to a result aggregator for aggregation processing to obtain an aggregation result, and outputting the aggregation result. Optionally, performing task generation operation on the subtask requirement based on the task decomposer to obtain a subtask list, including: Performing task type determining operation on the subtask demands, wherein the task type determining operation is used for determining the task types of the subtasks required for completing the subtask demands, and at least one subtask is required; based on the task type, generating a subtask for completing the subtask requirements, and constructing at least one subtask list based on the subtask. Optionally, performing an agent matching operation on the subtask list to obtain an agent calling plan corresponding to each subtask in the subtask list, including: judging whether the subtasks have dependent tasks or not; If the subtask has no dependent task, judging the subtask as an executable task; if the subtask has a dependent task, performing state checking operation on the dependent task of the subtask to obtain a state checking result; if the state check result is that the dependent task is completed, judging the subtask as an executable task; if the state check result is that the dependent task is not completed, judging that the subtask is an unexecutable task; And evaluating the agents in the agent library through the large language model to obtain agents matched with the subtasks judged to be executable tasks, and generating a calling plan, wherein the agent library comprises a plurality of pre-packaged agents. Optionally, evaluating the agent in the agent library through the large language model to obtain an agent matching the subtask determined to be an executable task, including: Searching for an agent capable of realizing the intention of the subtask in an agent library based on the intention o