Agent tool invocation method, apparatus, device, and medium

By constructing a feature set for intelligent agent tools and introducing request attribute extraction and feature search mechanisms, the problem of poor interoperability between intelligent agent tools is solved, enabling efficient and accurate tool invocation, and improving system response efficiency and user experience.

CN122113985APending Publication Date: 2026-05-29SHENZHEN SDMC TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN SDMC TECH CO LTD
Filing Date
2026-02-10
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Poor interoperability between different intelligent agent tools leads to a large and complex toolset, affecting the collaboration and resource sharing of intelligent agents. In particular, tool selection errors occur frequently in enterprise applications, resulting in interruption of query response links and damage to service continuity.

Method used

By introducing request attribute extraction and hierarchical or global feature search mechanisms based on business type, a feature set for intelligent agent tools is constructed to achieve accurate and efficient matching of target tools. This includes semantic extraction, keyword clustering, search tree structure construction, and compatibility testing to ensure the accuracy and efficiency of the tool invocation process.

Benefits of technology

It significantly reduces the difficulty of intelligent agent tool invocation, improves tool invocation accuracy and system response efficiency, optimizes resource utilization, improves user experience, and solves the problems of tool selection complexity and low resource allocation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122113985A_ABST
    Figure CN122113985A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and discloses an agent tool calling method and device, equipment and a medium. The method comprises the following steps: obtaining a user query request for a target agent; performing request attribute extraction on the user query request to obtain a request attribute feature; based on the request attribute feature, performing hierarchical feature search based on a business type or global feature search when the business type cannot be matched on a preset agent tool feature set, so as to determine a target tool matched with the request attribute feature; and calling the target tool to the target agent to respond to the user query request. The embodiment can reduce the difficulty of agent tool calling and improve the accuracy of agent tool calling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device and medium for invoking intelligent agents. Background Technology

[0002] Behind the booming development of large-scale model technology, a series of problems have gradually emerged. The intelligent agents developed by different research teams and companies have significant differences in framework selection, tool design, and data pattern processing, resulting in extremely poor interoperability between models and making it difficult to achieve effective collaboration and resource sharing.

[0003] To address these challenges, Anthropic proposed a standardized protocol, the Model Context Protocol (MCP), which aims to provide a unified technical framework and specifications for agent development, promote the standardization and collaborative development of large model technologies, and propel artificial intelligence technology to new heights. However, as the needs of agents become increasingly complex, the number of tools for agents to access MCP is also increasing, leading to a growing toolset for agents and further exacerbating the complexity of agent cue word expansion and tool selection. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, device, and medium for invoking intelligent agent tools, aiming to reduce the difficulty of invoking intelligent agent tools and improve the accuracy of invoking intelligent agent tools.

[0005] This application provides a method for invoking intelligent agent tools, including: Obtain user query requests for the target agent; The user query request is subjected to request attribute extraction to obtain request attribute features; Based on the requested attribute features, a hierarchical feature search based on business type or a global feature search when the business type fails to match is performed on the preset intelligent agent tool feature set to determine the target tool that matches the requested attribute features. The target tool is invoked to the target intelligent agent in response to the user query request.

[0006] In some embodiments, before extracting the request type attribute from the user query request, the method further includes: Semantic extraction is performed on multiple intelligent agent tools to obtain tool semantic features; Keyword extraction is performed on the semantic features of the tool to obtain the tool keyword features; Cluster analysis is performed on the tool keyword features to determine the tool business features to which each tool keyword feature belongs; Using the tool's business features, keyword features, and semantic features as nodes, a search tree structure is constructed to obtain the agent tool feature set.

[0007] In some embodiments, the extraction of request attributes from the user query request includes: Keyword extraction is performed on the user query request to obtain the request keyword features; The request keyword features are used to identify the business type, thus obtaining the request business features; The request attribute features are obtained by concatenating the request keyword features and the request business features.

[0008] In some embodiments, the step of performing a hierarchical feature search based on business type or a global feature search when a business type cannot be matched on a preset intelligent agent tool feature set based on the request attribute features includes: Search for several candidate tool business features that belong to the intelligent agent tool feature set and match the request attribute features; When the candidate tool business features are found, a hierarchical feature search is performed on the feature nodes belonging to the candidate tool business features, and the searched tool semantic features are used as candidate tool semantic features. If the candidate tool business features are not found, a global search is performed on the tool semantic features in the intelligent agent tool feature set to obtain several candidate tool semantic features. Determine the candidate tools corresponding to the semantic features of the candidate tools; Compatibility tests are performed on the candidate tools, and the target tool is determined based on the test results.

[0009] In some embodiments, the hierarchical feature search of feature nodes belonging to the candidate tool business features includes: Search for several candidate tool keyword features that belong to the candidate tool business features and match the request attribute features. When the candidate tool keyword features are found, the tool semantic features corresponding to the candidate tool keyword features are used as candidate tool semantic features.

[0010] In some embodiments, performing compatibility testing on the candidate tools and determining the target tool based on the test results includes: Generate a test query request; The candidate tool is invoked to respond to the test query request, and the test results are obtained. The target tool is determined based on the degree of compatibility characterized by the test results.

