A task-oriented intelligent agent cognitive enhancement method
Patent Information
- Application Number
- CN202611220309.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-10-09
AI Technical Summary
[0002]现有任务型智能体依赖基础文本嵌入向量完成API检索匹配,传统单粒度相似度计算仅能捕捉文本整体语义方向,无法区分token级概率分布差异与局部高维特征细节,生成的向量易出现语义混叠,意图与指代信息丢失严重,直接导致工具匹配准确率偏低
[0015]具体而言,构建粗、中、细三层多粒度语义融合机制,依托NSGA-III算法自动求解各粒度最优融合权重,无需人工配置权重参数;通过全局阈值搭配分层自适应阈值完成迭代三支决策筛选,精准区分高相关、低相关及待判定任务模板,结合迭代轮次衰减规则动态分配聚合权重并归一化处理,最终生成同时保留整体意图、token分布差异与局部特征细节的增强查询嵌入向量,有效缓解传统方法存在的语义混叠问题,大幅提升向量表征区分度。在无模型微调的零样本条件下,本发明在语义相似度基准数据集上实现斯皮尔曼相关系数显著提升,于任务智能体API匹配数据集上的Top1检索准确率相较现有最优基线方法实现明显上涨,中粒度KL散度模块作为核心判别组件,与另外两类粒度形成协同增益,单独移除任意粒度模块均会出现大幅性能下滑,验证多粒度融合框架的不可替代性。
Smart Images

