Search

CN-121351971-B - Knowledge optimization method for intelligent agent tool call based on experience path map evolution

CN121351971BCN 121351971 BCN121351971 BCN 121351971BCN-121351971-B

Abstract

The invention provides an intelligent agent tool calling knowledge optimization method based on experience path graph evolution, which comprises the steps of recording an intelligent agent tool calling sequence, input and output parameters and an execution result when an intelligent agent successfully completes a task for the first time, generating a structured calling log, converting the calling log into a standardized calling path knowledge unit, carrying out structured representation and semantic representation on the calling path knowledge unit, storing the structured representation in a graph database, and storing the semantic representation in a vector database, wherein task intention, tool entity and calling path are used as heterogeneous nodes, constructing an experience path knowledge graph, and the experience path knowledge graph is used for recording multidimensional relations among the task, the path and the tool, attaching execution performance attributes and feedback attributes to path nodes in the graph, and completing intelligent agent tool calling knowledge optimization. The purpose of improving tool calling efficiency and robustness of the intelligent agent in a multi-task environment is achieved.

Inventors

  • XU MINGMING
  • YANG FAN
  • WANG YAJIE
  • WU YUJIA
  • JIAO JIAN
  • DENG XULIANG
  • CAO ZHANQIANG
  • WANG YING
  • YIN JINLEI
  • ZUO FEIFEI

Assignees

  • 北京大学口腔医学院
  • 北京基骨智能科技有限公司

Dates

Publication Date
20260505
Application Date
20251217