[0011] In some embodiments, the intelligent agent tool invocation method further includes: Obtain the response result of the target intelligent agent in response to the user query request; Determine whether the compatibility level represented by the response result meets the preset response compatibility conditions; If it does not match, return to the step of performing hierarchical feature search based on business type on the preset intelligent agent tool feature set or global feature search when the business type fails to match.

[0012] This application also provides an intelligent agent tool invocation device, including: The first module is used to obtain user query requests for the target intelligent agent; The second module is used to extract request attributes from the user query request to obtain request attribute features; The third module is used to perform hierarchical feature search based on business type or global feature search when the business type fails to match based on the requested attribute features, in order to determine the target tool that matches the requested attribute features. The fourth module is used to invoke the target tool to the target intelligent agent in response to the user query request.

[0013] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described intelligent agent tool invocation method.

[0014] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described intelligent agent tool invocation method.

[0015] The beneficial effects of this application are as follows: By introducing request attribute extraction and hierarchical or global feature search mechanisms based on business type, accurate and efficient matching of target tools is achieved, effectively solving the problems of complexity in the tool selection process and low resource allocation efficiency. It has the advantages of simplifying the tool selection process, improving system response efficiency and resource utilization efficiency, and improving user experience. Attached Figure Description

[0016] Figure 1 This is a diagram illustrating the application environment of the intelligent agent tool invocation method provided in the embodiments of this application.

[0017] Figure 2 This is a flowchart of the intelligent agent tool invocation method provided in the embodiments of this application.

[0018] Figure 3This is a flowchart of a method provided in this application embodiment for extracting request type attributes from a user query request.

[0019] Figure 4 This is a flowchart of a method for extracting request attributes from a user query request, provided in an embodiment of this application.

[0020] Figure 5 This is a flowchart of a method for performing hierarchical or global feature search on the feature set of an intelligent agent tool, as provided in an embodiment of this application.

[0021] Figure 6 This is a schematic diagram of the intelligent agent tool invocation device provided in the embodiments of this application.

[0022] Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0024] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and drawings are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0026] The intelligent agent tool invocation method provided in this application can be executed by a computer device, which can be a terminal device or a server. The terminal device includes, but is not limited to, mobile phones, computers, smart home appliances, vehicle terminals, and aircraft. The server can be a standalone physical server, a server cluster consisting of multiple physical servers, a distributed system, or a cloud server. Furthermore, the information, data, and signals involved in this application's embodiments are all authorized by the relevant parties or have received full authorization from all parties, and the collection, use, and processing of related data comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0027] In agent systems based on model context protocols, the complexity of the tool selection decision-making process increases significantly with the continuous expansion of the number of accessed tools. Simultaneously, user query suggestions exhibit unnecessary expansion due to the need to cover a vast toolset. This problem stems from the unstructured matching mechanism between the original query and tool features, leading to redundant computational burdens when processing high-dimensional tool spaces. This, in turn, affects the agent's real-time response efficiency and context management capabilities. The toolset size is positively correlated with query parsing complexity. Furthermore, context expansion caused by redundant suggestions directly restricts the effective allocation of system resources. For example, in enterprise customer service agent applications, users submit complex query requests involving financial product consultation, insurance claims, and compliance reviews. The pre-set agent tool feature set contains hundreds of specialized tools for different business sub-domains. Due to the large toolset size, the agent is required to parse lengthy natural language suggestions containing multi-level business logic to identify applicable tools. This forcibly prolongs the tool matching process and increases the probability of mismatched candidate tools. For instance, tool selection errors are frequently triggered in scenarios with overlapping business types, ultimately causing query response chain interruptions and service continuity damage.

[0028] If the above problems are not addressed, the scalability of intelligent agent systems will be fundamentally limited, the continuous growth of toolsets will exacerbate the burden of context management, making it difficult for standardized frameworks based on MCP to maintain stable operation in multiple business scenarios. The resulting risk of tool selection failure will gradually erode the foundation of system interoperability, thereby hindering the large-scale deployment of artificial intelligence technology in enterprise applications.

[0029] Based on this, embodiments of this application provide a method, apparatus, device, and medium for invoking intelligent agent tools. By introducing request attribute extraction and hierarchical feature search or global feature search mechanism based on business type, accurate and efficient matching of target tools is achieved, thereby reducing the difficulty of invoking intelligent agent tools and improving the accuracy of intelligent agent tool invoking.

[0030] Figure 1 This diagram illustrates the application environment for the intelligent agent tool invocation method provided in this embodiment. (See attached diagram.) Figure 1This method is applied to an intelligent agent tool invocation system. The system includes a target intelligent agent 101, a tool management terminal 102, and a storage terminal 103. The target intelligent agent 101 and the tool management terminal 102 are connected via a network. The tool management terminal 102 can be a desktop terminal or a mobile terminal; the mobile terminal can be at least one of a mobile phone, tablet, or laptop. The storage terminal 103 can be implemented using a standalone server or a server cluster consisting of multiple servers. The target intelligent agent 101 sends received user query requests to the tool management terminal 102 and responds to the user query requests. The storage terminal 103 is used to pre-store the intelligent agent tool feature set. The tool management terminal 102 obtains user query requests for the target intelligent agent 101, extracts request attributes from the user query requests to obtain request attribute features, and, based on the request attribute features, performs a hierarchical feature search based on business type or a global feature search when no matching business type is found on the preset intelligent agent tool feature set to determine the target tool that matches the request attribute features. The target tool is then invoked to the target intelligent agent 101 to respond to the user query request.