Figure CN122885534A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of cognitive enhancement methods, and particularly relates to a cognitive enhancement method for task-oriented intelligent agents. Background Technology
[0002] Existing task-oriented agents rely on basic text embedding vectors to complete API retrieval and matching. Traditional single-granularity similarity calculations can only capture the overall semantic direction of the text and cannot distinguish between token-level probability distribution differences and local high-dimensional feature details. The generated vectors are prone to semantic aliasing, and intent and referential information are severely lost, directly resulting in low matching accuracy of the tool. At the same time, the conventional fixed threshold template selection method lacks adaptive discrimination ability and cannot dynamically divide candidate templates according to different granularity semantic features. Irrelevant templates interfere with the generation of embedding vectors, making it difficult to simultaneously take into account the three types of semantic information: coarse-grained overall intent, medium-grained distribution differences, and fine-grained local features.
[0003] Current mainstream embedding optimization schemes mostly rely on model fine-tuning or large amounts of labeled data, resulting in significant performance degradation in zero-shot scenarios. Single similarity index fusion methods lack multi-objective optimal weighting mechanisms, and the weights of various granular features are manually set, failing to adapt to different domain tasks. Furthermore, existing methods do not introduce iterative three-way decision-making hierarchical selection logic, making it impossible to dynamically allocate aggregation weights based on the uncertainty of template relevance determination. Templates with ambiguous relevance are given equal weight in vector aggregation with strongly related templates, further reducing the discriminative power of the final embedded vector and hindering the practical application of zero-shot tools for task-oriented intelligent agents. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a cognitive enhancement framework for task-oriented intelligent agents. This framework can learn low-dimensional feature vectors that simultaneously preserve both intent semantics and referential semantics, and significantly improve the accuracy of API matching.
[0005] To achieve the above objectives, this invention discloses a cognitive enhancement method for task-oriented intelligent agents. Its core lies in a hierarchical three-branch decision-making and multi-granularity fusion framework, the specific technical solution of which is as follows: Includes the following steps: Step 1: Based on the target task's meta-attributes and application domain, construct a hierarchical multi-granularity task template set in advance. Use a pre-trained vector encoding model to perform vector encoding on the input user query and all multi-granularity task templates to obtain the user query vector and each task template vector. Step 2: Based on the encoded vector, calculate the three types of similarity scores: coarse-grained, medium-grained, and fine-grained. The coarse-grained score uses cosine similarity to represent the overall semantic direction matching degree, the medium-grained score uses KL divergence to represent the text token-level probability distribution shift degree, and the fine-grained score uses RBF kernel function to represent the closeness of local features in high-dimensional space. Step 3: Construct a multi-objective optimization problem using the weights corresponding to the three types of granularity scores as optimization variables, and use the NSGA-III multi-objective optimization algorithm to solve the Pareto optimal solution to obtain the optimal weights corresponding to the three types of granularity scores. Step 4: For each task template, calculate the joint relevance score by combining the three types of granularity scores and the corresponding optimal weights. When calculating, the product of the cosine similarity score and the corresponding optimal weight is used as the positive term, the product of the KL divergence score and the corresponding optimal weight is used as the negative deduction term, and the product of the RBF kernel function score and the corresponding optimal weight is used as the positive term. The results of the three calculations are combined to obtain the joint relevance score of the template. Step 5: Calculate the global screening threshold based on the joint relevance scores of all task templates and the preset significance level; Then, by combining the optimal weight ratio of the three granularity scores, the adaptive thresholds corresponding to coarse granularity, medium granularity, and fine granularity are obtained respectively. Step 6: Initialize the boundary domain set, assign all task templates to the initial boundary domain, and repeat the three-way decision partitioning process until the boundary domain is empty. Based on three types of adaptive thresholds, the templates in the current boundary domain are divided into positive domain, negative domain, and updated boundary domain, respectively. The positive domain templates are effective templates that highly match the semantics of the user query, the negative domain templates are invalid templates that differ too much from the distribution of the user query, and the boundary domain templates are templates to be filtered where the similarity determination is uncertain. Initial weights are assigned based on the iteration round in which the template is included in the positive domain. Templates included in the positive domain earlier are assigned higher initial weights, while templates included in later rounds have their weights reduced by a fixed decay coefficient. Negative domain templates do not participate in subsequent vector aggregation weight allocation. After the loop ends, the remaining boundary domain templates are assigned corresponding initial weights based on their own uncertainties. Step 7: Perform global normalization on the initial weights of all templates participating in the aggregation to obtain the final dynamic weights of each template. Use the normalized dynamic weights to perform a weighted sum aggregation operation on the vectors of all positive domain and retention boundary domain templates to generate an enhanced query embedding vector. Step 8: Use enhanced query embedding vectors to complete API matching retrieval, and call the corresponding tools to complete task-oriented intelligent agent interaction based on the matching results.
[0006] Preferably, in step 1, the BGE-M3 model is selected as the pre-trained vector encoding model. By prompting the engineering design of multi-granularity task templates, the large language model is guided to generate vector representations with differentiated semantic density.
[0007] Preferably, in step 2, the coarse-grained cosine similarity is obtained by dividing the inner product of the query vector and the template vector by the product of the norms of the two vectors; Medium-granularity KL divergence is obtained by comparing the templates and querying the difference in the probability distribution of the tokens. The larger the KL divergence value, the greater the difference in the semantic distribution of the two types of text. The fine-grained RBF kernel score is calculated based on the distance in the vector space through a nonlinear exponential mapping. The higher the score, the higher the matching degree between the query and the local features of the template.
[0008] Preferably, the global threshold selection rule in step 5 is: the smallest value among all joint correlation scores that satisfies the condition that "the proportion of templates with scores greater than or equal to the threshold is not less than 1 minus the significance level"; the three adaptive thresholds are calculated by multiplying the global threshold by the corresponding granularity optimal weight, and then dividing by the sum of the weights of the three granularities.
[0009] Preferably, the three-branch decision partitioning rules include: if the ratio of the coarse-grained similarity score of the boundary domain template to the coarse-grained adaptive threshold is greater than or equal to the global threshold, the template is classified into the positive domain; after excluding the positive domain templates, if the ratio of the medium-grained KL divergence score to the medium-grained adaptive threshold of the remaining templates is greater than or equal to the global threshold, the template is classified into the negative domain; after excluding the positive and negative domain templates, if the ratio of the fine-grained RBF kernel score to the fine-grained adaptive threshold of the remaining templates is greater than or equal to the global threshold, the template is retained for the next round of boundary domain partitioning.
[0010] Preferably, the fixed attenuation coefficient is set to half, and the initial weight of the template is halved for each delayed round when it is included in the positive domain.
[0011] Preferably, the weight normalization operation in step 7 is as follows: the sum of the initial weights of all templates to be aggregated is calculated, the initial weight of a single template is divided by the sum of the weights to obtain the dynamic weight, and the sum of the dynamic weights of all templates is 1.
[0012] Preferably, this method does not require fine-tuning of the pre-trained encoding model or the large language model, and directly completes API matching retrieval based on zero-shot method; on the semantic similarity evaluation dataset and the task-oriented agent API matching dataset, the Spearman correlation coefficient, F1 score and Top-n retrieval accuracy are used to complete the performance evaluation.
[0013] Preferably, the hierarchical multi-granularity task template set covers three semantic representation dimensions: coarse, medium, and fine. In the ablation experiment, removing any one type of granularity scoring module alone would cause a significant drop in retrieval and semantic matching performance. The synergistic fusion of the three types of granularity scoring achieves the optimal embedding representation effect.
[0014] A cognitive enhancement system for task-oriented intelligent agents includes a vector encoding module, a multi-granularity scoring calculation module, a multi-objective optimization module, a joint correlation calculation module, a three-way decision dynamic weight allocation module, a vector weighted aggregation module, and an API matching and calling module; the system executes the cognitive enhancement method for task-oriented intelligent agents as described in any one of claims 1 to 9.
[0015] Specifically, a three-layer multi-granularity semantic fusion mechanism (coarse, medium, and fine) is constructed. The NSGA-III algorithm automatically solves for the optimal fusion weights at each granularity, eliminating the need for manual weight parameter configuration. Iterative three-way decision filtering is performed using a global threshold combined with hierarchical adaptive thresholds to accurately distinguish between highly relevant, low-relevance, and task templates to be judged. Aggregate weights are dynamically allocated and normalized based on iteration decay rules, ultimately generating an enhanced query embedding vector that retains overall intent, token distribution differences, and local feature details. This effectively alleviates the semantic aliasing problem of traditional methods and significantly improves the vector representation discriminativeness. Under zero-sample conditions without model fine-tuning, this invention achieves a significant improvement in Spearman correlation coefficient on a semantic similarity benchmark dataset and a significant increase in Top-1 retrieval accuracy on a task agent API matching dataset compared to existing best-in-class methods. The medium-granularity KL divergence module, as a core discriminant component, forms a synergistic gain with the other two granularity levels. Removing any single granularity module results in a significant performance decline, verifying the irreplaceable nature of the multi-granularity fusion framework.
[0016] The overall framework of this invention requires no fine-tuning or adaptation of the pre-trained encoder or large language model throughout the entire process. It can directly complete API matching and retrieval with zero samples when facing new business function scenarios, saving the costs of model retraining and labeled data collection. It is adaptable to actual intelligent agent systems that require rapid iterative expansion of tool interfaces. The iterative three-branch decision continuously shrinks the set of templates to be judged until the boundary domain is cleared, filtering out low-relevance invalid templates and reducing the interference of irrelevant information on the embedded vectors. The weight decay mechanism ensures that templates judged as highly relevant earlier have a higher contribution ratio in vector aggregation, further enhancing the representation of the user's true query intent. Ablation comparison experiments demonstrate that adaptive thresholding and dynamic weight allocation strategies have stable performance advantages over conventional solutions such as random thresholding and average pooling aggregation, and can meet the dual application needs of general semantic matching and vertical domain task tool retrieval. Attached Figure Description
[0017] Figure 1 This is a flowchart of the present invention; Figure 2 This is a comparison chart of ablation study results with replacement of the main modules and algorithms. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0019] The cognitive enhancement method for task-oriented intelligent agents disclosed in this invention, whose overall architecture is named 3WDAgent-Cog, has the following workflow: Figure 1 As shown, a high-performance pre-trained encoder is used to encode user queries and a series of preset hierarchical task templates into vectors. Through the multi-granularity fusion and three-way decision mechanism at the core of this invention, the best template is dynamically calculated and selected, and weighted aggregation is performed to finally generate a highly discriminative enhanced query embedding vector.
[0020] Step 1: First, based on the task's meta-attributes and specific domain, design and construct a hierarchical, multi-granular task template set. These templates aim to induce LLM to generate vectors with specific semantic densities through cue engineering, thereby laying the foundation for subsequent analysis. This invention selects the BGE-M3 model as the pre-embedding backbone. This model is a powerful encoder architecture whose generated embedding vector space can form compact, functionally distinguishable clusters, effectively avoiding the semantic aliasing problem present in other models.
[0021] Step 2: The similarity score is obtained by weighted fusion of three different granularities. The cosine similarity score only retains the directional information of the vector and ignores higher-order statistical information; the KL divergence score depends on the probability distribution pattern of the vector and is used to capture the difference between the first and second moments; the RBF kernel function score is sensitive to the local structure and higher-order statistical information of the vector through nonlinear mapping.
[0022] Step 3: Use the NSGA-III algorithm to solve the Pareto optimal solution of the multi-objective optimization problem to determine the optimal weights.
[0023] Step 4: Calculate the joint relevance score between the user query and each task template. For any task template, its joint relevance score consists of three parts: the first part is the product of the cosine similarity score and its optimal weight; the second part is the product of the KL divergence score and its optimal weight, which is subtracted from the overall score as a negative term; the third part is the product of the RBF kernel function score and its optimal weight, which is added to the overall score as a positive term.
[0024] Specifically, the cosine similarity score corresponds to coarse-grained semantic similarity, and its weight is the optimal weight of cosine similarity obtained by the NSGA-III algorithm; the KL divergence score corresponds to medium-grained probability distribution difference, and its weight is the optimal weight of KL divergence obtained by the NSGA-III algorithm; the RBF kernel function score corresponds to fine-grained local structural similarity, and its weight is the optimal weight of RBF kernel function obtained by the NSGA-III algorithm.
[0025] For each template, the joint relevance score is calculated as follows: First, multiply the cosine similarity score between the user query and the template by the optimal weight corresponding to the cosine similarity; then subtract the product of the KL divergence score of the template relative to the user query and the optimal weight corresponding to the KL divergence; finally, add the product of the RBF kernel function score between the user query and the template and the optimal weight corresponding to the RBF kernel function. The result is the joint relevance score of the template relative to the current user query.
[0026] The KL divergence score is deducted because it represents the degree of probability distribution deviation between the query and the template. The greater the distribution difference, the weaker the consistency between the two in the enhancement space. Therefore, the overall relevance of the template is reduced in the joint relevance calculation.
[0027] Step 5: Encode the user query and the predefined task template using the BGE-M3 vector embedding model to obtain the vector representation of the query and the vector representation of the template. Based on these vector representations, calculate the scores at three levels: coarse-grained, medium-grained, and fine-grained.
[0028] At the coarse-grained level, the cosine similarity between the user query vector and the task template vector is calculated. This is done by performing an inner product operation on the encoded vector of the user query and the corresponding encoded vector of the task template, and then dividing the result by the product of the norms of the two vectors. The resulting cosine similarity score represents the degree of consistency between the query and the template in the overall semantic direction. A higher cosine similarity indicates that the two are closer in direction in the vector space, and the stronger their overall semantic relevance.
[0029] At the medium-granularity level, KL divergence is used to calculate the token-level probability distribution shift between the template text and the query text caused by the prompt. The calculation process is as follows: for each component in the template text probability distribution, calculate the product of that component and its own logarithm, and sum all the products. Simultaneously, for each component in the template text probability distribution, calculate the product of its logarithm with the corresponding probability component in the query text, and sum all the products. Finally, subtract the sum of the previous and subsequent terms to obtain the KL divergence score. This score measures the degree of shift in the template distribution relative to the query distribution; a larger shift indicates a more significant difference in the token-level probability distribution between the template and the query.
[0030] At a fine-grained level, the RBF kernel function is used to quantify the closeness between the user query and the task template in the high-dimensional feature space. The calculation process is as follows: first, the difference between the user query vector and the task template vector is calculated; then, the square norm of this difference is calculated to represent the distance between them in the vector space; subsequently, this distance is multiplied by a negative kernel parameter, and the result is exponentially calculated to obtain the RBF kernel function score. The higher the score, the closer the user query and the task template are in the local feature space.
[0031] Step 6: Based on the optimal weights and preset significance level, first calculate the global threshold. This global threshold is used to control the overall significance level during the template screening process. The calculation process is as follows: among all possible thresholds, find the smallest threshold that satisfies the condition that the probability of the joint correlation score being greater than or equal to this threshold is not less than one minus the significance level.
[0032] After obtaining the global threshold, adaptive thresholds for coarse-grained, medium-grained, and fine-grained scores are calculated based on the weight ratios of different granularity scores in the current iteration round. Specifically, the coarse-grained adaptive threshold is calculated as follows: multiply the global threshold by the weight corresponding to the cosine similarity score in the current iteration round, and then divide by the sum of the weights of the cosine similarity score, KL divergence score, and RBF kernel function score in the current iteration round. The result is used as the coarse-grained adaptive threshold. The medium-grained adaptive threshold is calculated as follows: multiply the global threshold by the weight corresponding to the KL divergence score in the current iteration round, and then divide by the sum of the weights of the cosine similarity score, KL divergence score, and RBF kernel function score in the current iteration round. The result is used as the medium-grained adaptive threshold. The fine-grained adaptive threshold is calculated as follows: multiply the global threshold by the weight corresponding to the RBF kernel function score in the current iteration round, and then divide by the sum of the weights of the cosine similarity score, KL divergence score, and RBF kernel function score in the current iteration round. The results are used as fine-grained adaptive thresholds.
[0033] Subsequently, based on the three adaptive thresholds mentioned above, templates still in the boundary region from the previous iteration are reclassified. For the positive region classification, the judgment begins with templates in the boundary region from the previous round. If the ratio of a template's cosine similarity score divided by the corresponding medium-granularity threshold is greater than or equal to the global threshold, then the template is classified into the positive region of the current round. Templates in the positive region indicate that they have high consistency with the user query in the coarse-grained semantic direction and should be retained as relevant templates. For the negative region classification, after excluding templates already classified into the positive region, the remaining templates are judged. If the ratio of a template's KL divergence score divided by the corresponding coarse-grained threshold is greater than or equal to the global threshold, then the template is classified into the negative region of the current round. Templates in the negative region indicate that they have a significant deviation from the user query in terms of probability distribution and have weak correlation, and should be removed from the subsequent candidate range.
[0034] For boundary domain updates, after excluding templates already classified as positive or negative, the remaining templates are evaluated. If the ratio of a template's RBF kernel function score divided by the corresponding fine-grained threshold is greater than or equal to the global threshold, the template is retained in the boundary domain of the current iteration. Templates in the boundary domain indicate that they cannot yet be definitively classified as positive or negatively correlated, but still possess a certain degree of similarity at the fine-grained local feature level, thus requiring further evaluation in the next iteration.
[0035] Step 7: Initialize the template weight vector and the initial boundary region. The initial boundary region contains all templates in the task template set; that is, before the three-way decision begins, all templates are in a pending judgment state. Then, the adaptive threshold calculation and three-way decision partitioning process in Step 6 are executed iteratively until the boundary region is empty. In each iteration, the system, based on the coarse-grained, medium-grained, and fine-grained adaptive thresholds calculated in the current iteration, classifies the templates in the current boundary region into the positive region, negative region, or a new boundary region, respectively. Templates classified into the positive or negative region are removed from the boundary region and no longer participate in the next round of boundary judgment; templates remaining in the boundary region continue into the next iteration.
[0036] For templates assigned to the positive domain, an initial weight is assigned based on the iteration round in which they were removed from the boundary domain. Specifically, the earlier a template is assigned to the positive domain, the clearer its relevance to the user query, and therefore it should receive a higher weight; the later a template is assigned to the positive domain, the more rounds of uncertain processes its relevance assessment has undergone, and therefore its weight decreases round by round according to a preset decay factor. The decay factor mentioned in the text is one-half, meaning that as the iteration rounds increase, the initial weight of the positive domain template decreases by half.
[0037] Templates assigned to the negative domain are considered less relevant to user queries and are typically not considered major contributors in the query vector generation process. Templates remaining in the boundary domain after iteration stops are assigned initial weights based on their uncertainty state.
[0038] After initial weight assignments are completed for all templates, the template weights are globally normalized. The normalization process is as follows: first, the sum of the initial weights of all retained templates is calculated; then, the initial weight of each template is divided by this sum to obtain the final dynamic weight of that template. After normalization, the sum of the dynamic weights of all templates is one, thus ensuring the stability and comparability of the subsequent weighted aggregation process.
[0039] Finally, based on the normalized dynamic weights, the vector representations corresponding to each task template are weighted and aggregated. Specifically, the vector representation of each template is multiplied by its corresponding final dynamic weight, and then all weighted template vectors are summed to obtain the final enhanced query embedding vector. This enhanced query embedding vector integrates multi-granularity similarity scoring results and three-way decision weight allocation results, and can more accurately express the intent and entity information in the user query. Example
[0040] This invention has been extensively validated experimentally on multiple publicly available benchmark datasets: 1. We use the publicly available SMPAgent dataset and the public benchmark ATIS dataset, STS series (STS-15, STS-16, STS-B) and SICK-R dataset; 2. Spearman correlation coefficient was used to evaluate embedding quality, which measures the correlation between two variables. Additionally, F1 score and P@n (Top-n accuracy) were used to evaluate the matching performance of the functional API in the Agent task.
[0041] The embedding vectors generated by this invention achieve new state-of-the-art (SOTA) performance on semantic similarity tasks. In the SICK-R benchmark, this invention achieves a Spearman relevance of 81.77, which is 5.31 points higher than the current best LLM-based method, MetaEOL (76.46). On the STS-16 dataset, this invention achieves a Spearman relevance of 85.89, breaking the 85.0 threshold for the first time in an unsupervised method. These results strongly demonstrate that the multi-granularity fusion mechanism of this invention can generate more discriminative, high-quality embedding vectors.
[0042] PLM-based Methods BERT avg. 110M × 60.29 63.73 47.29 58.22 PLM-based Methods BERT prompt 110M × 71.54 68.68 70.6 67.16 PLM-based Methods SimCSE-BERT 110M ✓ 80.91 78.56 76.85 72.23 PLM-based Methods PromptBERT 110M ✓ 84.47 80.6 81.6 69.87 PLM-based Methods ST5-Enc avg. 4.8B × 66.4 70.62 62.83 63.57 LLM-based Methods LLAMA3 avg. 7B × 58.22 56.17 44.3 51.04 LLM-based Methods DeepSeek-R1 avg. 7B × 61.06 60.59 40.06 46.62 LLM-based Methods LLM2Vec 7B ✓ 82.72 81.02 78.32 71.77 LLM-based Methods PromptEOL 7B × 76.75 77.16 72.83 68.94 LLM-based Methods MetaEOL 7B × 81.87 81.47 77.11 76.46 LLM-based Methods 3WDAgent-Cog (Ours) 7B × 84.26 85.89 79.88 81.77 This invention demonstrates particularly outstanding performance in agent tasks. On the SMPAgent and ATIS datasets, the API matching accuracy (P@1) of this invention reaches 83.85 and 88.23, respectively, significantly outperforming existing embedded methods and improving upon the previous best MetaEOL by 7.11 and 11.40 percentage points, respectively. Notably, this invention achieves 91.2% zero-shot API retrieval accuracy on task-oriented dialogue agents without model fine-tuning, surpassing traditional fine-tuning methods and contemporary LLM baseline methods. This indicates that the method of this invention can efficiently solve problems in practical applications without requiring retraining for new features, which is a significant advantage for real-world agent systems that require rapid feature expansion.
[0043] JointBert+CRF 85.5 58.05 97.47 62.14 Bi-model+Attention 97.95 76.21 98.99 82.37 CTRAN 94.06 72.68 98.07 81.01 LLAMA3+ICL 96.25 81.5 99.79 86.45 DeepSeek-671B+ICL 99.99 92.52 99.99 90.06 DeepSeek-R1+ICL 98.99 80.19 99.99 88.04 PromptBert 86.26 72.66 90.9 84.64 MetaEOL 82.37 76.74 89.44 76.83 LLAMA3 avg. 68.53 42.85 62.02 52.15 DeepSeek-R1 avg. 66.2 48.44 64.23 48.37 3WDAgent-Cog (Ours) 91.55 (+9.18) 83.85 (+7.11) 98.75 (+9.31) 88.23 (+11.40) Multi-granularity ensemble ablation studies clearly demonstrate the synergistic effect of ternary fusion. Removing the medium-granularity component results in the most severe performance degradation (13.1–17.7 percentage points) across all datasets, indicating that KL divergence plays a central discriminative role among the three granularities. Even the best-performing single-granularity variant (e.g., using only medium-granularity) only achieves 82.6% of the full model's performance, proving that multi-granularity synergy is the fundamental reason for the framework's superior performance.
[0044] The embodiments of this application have been described above with reference to the accompanying drawings. Unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other. This application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A cognitive enhancement method for task-oriented intelligent agents, characterized in that: Includes the following steps: Step 1: Based on the target task's meta-attributes and application domain, construct a hierarchical multi-granularity task template set in advance. Use a pre-trained vector encoding model to perform vector encoding on the input user query and all multi-granularity task templates to obtain the user query vector and each task template vector. Step 2: Based on the encoded vector, calculate the three types of similarity scores: coarse-grained, medium-grained, and fine-grained. The coarse-grained score uses cosine similarity to represent the overall semantic direction matching degree, the medium-grained score uses KL divergence to represent the text token-level probability distribution shift degree, and the fine-grained score uses RBF kernel function to represent the closeness of local features in high-dimensional space. Step 3: Construct a multi-objective optimization problem using the weights corresponding to the three types of granularity scores as optimization variables, and use the NSGA-III multi-objective optimization algorithm to solve the Pareto optimal solution to obtain the optimal weights corresponding to the three types of granularity scores. Step 4: For each task template, calculate the joint relevance score by combining the three types of granularity scores and the corresponding optimal weights. When calculating, the product of the cosine similarity score and the corresponding optimal weight is used as the positive term, the product of the KL divergence score and the corresponding optimal weight is used as the negative deduction term, and the product of the RBF kernel function score and the corresponding optimal weight is used as the positive term. The results of the three calculations are combined to obtain the joint relevance score of the template. Step 5: Calculate the global screening threshold based on the joint relevance scores of all task templates and the preset significance level; Then, by combining the optimal weight ratio of the three granularity scores, the adaptive thresholds corresponding to coarse granularity, medium granularity, and fine granularity are obtained respectively. Step 6: Initialize the boundary domain set, assign all task templates to the initial boundary domain, and repeat the three-way decision partitioning process until the boundary domain is empty. Based on three types of adaptive thresholds, the templates in the current boundary domain are divided into positive domain, negative domain, and updated boundary domain, respectively. The positive domain templates are effective templates that highly match the semantics of the user query, the negative domain templates are invalid templates that differ too much from the distribution of the user query, and the boundary domain templates are templates to be filtered where the similarity determination is uncertain. Initial weights are assigned based on the iteration round in which the template is included in the positive domain. Templates included in the positive domain earlier are assigned higher initial weights, while templates included in later rounds have their weights reduced by a fixed decay coefficient. Negative domain templates do not participate in subsequent vector aggregation weight allocation. After the loop ends, the remaining boundary domain templates are assigned corresponding initial weights based on their own uncertainties. Step 7: Perform global normalization on the initial weights of all templates participating in the aggregation to obtain the final dynamic weights of each template. Use the normalized dynamic weights to perform a weighted sum aggregation operation on the vectors of all positive domain and retention boundary domain templates to generate an enhanced query embedding vector. Step 8: Use enhanced query embedding vectors to complete API matching retrieval, and call the corresponding tools to complete task-oriented intelligent agent interaction based on the matching results.
2. The cognitive enhancement method for task-oriented intelligent agents according to claim 1, characterized in that, In step 1, the BGE-M3 model is selected as the pre-trained vector encoding model. By prompting the engineering design of multi-granularity task templates, the large language model is guided to generate vector representations with differentiated semantic density.
3. The cognitive enhancement method for task-oriented intelligent agents according to claim 1, characterized in that, In step 2, the coarse-grained cosine similarity is obtained by dividing the inner product of the query vector and the template vector by the product of the norms of the two vectors. Medium-granularity KL divergence is obtained by comparing the templates and querying the difference in the probability distribution of the tokens. The larger the KL divergence value, the greater the difference in the semantic distribution of the two types of text. The fine-grained RBF kernel score is calculated based on the distance in the vector space through a nonlinear exponential mapping. The higher the score, the higher the matching degree between the query and the local features of the template.
4. The cognitive enhancement method for task-oriented intelligent agents according to claim 1, characterized in that, In step 5, the global threshold selection rule is: the proportion of templates whose scores are greater than or equal to the threshold among all joint correlation scores is not less than the minimum value of 1 minus the significance level condition; the three adaptive thresholds are calculated by multiplying the global threshold by the corresponding granularity optimal weight and then dividing by the sum of the weights of the three granularities.
5. The cognitive enhancement method for task-oriented intelligent agents according to claim 1, characterized in that, The three-branch decision partitioning rules are as follows: if the ratio of the coarse-grained similarity score of the boundary domain template to the coarse-grained adaptive threshold is greater than or equal to the global threshold, the template is classified into the positive domain; after excluding the positive domain templates, if the ratio of the medium-grained KL divergence score to the medium-grained adaptive threshold of the remaining templates is greater than or equal to the global threshold, the template is classified into the negative domain; after excluding the positive and negative domain templates, if the ratio of the fine-grained RBF kernel score to the fine-grained adaptive threshold of the remaining templates is greater than or equal to the global threshold, the template is retained for the next round of boundary domain partitioning.
6. The cognitive enhancement method for task-oriented intelligent agents according to claim 1, characterized in that, The fixed attenuation coefficient is halved, and the initial weight of the template is halved for each delayed round when it is included in the positive domain.
7. The cognitive enhancement method for task-oriented intelligent agents according to claim 1, characterized in that, The weight normalization operation in step 7 is as follows: the sum of the initial weights of all templates to be aggregated is calculated, the initial weight of a single template is divided by the sum of the weights to obtain the dynamic weight, and the sum of the dynamic weights of all templates is 1.
8. The cognitive enhancement method for task-oriented intelligent agents according to claim 1, characterized in that, This method does not require fine-tuning of the pre-trained encoding model or the large language model, and directly completes API matching retrieval based on zero-shot method. The performance is evaluated on the semantic similarity evaluation dataset and the task-oriented agent API matching dataset, respectively, using Spearman correlation coefficient, F1 score and Top-n retrieval accuracy.
9. The cognitive enhancement method for task-oriented intelligent agents according to claim 1, characterized in that, The hierarchical multi-granularity task template set covers three semantic representation dimensions: coarse, medium, and fine. In the ablation experiment, removing any one type of granularity scoring module alone would cause a significant drop in retrieval and semantic matching performance. The synergistic fusion of the three types of granularity scoring achieves the optimal embedding representation effect.
10. A task-oriented intelligent agent cognitive enhancement system, characterized in that, The system includes a vector encoding module, a multi-granularity scoring calculation module, a multi-objective optimization module, a joint correlation calculation module, a three-way decision dynamic weight allocation module, a vector weighted aggregation module, and an API matching and calling module; the system executes the cognitive enhancement method for task-oriented intelligent agents as described in any one of claims 1 to 9.