Claims (9)

  1. 1. An intelligent agent tool calling knowledge optimization method based on experience path graph evolution, which is characterized by comprising the following steps: when an intelligent agent successfully completes a task for the first time, automatically recording an intelligent agent tool calling sequence, input and output parameters and an execution result, generating a structured calling log, and converting the calling log into a standardized calling path knowledge unit; Carrying out structural characterization and semantic characterization on the calling path knowledge unit simultaneously, storing the structural characterization in a graph database, storing the semantic characterization in a vector database to form bimodal knowledge storage, wherein the bimodal characterization and storage are responsible for carrying out semantic and structural bimodal characterization on the calling path knowledge unit and storing the bimodal characterization into a heterogeneous database to form a retrievable knowledge base; Based on the graph database and the vector database, taking task intention, tool entity and calling path as heterogeneous nodes, constructing an experience path knowledge graph, wherein the experience path knowledge graph is used for recording multidimensional relations among tasks, paths and tools, and adding execution performance attributes and feedback attributes for the path nodes in the graph, so as to complete intelligent agent tool calling knowledge optimization; The automatic recording agent tool calling sequence, input and output parameters and execution result, generating a structured calling log, and converting the calling log into a standardized calling path knowledge unit, comprising: acquiring calling process data from a front section and a rear section called by a tool in a section-oriented programming mode through an experience recording agent; after the task is marked as successfully completed, the collected calling process data is aggregated and serialized into execution tracks; and carrying out variable abstraction processing on the execution trace through a path generalization service, identifying and generalizing key entities in the user request, and generating a standardized call path knowledge unit containing tool sequences, generalization parameters and data mode information.
  2. 2. The method for optimizing knowledge by using an agent tool based on evolution of experience path spectrum according to claim 1, wherein the step of constructing experience path knowledge spectrum by using task intention, tool entity and calling path as heterogeneous nodes based on graph database and vector database further comprises: when the intelligent agent receives a new task, a calling path knowledge unit is recalled from a vector database through semantic similarity, then structure screening and performance evaluation are carried out in an experience path knowledge graph, and an optimal candidate path is selected for parameter mapping and migration multiplexing.
  3. 3. The method for optimizing knowledge called by an agent tool based on experience path graph evolution according to claim 2, wherein when the agent receives a new task, recall the called path knowledge unit from the vector database through semantic similarity, and then perform structure screening and performance evaluation in the experience path knowledge graph, and select an optimal candidate path for parameter mapping and migration multiplexing, comprising: Performing query expansion and data mode pre-judgment on the new task request, generating a query semantic vector and a mode vector, performing double-channel search in a vector database, and merging the merging results through reciprocal ranking to obtain a candidate path set; And for each path in the candidate path set, checking tool state and checking compatibility of the data stream based on a token ring graph traversal algorithm, and calculating a score by combining path history performance to determine an optimal path.
  4. 4. The method for optimizing knowledge called by an agent tool based on experience path graph evolution according to claim 3, wherein when the agent receives a new task, recall the called path knowledge unit from the vector database through semantic similarity, and then perform structure screening and performance evaluation in the experience path knowledge graph, and select an optimal candidate path for parameter mapping and migration multiplexing, further comprising: analyzing the new task semantics, and identifying task intents, key entities and input variables; selecting an optimal candidate path as a template, and establishing a mapping rule between the new task parameter and the template path parameter; and generating a call path adapting to the new task according to the mapping rule, and checking the logical integrity and the data dependence consistency.
  5. 5. The method for optimizing knowledge by using an agent tool based on evolution of experience path spectrum according to claim 1, wherein the step of constructing experience path knowledge spectrum by using task intention, tool entity and calling path as heterogeneous nodes based on graph database and vector database further comprises: continuously collecting task execution feedback data, and adjusting the weight of path nodes in the experience path knowledge graph based on the feedback data and a time attenuation model to realize self-evolution and path elimination of the experience path knowledge graph; When the tool in the calling path is detected to be invalid, the substitution tool or path segment with similar semantics is searched through the experience path knowledge graph reasoning, the dynamic restoration of the calling chain is completed, and a new calling path knowledge unit is generated based on the restoration result.
  6. 6. The intelligent agent tool based on experience path graph evolution calls a knowledge optimization method according to claim 5, wherein the dynamic repair of the call chain comprises: When the path verification fails, acquiring the upstream and downstream tools of the failure path and data mode information; performing shortest path search in the knowledge graph to find an alternative path segment which consists of active tools and is limited in graph bridging length; using the found substitute fragment to rewrite the original call chain to generate a temporary repair path; if the repair path is successfully executed and positive feedback is obtained, a new call path knowledge unit is generated.
  7. 7. The method for optimizing knowledge by an agent tool based on experience path graph evolution according to claim 1, wherein the standardized call path knowledge unit generation comprises: the path generalization service collects an original tracking log generated by recording the successful task execution process of the intelligent agent through a subscription message queue; Acquiring a corresponding original user request text based on a session identifier in an original tracking log; analyzing the user request text by using a named entity recognition model, and extracting key entities and key entity values; traversing the input parameters of each tool calling step in the original tracking log, and matching the parameter values with the key entities, wherein if the matching is successful, the parameters are generalized into a variable placeholder; Acquiring output data portrait information asynchronously extracted in a tool calling process, and filling the output data portrait information into an output data mode field; Generating a hash value of the normalized path signature according to the tool call sequence and the parameter key after the input parameter generalization; A normalized call path knowledge unit is generated based on the input parameter generalized parameters, the output data pattern field, and the hash value.
  8. 8. The intelligent agent tool based on experience path graph evolution according to claim 1, wherein the intelligent agent tool invokes a knowledge optimization method, The semantic characterization is realized by constructing a rich semantic description document containing task intention, a trigger template and tool description information, and generating a corresponding semantic vector by using a sentence embedding model; the semantic representation is used for describing inter-tool dependency and data flow relationships by mapping input and output data patterns in a call path knowledge unit to a predefined global data pattern vocabulary and generating multi-hot coded interface pattern vectors.
  9. 9. The method for optimizing knowledge by an agent tool based on evolution of experience path graph according to claim 1, wherein the creating an experience path knowledge graph based on a graph database and a vector database by using task intention, tool entity and call path as heterogeneous nodes comprises: the paths under the same task intention are clustered regularly according to the similarity of the tool sequences, and the similar paths are fused; the path nodes with the weight lower than the threshold value or unused for a long time and the association relation thereof are cleaned regularly.