[0031] See Figure 2 In one embodiment, a smart agent tool invocation method is provided. The execution subject of the method is the aforementioned tool management terminal. The method includes, but is not limited to, steps S201 to S204.

[0032] Step S201: Obtain user query requests for the target intelligent agent.

[0033] Step S202: Extract request attributes from the user query request to obtain request attribute features.

[0034] Step S203: Based on the request attribute features, perform hierarchical feature search based on business type or global feature search when the business type fails to match the preset intelligent agent tool feature set to determine the target tool that matches the request attribute features.

[0035] Step S204: Invoke the target tool to the target agent in response to the user query request.

[0036] Request attribute features refer to the structured representation of a user's query request. They can be implemented using rule-based feature extraction methods, such as matching user input with a predefined query template to generate a feature vector; or using machine learning models for feature extraction, such as using neural networks to encode the query text to obtain a feature representation. The main purpose is to achieve a structured transformation of the user query to provide a basis for matching.

[0037] Hierarchical feature search based on business type refers to the process of progressively filtering the feature set of intelligent agent tools according to the hierarchical business type. It can be implemented using a tree-like data structure, such as organizing tools into multi-level directories according to business domains, and drilling down layer by layer from the highest level during the search; or using classification algorithms to divide the hierarchy, such as building a business type tree based on clustering results. Its main purpose is to narrow down the search scope in order to locate candidate tools.

[0038] Global feature search refers to the search of the entire set of features of the intelligent agent tools when the hierarchical search fails to match the business type. It can be implemented using a vector space model, such as calculating the similarity score between the request attribute features and all tool features; or using a hash table for fast lookup, such as mapping features to buckets through feature hashing for retrieval. Its main purpose is to achieve comprehensive coverage of tools to ensure complete matching.

[0039] During the intelligent agent tool invocation process, the user query request for the target intelligent agent is first obtained. This request serves as the initial input, providing the necessary context and avoiding the inefficiency of directly processing raw prompts due to a surge in the number of tools. Further, request attributes are extracted from the user query request to obtain structured request attribute features. This process transforms unstructured natural language queries into actionable feature representations, significantly reducing the redundancy of prompts and providing accurate matching criteria for subsequent searches. Based on the extracted request attribute features, the executing agent performs a search operation on a pre-defined intelligent agent tool feature set. It prioritizes hierarchical feature searches based on business type to quickly narrow down the candidate range. If a business type match fails, it automatically switches to global feature search, ensuring comprehensive coverage of all potential matches even with a large tool set. Thus, the target tool matching the request attribute features is identified and invoked to the target intelligent agent to generate a response to the user query, completing the closed-loop processing from query parsing to tool execution.

[0040] As a preferred embodiment, the solution of this application is implemented as follows: When a user submits a query for "optimize inventory management", the executing entity extracts the request attribute features, which contain structured information representing the query intent; subsequently, based on these features, it searches the intelligent agent tool feature set. If the business type matches successfully, a hierarchical feature search is performed to locate the relevant tool node; otherwise, a global feature search is performed, ultimately determining the inventory optimization tool as the target tool and invoking it to the target intelligent agent. The generation of request attribute features avoids reliance on lengthy natural language prompts, while the intelligent switching mechanism of the search strategy ensures efficient location within a large tool set.

[0041] The above technical solution effectively alleviates the complexity of tool selection and the problem of prompt word inflation caused by the large size of the agent's toolset. Specifically, structured feature extraction replaces the direct use of original prompt words, fundamentally reducing prompt word redundancy. Simultaneously, the combination of hierarchical and global search mechanisms can still quickly and accurately match target tools even as the number of tools increases, improving the reliability and processing efficiency of the agent's response. Therefore, this method effectively solves the practical operational obstacles brought about by the expansion of the toolset while maintaining the simplicity of technical implementation.

[0042] In some of the embodiments described above in this application, a preset intelligent agent tool feature set is proposed for searching based on request attribute features. However, in its implementation, the construction of the feature set lacks a systematic method, resulting in the feature set being disordered or redundant, leading to low tool search efficiency and insufficient matching accuracy, especially when the number of intelligent agent tools is large, making it difficult to achieve efficient hierarchical search. To address this, this application further proposes a method for setting an intelligent agent tool feature set before extracting request type attributes from the user query request.

[0043] See Figure 3 In one embodiment, the method prior to extracting the request type attribute of the user query request further includes, but is not limited to, steps S301 to S304.

[0044] Step S301: Semantic extraction is performed on multiple intelligent agent tools to obtain tool semantic features.

[0045] Step S302: Extract keywords from the semantic features of the tool to obtain the tool keyword features.

[0046] Step S303: Perform cluster analysis on the tool keyword features to determine the tool business features to which each tool keyword feature belongs.

[0047] Step S304: Using tool business features, tool keyword features, and tool semantic features as nodes, construct a search tree structure to obtain the agent tool feature set.

[0048] Tool semantic features refer to the deep semantic representation of the essential function of a tool by an agent. They can be achieved by using a pre-trained language model based on the Transformer architecture (such as BERT or RoBERTa) to vectorize the tool description text. The aim is to fully capture the semantic connotation of the tool function and avoid the limitations of relying solely on the surface text.

[0049] Tool keyword features refer to the set of core functional terms extracted from the semantic features of tools. They can be achieved by using unsupervised keyword extraction algorithms (such as TextRank or YAKE) combined with word frequency statistics. The purpose is to refine feature representation and reduce interference from irrelevant words.

[0050] Tool business features refer to business category labels automatically divided based on keyword semantic similarity. These can be achieved by grouping keyword features using semantic vector-based clustering algorithms (such as hierarchical clustering or spectral clustering) to establish a logical business hierarchical structure.

[0051] Search tree structure construction refers to building a hierarchical tree-like index mechanism, which can be implemented by using a multi-branch tree or a trie data structure to organize nodes, with the aim of forming a navigation path from high-level business types to specific tools.

[0052] The solution in this application first extracts semantic information from multiple intelligent agent tools to generate tool semantic features, providing a comprehensive semantic foundation for tool functions. Then, based on the tool semantic features, keyword extraction is performed to obtain refined tool keyword features, effectively filtering out noise information. Next, cluster analysis is performed on the tool keyword features to automatically determine the tool's business features and establish a business-dimensional classification system. Finally, a search tree structure is constructed using the tool's business features as the root node, the tool's keyword features as intermediate nodes, and the tool's semantic features as leaf nodes. This hierarchical construction mechanism gives the feature set a clear hierarchical relationship, allowing for priority use of business features to narrow down the search scope during subsequent searches, followed by drilling down layer by layer to keyword and semantic features, thus forming an efficient hierarchical search path and significantly optimizing the feature set's organizational logic and search efficiency.

[0053] As a preferred embodiment, the solution of this application is implemented as follows: In a customer service scenario, intelligent agent tools include order query tools, refund processing tools, and logistics tracking tools. When extracting semantics from these tools, a pre-trained BERT model can be used to convert the tool description text into semantic vectors, serving as tool semantic features. Then, the TextRank algorithm is applied to extract core terms such as "order," "query," "refund," and "logistics" from the semantic features, forming tool keyword features. Next, a hierarchical clustering algorithm is used to automatically classify the keyword features into two categories: "order management" and "logistics service." Finally, using "order management" and "logistics service" as the root nodes of the search tree, related keyword features as child nodes, and tool semantic features as leaf nodes, a complete tree-like index structure is constructed. When a user query involves "order status," the system can quickly locate candidate tools under the "order management" business feature.

[0054] Through the above solution, the embodiments of this application effectively solve the problem of disordered construction of intelligent agent tool feature sets, enabling intelligent agent tool feature sets to have a logical business hierarchical structure, thereby realizing an efficient hierarchical search mechanism when the number of tools is large, significantly improving the accuracy of tool matching and search efficiency, and is especially suitable for the large-scale tool calling needs of enterprise-level AI intelligent agents in process automation scenarios.

[0055] In some of the embodiments described above in this application, request attribute extraction is proposed to extract features for user query requests. However, in the implementation process, due to the lack of specificity in the extraction method, the features may lack business context or detailed information, affecting the accuracy of subsequent tool matching. Therefore, this application further proposes a method for extracting request attributes from user query requests.

[0056] See Figure 4 In one embodiment, the method for extracting request attributes from a user query request further includes, but is not limited to, steps S401 to S403.

[0057] Step S401: Extract keywords from the user query request to obtain the request keyword features.

[0058] Step S402: Identify the business type of the request keyword features to obtain the request business features.

[0059] Step S403: Concatenate the request keyword features and the request business features to obtain the request attribute features.

[0060] Keyword extraction refers to the process of accurately identifying and capturing core terms from user query text. It can be achieved using statistical TF-IDF algorithms or deep learning-based word embedding models. The goal is to reliably obtain key details in the query and avoid intent bias caused by ignoring important terms.

[0061] Business type identification can be understood as the process of inferring the business domain to which a query belongs based on extracted keyword features. It can be implemented using a support vector machine classifier or a pre-trained text classification neural network. The purpose is to closely associate keywords with the business context, effectively supplement the domain background information, and prevent misjudgment of business type caused by isolated judgment.

[0062] Concatenation refers to the operation of merging request keyword features and request business features into a unified representation. It can be achieved by vector concatenation or structured string combination. The purpose is to overcome the limitations of a single feature dimension, retaining the accuracy of keywords while incorporating the guidance of business types, thereby constructing a more comprehensive request attribute feature.