Description

Knowledge optimization method for intelligent agent tool call based on experience path map evolution Technical Field The invention belongs to the technical field of artificial intelligence, and particularly relates to an intelligent agent tool calling knowledge optimization method based on experience path graph evolution. Background Large Language Model (LLM) driven agents have shown great potential by calling external tool APIs to accomplish complex tasks in the real world. However, the prior art still has the following prominent problems in terms of tool call experience management and multiplexing of agents: 1. Experience deficiency and redundancy exploration problems the current mainstream agent frameworks (such as REAct, chain-of-Thought, etc.) rely on multiple "real-time reasoning and try" strategies, lacking in the structured storage and migration mechanisms for historic successful call paths. When the intelligent agent faces similar tasks again, the optimal tool combination still needs to be repeatedly explored, so that the calling efficiency is low and the reasoning resource is wasted. For example, when there are 9 medical image analysis tools with similar functions, the agent may need to try one by one, resulting in up to 9 calls, thus causing serious delays and resource waste. Such approaches lack a memory and multiplexing mechanism for historic successful experience and thus often repeat the redundancy exploration process in the face of similar tasks. 2. Call failure in dynamic environments, external tools often fail due to updates, substitutions or offline, while existing systems lack experience-level "self-healing" or substitution recommendation capabilities, resulting in call chain breakage and performance degradation. Due to the lack of "self-healing" capability, the agent cannot actively seek an alternative, significantly compromising the robustness of the system. 3. The system lacks a long-term learning and path evolution mechanism, and most systems realize tool calling only through static templates or manual rules and cannot combine user feedback, self-adaptive weights and path evolution models to realize continuous optimization and elimination updating of experience knowledge. Disclosure of Invention Aiming at the problems in the prior art, the invention provides an intelligent agent tool calling knowledge optimization method based on experience path graph evolution. The embodiment of the disclosure provides an intelligent agent tool calling knowledge optimization method based on experience path graph evolution, which comprises the following steps: when an intelligent agent successfully completes a task for the first time, automatically recording an intelligent agent tool calling sequence, input and output parameters and an execution result, generating a structured calling log, and converting the calling log into a standardized calling path knowledge unit; Carrying out structural characterization and semantic characterization on the call path knowledge unit simultaneously, storing the structural characterization in a graph database and storing the semantic characterization in a vector database; Based on the graph database and the vector database, task intention, tool entity and calling path are taken as heterogeneous nodes, an experience path knowledge graph is constructed, the experience path knowledge graph is used for recording multidimensional relations among tasks, paths and tools, and executing performance attributes and feedback attributes are added to path nodes in the graph, so that intelligent agent tool calling knowledge optimization is completed. Optionally, the step of constructing the empirical path knowledge graph based on the graph database and the vector database by taking the task intention, the tool entity and the call path as heterogeneous nodes further comprises: when the intelligent agent receives a new task, a calling path knowledge unit is recalled from a vector database through semantic similarity, then structure screening and performance evaluation are carried out in an experience path knowledge graph, and an optimal candidate path is selected for parameter mapping and migration multiplexing. Optionally, when the agent receives a new task, recall the call path knowledge unit from the vector database through semantic similarity, and then perform structure screening and performance evaluation in the experience path knowledge graph, and select an optimal candidate path to perform parameter mapping and migration multiplexing, including: Performing query expansion and data mode pre-judgment on the new task request, generating a query semantic vector and a mode vector, performing double-channel search in a vector database, and merging the merging results through reciprocal ranking to obtain a candidate path set; And for each path in the candidate path set, checking tool state and checking compatibility of the data stream based on a token ring graph traversal algorithm,