[0063] The solution in this application first extracts key terms from the user's query request to ensure reliable capture of detailed information. Based on this, the extracted request keyword features are used as input for business type identification, resulting in request business features that logically link the business context with the query details. Finally, the request keyword features and request business features are concatenated to generate comprehensive request attribute features. This sequential design ensures that business type identification depends on the output of keyword features, avoids information fragmentation during feature extraction, and forms a coherent feature construction chain, providing accurate and domain-adaptive input for subsequent tool matching.

[0064] As a specific implementation method, this application is implemented as follows: When a user's query request is "analyze last quarter's sales data", the keyword extraction step uses natural language processing technology to identify request keyword features such as "analysis", "last quarter", "sales", and "data". Based on these keyword features, the business type identification step uses a pre-trained business classification model to determine the request business feature as "sales analysis". The concatenation step combines the request keyword features and the request business features into a structured request attribute feature, for example, represented in the form of "sales analysis: analysis, last quarter, sales, data". This feature includes both specific operational terms and reflects business domain attributes.

[0065] Through the above solution, the embodiments of this application ensure that the request attribute features fully cover the query details and business context, effectively solve the tool matching deviation problem caused by missing features, and significantly improve the accuracy of understanding user intent and the reliability of response during the intelligent agent tool invocation process.

[0066] In some embodiments of this application, a method for searching the feature set of intelligent agent tools based on request attribute features to determine the target tool is proposed. However, in its implementation, the lack of a pre-compatibility verification mechanism for candidate tools leads to the possibility that the matched candidate tools may not effectively respond to the user query, resulting in response results that do not meet compatibility conditions. This triggers repeated search processes, increasing system processing latency and resource consumption, and reducing the efficiency and reliability of tool invocation. To address this, this application further proposes a method for hierarchical feature search or global feature search of the feature set of intelligent agent tools.

[0067] See Figure 5 In one embodiment, the method for performing hierarchical feature search or global feature search on the feature set of the intelligent agent tool also includes, but is not limited to, steps S501 to S505.

[0068] Step S501: Search for several candidate tool business features that belong to the intelligent agent tool feature set and match the requested attribute features.

[0069] Step S502: When candidate tool business features are found, hierarchical feature search is performed on the feature nodes belonging to the candidate tool business features, and the searched tool semantic features are used as candidate tool semantic features.

[0070] Step S503: If no candidate tool business features are found, a global search is performed on the tool semantic features in the intelligent agent tool feature set to obtain several candidate tool semantic features.

[0071] Step S504: Determine the candidate tool corresponding to the semantic features of the candidate tool.

[0072] Step S505: Perform compatibility testing on the candidate tools and determine the target tool based on the test results.

[0073] Candidate tool business features refer to the feature set that matches the request attribute features in the business type dimension of the intelligent agent tool feature set. It can be implemented by using an accurate matching algorithm based on predefined business classification labels or a similarity calculation model based on business semantic embedding vectors. The purpose is to quickly narrow the search range through business context constraints and avoid the waste of computing resources caused by global scanning.

[0074] Hierarchical feature search can be understood as a progressive feature matching process under the constraints of defined business features. It can be implemented by depth-first traversal based on search tree structure or priority sorting algorithm based on feature node weights. The purpose is to combine request keyword features to perform fine-grained matching in a specific business domain and improve the accuracy of tool semantic feature positioning.

[0075] Global search refers to an unconstrained and comprehensive retrieval of the agent's tool feature set when the business type match fails. It can be implemented by using cosine similarity calculation based on tool semantic feature vectors or fuzzy matching strategy based on keyword expansion. The purpose is to ensure that all potential tool options are covered even when the business type is misjudged, and to prevent effective tools from being missed.

[0076] The candidate tool corresponding to the semantic features of the candidate tool refers to the specific tool instance determined based on the semantic feature mapping relationship. It can be realized through the feature identifier parsing of the tool registry center or the dynamic query mechanism of tool metadata. The purpose is to provide operable tool objects for compatibility verification.

[0077] Compatibility testing can be understood as a preliminary verification of the actual execution capability of candidate tools. It can be implemented by constructing dynamic call tests that simulate query requests or by static verification methods based on the compliance of tool interface specifications. The purpose is to evaluate the responsiveness of the tool through actual operation and avoid compatibility risks caused by static analysis that relies solely on feature matching.

[0078] The solution in this application embodiment constructs a complete tool screening mechanism by embedding compatibility testing into the core of the tool selection process. When a search is initiated based on request attribute features, the executing entity first locates the business features of candidate tools based on the request's business characteristics. This step utilizes business type information to establish initial screening conditions, effectively excluding tool features from irrelevant business domains and significantly reducing the computational complexity of subsequent searches. If a candidate tool's business features are successfully matched, a hierarchical feature search is performed on the feature nodes under the constraints of these business features. This step, combined with request keyword features, refines the matching granularity in a specific business context, ensuring that the acquisition of tool semantic features is business-specific. If the business feature matching fails, the system automatically switches to a global search mode, performing an unbiased and comprehensive retrieval of tool semantic features to ensure the completeness of tool coverage. Subsequently, the acquired candidate tool semantic features are mapped to specific candidate tools, providing operational entities for the verification stage. Finally, by generating a test query request and actually calling the candidate tools to execute the response, compatibility is determined based on the objective analysis of the response results, thereby selecting the target tool suitable for the user's query. This process design, through a business type-guided hierarchical search and global search intelligent switching mechanism, combined with dynamic compatibility verification, forms a closed-loop verification system from feature matching to actual execution, avoiding the compatibility blind spots caused by the disconnect between static feature matching and actual execution in traditional solutions.

[0079] As a specific implementation method, the solution of this application embodiment is implemented as follows: In an e-commerce customer service scenario, when a user's query request is "how to query order logistics information", the system extracts the request attribute features, including the keywords "order" and "logistics" and the business type "e-commerce"; then, it searches for matching "e-commerce" business features in the intelligent agent tool feature set, and after successful location, it performs hierarchical feature search on the feature nodes under the business feature to match the keyword feature of "logistics query" and obtain the corresponding tool semantic features; it maps the semantic features to a specific logistics query tool; then, it generates a test query request "query the logistics status of order number TRK123", and calls the candidate tool to execute the response; if the tool returns a valid response containing logistics node information, the compatibility is confirmed to be up to standard, and the tool is determined to be the target tool; if the tool returns an interface error or times out without response, the tool is excluded and other candidate tools are tested.

[0080] Through the above technical solutions, the embodiments of this application effectively avoid response failures and repeated search problems caused by tool incompatibility, reduce system processing delays and resource consumption, improve the efficiency and reliability of tool invocation, and ensure that user queries can be accurately responded to by the compatible tools.

[0081] In some embodiments of this application, a hierarchical feature search is proposed to determine the semantic features of candidate tools by performing hierarchical feature search on feature nodes belonging to the business features of candidate tools. However, the specific implementation mechanism of hierarchical feature search is not clear during its implementation, which may lead to problems such as an excessively wide search range, insufficient matching accuracy, or low efficiency when matching request attribute features, thereby affecting the accuracy and response speed of tool invocation. In response, this application further proposes a method for performing hierarchical feature search on feature nodes belonging to the business features of candidate tools.

[0082] In one embodiment, a hierarchical feature search is performed on the feature nodes belonging to the candidate tool business features, including: searching for several candidate tool keyword features that belong to the candidate tool business features and match the request attribute features; when a candidate tool keyword feature is found, the tool semantic feature corresponding to the candidate tool keyword feature is used as the candidate tool semantic feature.

[0083] The solution in this application matches keyword features in the request attribute features with tool keyword features under the candidate tool business feature nodes. Only when a match is successful is the pre-associated tool semantic feature extracted, thus establishing a direct mapping path from keyword features to semantic features under business type constraints. This mechanism ensures that the search process is strictly limited to the relevant business domain, avoiding redundant computations caused by global searches. Simultaneously, by utilizing predefined feature associations in the previously constructed search tree structure, repetitive semantic analysis steps are eliminated, enabling hierarchical feature search to quickly focus on highly relevant feature nodes, forming an efficient conversion chain from request attribute features to candidate tool semantic features.

[0084] As a preferred embodiment, the solution of this application is implemented as follows: In a customer service scenario, the user's query request is "how to reset password". The system extracts the request keyword features as "reset" and "password", and the request business feature is "account management". In the intelligent agent tool feature set, the system first locates the "account management" business feature node, and then searches for candidate tool keyword features that match "reset" and "password" under this node, such as "password reset" or "account password change". When the keyword feature "password reset" is matched, the system directly calls its pre-associated tool semantic feature "user account password reset service" as a candidate tool semantic feature. This semantic feature can specifically correspond to the password management tool module for subsequent tool call processes.

[0085] Through the above-described scheme, the embodiments of this application effectively narrow the scope of hierarchical feature search, avoid invalid searches in irrelevant business areas, and significantly improve the targeting and relevance of matching; at the same time, by directly utilizing the predefined keyword feature and semantic feature mapping relationship, redundant calculation steps are reduced, thereby improving the accuracy and response speed of tool invocation.

[0086] In some of the embodiments described above in this application, compatibility testing of candidate tools is proposed to determine the target tool. However, in its implementation, the testing process lacks standardized operating procedures, resulting in highly subjective and poorly repeatable test results. This makes it impossible to accurately assess the compatibility performance of the tool in real-world scenarios, potentially leading to the incorrect selection of incompatible tools, which in turn causes agent response failures or a decrease in system stability. Therefore, this application further proposes a method for conducting compatibility testing of candidate tools.

[0087] In one embodiment, performing compatibility testing on candidate tools and determining the target tool based on the test results includes: generating a test query request; invoking the candidate tools to respond to the test query request and obtaining test results; and determining the target tool based on the degree of compatibility represented by the test results.

[0088] Generating test query requests refers to creating standardized test inputs for verifying the compatibility of candidate tools. This can be achieved by dynamically generating based on the characteristics of user query requests or by calling a predefined test case library. The purpose is to ensure that the test scenario is highly consistent with the actual business requirements and to avoid the shortcomings of general test data that cannot reflect real compatibility risks.

[0089] Calling candidate tools to respond to test query requests can be understood as executing tools to process test inputs through interface calls. This can be achieved using synchronous calls or asynchronous message queue mechanisms. The purpose is to obtain dynamic response data of the tools during runtime, verify the integrity of the functionality, and capture potential interaction problems.

[0090] Determining the target tool based on the degree of compatibility represented by the test results involves quantifying the test results into compatibility indicators. For example, a weighted calculation method can be used, which includes response time, error rate, and data format compliance scores. The purpose is to provide an objective basis for decision-making, so that the selection of the target tool can be freed from subjective experience.

[0091] The solution in this application first generates a targeted test query request to ensure that the test input matches the characteristics of the user query request. Then, a candidate tool is invoked to process the request, capturing the response data during actual runtime. Finally, the compatibility level is quantified based on the test results, forming a closed-loop testing process. This sequential execution ensures the standardization and repeatability of the testing process, overcomes the limitations of relying solely on static feature matching, and allows tool selection to be based on dynamic verification rather than subjective judgment, thereby effectively solving the problem of unreliable decision-making caused by fuzzy testing methods.

[0092] As a specific implementation method, the solution of this application embodiment is implemented as follows: In the customer service intelligent agent scenario, a test query request such as "query the status of recent orders" is generated, a candidate tool is called to process the request, and the response time, error occurrence and data format compliance are recorded; based on these test results, a compatibility score is calculated, and the tool with the highest score is selected as the target tool.

[0093] Through the above-described solution, the embodiments of this application improve the objectivity and repeatability of compatibility testing, accurately evaluate the compatibility performance of tools in real-world scenarios, avoid tool selection errors caused by non-standard testing, thereby reducing the risk of agent response failure and improving system stability.

[0094] In some embodiments described above, an intelligent agent tool invocation method is proposed to achieve tool matching and invocation for user queries. However, in this process, due to the increasingly large size of the intelligent agent toolset and the increasing complexity of selection, the target tool may produce incompatible response results. The lack of an automatic verification and feedback mechanism for the response results leads to query failures or the need for manual intervention, affecting system robustness and user experience. Therefore, embodiments of this application further propose an intelligent agent tool invocation method.

[0095] In one embodiment, the intelligent agent tool invocation method further includes: obtaining the response result of the target intelligent agent in response to the user query request; determining whether the compatibility degree represented by the response result meets the preset response compatibility conditions; if not, returning to the steps of performing hierarchical feature search based on business type or global feature search when the business type fails to match the preset intelligent agent tool feature set.

[0096] Judging the compatibility represented by the response result refers to the quantitative evaluation of the response content based on preset conditions. This can be achieved by using a rule matching engine or a preset threshold comparison method. The purpose is to automatically determine the applicability of the tool and avoid subjective misjudgment.

[0097] The solution in this application first obtains the response results of the target intelligent agent to the user's query request as input data for compatibility evaluation. Then, based on preset response compatibility conditions, the response results are judged to determine whether the compatibility level meets the standard. When the judgment result is that it does not meet the preset conditions, the process is automatically triggered to return to the tool search stage, and hierarchical feature search or global feature search is re-executed to select a new tool. This closed-loop mechanism ensures that the tool invocation process can dynamically adapt to the response results, and achieves system self-correction through real-time feedback, thereby effectively solving the query failure problem caused by tool incompatibility.

[0098] As a preferred embodiment, the solution of this application is implemented as follows: In a customer service scenario, when a user's query request is "query order status", the target tool is invoked and the response result is obtained; it is determined whether the response result contains a valid status identifier, for example, checking whether there is a "status" field and its value is "success"; if the "status" field in the response is "error", it is determined that it does not meet the preset response compatibility conditions, and the hierarchical feature search based on business type is performed to re-select tools suitable for order query.

[0099] Through the above solution, the embodiments of this application realize automatic verification and dynamic adjustment of response results after tool invocation, avoid query failures caused by tool incompatibility, significantly improve the automation level and system robustness of intelligent agent tool invocation, and reduce the need for manual intervention.

[0100] See Figure 6 This application also provides an intelligent agent tool invocation device, which can implement the above-described intelligent agent tool invocation method. The device includes: The first module 601 is used to obtain user query requests for the target intelligent agent; The second module 602 is used to extract request attributes from user query requests to obtain request attribute features; The third module 603 is used to perform hierarchical feature search based on business type or global feature search when the business type fails to match based on the request attribute features, in order to determine the target tool that matches the request attribute features. The fourth module, 604, is used to invoke the target tool to the target intelligent agent in response to the user's query request.

[0101] The specific implementation of this intelligent agent tool invocation device is basically the same as the specific implementation of the intelligent agent tool invocation method described above, and will not be repeated here.

[0102] Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application.

[0103] The following reference Figure 7 To describe an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0104] like Figure 7 As shown, the electronic device 700 is presented in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including storage unit 720 and processing unit 710), a display unit 740, etc.

[0105] The storage unit stores program code, which can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the above-described intelligent agent tool invocation method section of this specification according to various exemplary embodiments of this disclosure.

[0106] Storage unit 720 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 7201 and / or cache memory 7202, and may further include a read-only memory (ROM) 7203.

[0107] The storage unit 720 may also include a program / utility 7204 having a set (at least one) program module 7205, such program module 7205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0108] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0109] Electronic device 700 can also communicate with one or more external devices 700' (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 700, and / or with any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. Network adapter 760 can communicate with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0110] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0111] The intelligent agent tool invocation method, apparatus, device, and medium provided in this application embodiment achieve accurate and efficient matching of target tools by introducing request attribute extraction and hierarchical feature search or global feature search mechanism based on business type. This effectively solves the problems of complexity in the tool selection process and low resource allocation efficiency, and has the advantages of simplifying the tool selection process, improving system response efficiency and resource utilization efficiency, and improving user experience.

[0112] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, or network device, etc.) to execute the methods described above according to the embodiments of this disclosure.

[0113] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0114] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0115] Those skilled in the art will understand that the above modules can be distributed in the device as described in the embodiments, or they can be modified accordingly and placed in one or more devices that are unique to this embodiment. The modules in the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.

[0116] Exemplary embodiments of this disclosure have been specifically shown and described above. It should be understood that this disclosure is not limited to the detailed structures, arrangements, or implementations described herein; rather, this disclosure is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended claims.

Claims

1. A method for invoking intelligent agent tools, characterized in that, include: Obtain user query requests for the target agent; The user query request is subjected to request attribute extraction to obtain request attribute features; Based on the requested attribute features, a hierarchical feature search based on business type or a global feature search when the business type fails to match is performed on the preset intelligent agent tool feature set to determine the target tool that matches the requested attribute features. The target tool is invoked to the target intelligent agent in response to the user query request.

2. The method for invoking intelligent agent tools according to claim 1, characterized in that, Before extracting the request type attribute from the user query request, the method further includes: Semantic extraction is performed on multiple intelligent agent tools to obtain tool semantic features; Keyword extraction is performed on the semantic features of the tool to obtain the tool keyword features; Cluster analysis is performed on the tool keyword features to determine the tool business features to which each tool keyword feature belongs; Using the tool's business features, keyword features, and semantic features as nodes, a search tree structure is constructed to obtain the agent tool feature set.

3. The method for invoking intelligent agent tools according to claim 1, characterized in that, The step of extracting request attributes from the user query request includes: Keyword extraction is performed on the user query request to obtain the request keyword features; The request keyword features are used to identify the business type, thus obtaining the request business features; The request attribute features are obtained by concatenating the request keyword features and the request business features.

4. The method for invoking intelligent agent tools according to claim 1, characterized in that, The step of performing hierarchical feature search based on business type or global feature search when no matching business type is found on the preset intelligent agent tool feature set based on the requested attribute features includes: Search for several candidate tool business features that belong to the intelligent agent tool feature set and match the request attribute features; When the candidate tool business features are found, a hierarchical feature search is performed on the feature nodes belonging to the candidate tool business features, and the searched tool semantic features are used as candidate tool semantic features. If the candidate tool business features are not found, a global search is performed on the tool semantic features in the intelligent agent tool feature set to obtain several candidate tool semantic features. Determine the candidate tools corresponding to the semantic features of the candidate tools; Compatibility tests are performed on the candidate tools, and the target tool is determined based on the test results.

5. The method for invoking intelligent agent tools according to claim 4, characterized in that, The hierarchical feature search for feature nodes belonging to the business features of the candidate tools includes: Search for several candidate tool keyword features that belong to the candidate tool business features and match the request attribute features. When the candidate tool keyword features are found, the tool semantic features corresponding to the candidate tool keyword features are used as candidate tool semantic features.

6. The method for invoking intelligent agent tools according to claim 4, characterized in that, The process of conducting compatibility tests on the candidate tools and determining the target tool based on the test results includes: Generate a test query request; The candidate tool is invoked to respond to the test query request, and the test results are obtained. The target tool is determined based on the degree of compatibility characterized by the test results.

7. The method for invoking intelligent agent tools according to claim 1, characterized in that, Also includes: Obtain the response result of the target intelligent agent in response to the user query request; Determine whether the compatibility level represented by the response result meets the preset response compatibility conditions; If it does not match, return to the step of performing hierarchical feature search based on business type on the preset intelligent agent tool feature set or global feature search when the business type fails to match.

8. A smart agent tool invocation device, characterized in that, include: The first module is used to obtain user query requests for the target intelligent agent; The second module is used to extract request attributes from the user query request to obtain request attribute features; The third module is used to perform hierarchical feature search based on business type or global feature search when the business type fails to match based on the requested attribute features, in order to determine the target tool that matches the requested attribute features. The fourth module is used to invoke the target tool to the target intelligent agent in response to the user query request.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the intelligent agent tool invocation method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the intelligent agent tool invocation method as described in any one of claims 1 to 7.