A method for suppressing echoes in intelligent agents and related equipment

By assigning unique identifiers to tool call statements of large language models and performing set comparisons, the problem of repeated execution caused by the agent echo effect is solved, thereby improving the stability and accuracy of agent operation.

CN123068013APending Publication Date: 2026-11-10SHENZHEN PAKRY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611074356.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing intelligent agents are prone to echo effects during execution, leading to operational errors, especially when using text protocols for tool calls. This makes it difficult to accurately distinguish between new and old calls, resulting in resource redundancy and duplicate execution of business processes.

Method used

By assigning a unique identifier to tool call statements in the reasoning content of the large language model, it is determined whether the identifier exists in the set of executed calls. If it exists, an execution prompt is injected; if it does not exist, the execution is performed and the identifier is added to the set, thereby achieving the differentiation and verification of tool call behavior.

Benefits of technology

It effectively solves the problem of repeated execution caused by the echo effect, improves the stability and accuracy of the agent's operation, and ensures the deterministic logic judgment in the tool invocation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123068013A_ABST
    Figure CN123068013A_ABST
Patent Text Reader

Abstract

This application discloses an echo suppression method for intelligent agents, comprising: acquiring the inference content of a large language model; determining whether a tool call statement exists in the inference content; if a tool call statement exists, assigning a unique identifier to the tool call statement, with different tool call statements corresponding to different unique identifiers; before executing the tool call statement, determining whether a unique identifier exists in the set of executed calls; if a unique identifier exists in the set of executed calls, injecting an execution prompt into the large language model; if a unique identifier does not exist in the set of executed calls, executing the tool call statement and adding the unique identifier to the set of executed calls. This solution, by configuring a unique identifier for each tool call and by comparing and verifying the set of executed calls, enables the system to directly determine the execution status of the current call using deterministic logic, thereby allowing the intelligent agent to distinguish between new and old calls, thus solving the echo problem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence, and in particular relates to an echo suppression method for intelligent agents and related equipment. Background Technology

[0002] This invention relates to the field of artificial intelligence agent technology, specifically to a reasoning-action collaborative paradigm agent based on a large language model.

[0003] The reasoning-action architecture, through a "reasoning-action-observation" cycle, is an architectural paradigm that allows large language models to solve problems by using this cycle. Its workflow includes: Reasoning: LLM (Large Language Model) analyzes the current state and determines whether it is necessary to call external tools to obtain information; Acting: The LLM outputs structured tool invocation instructions, and the system executes the corresponding tools; Observation: The tool returns the results to the LLM, which then uses the results to continue reasoning or provide a final answer; When calling tools, their implementation protocols are mainly divided into two categories: one is the native dedicated tool call API of the model vendor, which depends on the vendor's underlying support and has limited universality; the other is the text protocol, which embeds custom tool call syntax in the text output of large language models, which can be adapted to various large models and has strong controllability at the application layer.

[0004] When using text-based protocols, tool call syntax text stored in historical dialogues is repeatedly input into the model along with the context. For the model, when this tool call syntax text is input as a thought conclusion, it easily causes the agent to repeatedly execute the same text call syntax, leading to distorted output format, redundant and bloated context, excessive consumption of vocabulary, interference with reasoning logic, and even causing the agent to fall into an infinite loop. Overall, current technologies have not yet formed an effective solution at the application layer that can accurately distinguish between new and old calls and adapt to large models across all categories. Summary of the Invention

[0005] The purpose of this invention is to provide an echo suppression method for intelligent agents, aiming to solve the problem that existing intelligent agents are prone to generating echoes during execution, leading to operational errors. The intelligent agent echo suppression method provided in this application includes: the method is applied to an intelligent agent in a reasoning-action collaborative paradigm based on a large language model, comprising: Obtain the reasoning content of the large language model; Determine whether there is a tool call statement in the reasoning content, wherein the tool call statement is a call statement using a text call protocol; If the tool call statement exists, a unique identifier is assigned to the tool call statement, and different tool call statements correspond to different unique identifiers; Before executing the tool call statement, determine whether the unique identifier exists in the already executed call set; If the unique identifier exists in the executed call set, then inject the executed prompt into the large language model; If the unique identifier does not exist in the set of executed calls, then the tool call statement is executed, and the unique identifier is added to the set of executed calls.

[0006] Based on the intelligent agent echo suppression method provided in the first aspect of the embodiments of this application, optionally, the method of assigning a unique identifier to the tool invocation statement is a pre-generation method; The pre-generation method includes: the large language model generates multiple unique identifiers when entering a task; Select one unassigned unique identifier from the plurality of unique identifiers as the unique identifier corresponding to the tool invocation statement.

[0007] Based on the intelligent agent echo suppression method provided in the first aspect of the embodiments of this application, optionally, the method of assigning a unique identifier to the tool invocation statement is a self-generated method; The self-generation method includes: the large language model generating a unique identifier based on the tool call statement.

[0008] Based on the agent echo suppression method provided in the first aspect of the embodiments of this application, optionally, there is a one-to-one correspondence between the executed call set and the tasks executed by the agent.

[0009] Optionally, based on the agent echo suppression method provided in the first aspect of the embodiments of this application, the method further includes: The category of the large language model is determined based on its parameters, either as a strong model or a production model. The unique identifier allocation method is determined based on the categories of the large language model.

[0010] Based on the agent echo suppression method provided in the first aspect of the embodiments of this application, optionally, the method by which the large language model assigns unique identifiers to tool call statements is a self-generated method. Determine whether there is an echo based on the performance of the large model; If an echo occurs, the method of assigning unique identifiers to tool call statements using the large language model will be switched to a pre-generated method.

[0011] Based on the agent echo suppression method provided in the first aspect of the embodiments of this application, optionally, the step of determining whether echo exists based on the performance of a large model includes: If the unique identifier of the tool call statement to be executed is detected to already exist in the set of executed calls, and the call parameters and tool type of the current tool call statement are consistent with the historically executed tool call records, then it is determined that there is an echo.

[0012] A second aspect of this application provides an agent echo suppression device, the device being used to run an agent operating a reasoning-action collaborative paradigm based on a large language model, comprising: The acquisition unit is used to acquire the reasoning content of the large language model; The first judgment unit is used to determine whether there is a tool call statement in the reasoning content, wherein the tool call statement is a call statement using a text call protocol; The allocation unit is used to assign a unique identifier to the tool call statement if the tool call statement exists, with different tool call statements corresponding to different unique identifiers; The second judgment unit is used to determine whether the unique identifier exists in the already executed call set before executing the tool call statement; The prompting unit is used to inject an execution prompt into the large language model if the unique identifier exists in the executed call set; An execution unit is configured to execute the tool call statement and add the unique identifier to the set of executed calls if the unique identifier does not exist in the set of executed calls.

[0013] Based on the intelligent agent echo suppression device provided in the second aspect of the embodiments of this application, optionally, the method of assigning a unique identifier to the tool invocation statement is a pre-generation method; The pre-generation method includes: the large language model generates multiple unique identifiers when entering a task; Select one unassigned unique identifier from the plurality of unique identifiers as the unique identifier corresponding to the tool invocation statement.

[0014] Based on the intelligent agent echo suppression device provided in the second aspect of the embodiments of this application, optionally, the method of assigning a unique identifier to the tool invocation statement is a self-generated method; The self-generation method includes: the large language model generating a unique identifier based on the tool call statement.

[0015] Based on the agent echo suppression device provided in the second aspect of the embodiments of this application, optionally, there is a one-to-one correspondence between the executed call set and the tasks executed by the agent.

[0016] Based on the intelligent agent echo suppression device provided in the second aspect of the embodiments of this application, optionally, the device further includes a determining unit, configured to: The category of the large language model is determined based on its parameters, either as a strong model or a production model. The unique identifier allocation method is determined based on the categories of the large language model.

[0017] Based on the intelligent agent echo suppression device provided in the second aspect of the embodiments of this application, optionally, the method by which the large language model assigns a unique identifier to the tool call statement is a self-generated method; The device further includes: a switching unit, used to: determine whether there is an echo based on the performance of the large model; If an echo occurs, the method of assigning unique identifiers to tool call statements using the large language model will be switched to a pre-generated method.

[0018] Based on the agent echo suppression method provided in the second aspect of the embodiments of this application, optionally, the step of determining whether echo exists based on the performance of a large model includes: If the unique identifier of the tool call statement to be executed is detected to already exist in the set of executed calls, and the call parameters and tool type of the current tool call statement are consistent with the historically executed tool call records, then it is determined that there is an echo.

[0019] A third aspect of this application provides an intelligent agent echo suppression device, comprising: Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory on the device to perform the method described in any one of the first aspects of the embodiments of this application.

[0020] A fourth aspect of this application provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method as described in any one of the first aspects of this application.

[0021] The fifth aspect of this application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in any one of the first aspects of this application.

[0022] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: This application provides an agent echo suppression method applied to an agent in a reasoning action collaborative paradigm based on a large language model, including: obtaining the reasoning content of the large language model; determining whether there is a tool call statement in the reasoning content; the tool call statement is a call statement using a text call protocol; if the tool call statement exists, assigning a unique identifier to the tool call statement, with different tool call statements corresponding to different unique identifiers; before executing the tool call statement, determining whether the unique identifier exists in the set of executed calls; if the unique identifier exists in the set of executed calls, injecting an execution prompt into the large language model; if the unique identifier does not exist in the set of executed calls, executing the tool call statement and adding the unique identifier to the set of executed calls. This solution, by configuring a unique identifier for each tool call; and by comparing and verifying the set of executed calls, allows the system to directly determine the execution status of the current call using deterministic logic, thereby enabling the agent to distinguish between new and old calls, thus solving the echo problem. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort. It is understood that the drawings provided in this section are only for better understanding of this solution and do not constitute a limitation on this application.

[0024] Figure 1 A flowchart illustrating an embodiment of the intelligent agent echo suppression method provided in this application; Figure 2 Another flowchart illustrating an embodiment of the intelligent agent echo suppression method provided in this application; Figure 3 A schematic diagram of a structural embodiment of the intelligent agent echo suppression device provided in this application; Figure 4 Another structural schematic diagram of an embodiment of the intelligent agent echo suppression device provided in this application; Detailed Implementation To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application are clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application. At the same time, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0025] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] Before introducing this plan, it is necessary to briefly introduce some of the concepts involved: Intelligent Agent: The intelligent agent is an intelligent execution entity built on LLM, possessing autonomous task decomposition, tool invocation, logical reasoning, and dialogue interaction capabilities. Relying on the natural language understanding and generation capabilities of a large language model, and combined with a custom tool invocation protocol, this intelligent agent can automatically invoke corresponding functional tools according to user task requirements, complete iterative task execution, and handle dialogue context logic, thereby achieving automated and intelligent processing of various business scenarios. It is the core execution carrier of the technical solution in this application.

[0027] Text protocol for calling tools: Predefined tool calling syntax is embedded in the text output of LLM. Pre-defined standardized tool calling syntax instructions are embedded. The upper-level application system uses general text processing methods such as regular expressions and text parsing algorithms to identify, extract and parse the instruction information, parameter information and execution requirements of the tool call, and complete the triggering and calling of the tool.

[0028] Echo: When using text protocols for tool invocation, the mixed content output by the large language model in a single instance (containing natural language inference text and standardized tool invocation syntax instructions) is stored in the dialogue history context. During the thinking process, the text protocol invocation statement and its execution result may be synchronously input into the agent's next round of thinking. When initiating the next round of large language model invocation and performing context iterative inference, the mixed text carrying the historical tool invocation syntax will be input into the large language model again, causing the large language model to repeatedly execute the text protocol invocation statement that has already been executed. This cycle repeats, leading to a series of technical anomalies, which are defined as the echo effect. Furthermore, the problems caused by the echo effect include: the large language model cannot accurately distinguish between historically executed tool invocation instructions and newly pending tool invocation instructions in the dialogue history, and may easily misidentify historically retained tool invocation syntax as new invocation instructions, thus triggering repeated invocations of the same tool, resulting in resource redundancy and duplicate execution of business processes.

[0029] To resolve the echo problem, please refer to [link / reference]. Figure 1 An embodiment of the intelligent agent echo suppression method provided in this application includes steps 101-105.

[0030] This solution is applied to a reasoning-action collaborative paradigm intelligent agent based on a large language model (LLM). The LLM operates in a cyclical mode, alternating between reasoning and external tool invocation. The model first infers and determines whether a tool needs to be invoked, outputs the tool command, and then continues reasoning after receiving the tool's return result. The specific steps of the method include: 101. Obtain the reasoning content of the large language model.

[0031] Specifically, this step involves collecting the complete text content output by the large language model in this round of inference iteration. This inference content is the output data generated by the large language model after semantic understanding and logical deduction based on the historical dialogue context and the user's current input command. This step does not limit the specific form, length, or composition of the inference content. The inference content can contain only natural language dialogue text, or it can contain a mixture of natural language inference text and tool call commands. At the same time, there are no restrictions on the model type, parameter specifications, or deployment method of the large language model; it can be any general-purpose large language model with text inference output capabilities.

[0032] 102. Determine whether there are tool call statements in the reasoning content.

[0033] The process involves determining whether the inference content contains tool call statements, which are call statements using a text call protocol. After acquiring the inference content from the large language model, the inference content is retrieved and identified using preset text parsing rules, regular expression matching algorithms, and other algorithms to determine whether the text contains tool call statements conforming to the preset text call protocol format. The text call protocol is a standardized text tool call format defined in this application, which can predefine specifications such as instruction start identifiers, parameter formats, and end identifiers. This step does not limit the specific parsing or matching algorithm type; any text recognition method such as regular expression matching, semantic parsing, or keyword retrieval can be selected according to the business scenario. Furthermore, it does not limit the specific number of tool call statements, the specific type of tool being called, or the parameter content, and can adapt to scenarios involving the recognition of single or multiple tool call statements of different types.

[0034] 103. Assign a unique identifier to the tool call statement.

[0035] If a tool call statement exists, a unique identifier is assigned to it, with different tool call statements corresponding to different unique identifiers. When a compliant text protocol tool call statement is detected in the inference content, a unique identifier is independently assigned to each tool call statement. This unique identifier is used to uniquely mark a single tool call behavior, enabling the differentiation and verification of tool call statements. The unique identifier can be any encoding method that can achieve uniqueness, such as a timestamp, random string, hash value, or sequence code. This step does not limit the generation rules, encoding format, or length specifications of the unique identifier, as long as it ensures that different tool call statements correspond to different unique identifiers and that the corresponding identifier can be reused when the same tool call statement is repeatedly identified. The timing of identifier allocation is not limited; it can be allocated immediately after the tool call statement is identified or in batches during the tool call preprocessing stage. The allocation process can occur before the text protocol tool is executed. Text protocol tool call statements that have already been assigned are not reassigned. If no tool call statement exists, normal intelligent agent inference operations can be performed; specific details are not limited here.

[0036] 104. Before executing the tool call statement, determine whether the unique identifier exists in the already executed call set.

[0037] The executed call set is established based on the tasks performed by the agent. This set stores the unique identifiers of all completed tool call statements within the current dialogue cycle, serving as the basis for duplicate tool call verification. Before executing the call operation on the current tool call statement, the unique identifier of the current tool call statement is compared and verified against all identifiers in the executed call set. This step does not limit the storage format of the executed call set; any storage structure such as arrays, database caches, in-memory sets, and hash tables can be used. The data clearing rules for the set are also not limited; they can be flexibly cleared and updated based on dialogue rounds, session cycles, and timing strategies.

[0038] 105. Inject the executed hint into the large language model.

[0039] Specifically, if the unique identifier exists in the set of executed calls, an executed prompt is injected into the large language model. If the identifier comparison results are identical, it proves that the tool call statement to be parsed is a duplicate instruction that has already been executed in the past, which is an invalid call instruction caused by the echo effect. At this time, the tool call statement is not executed, and the executed prompt information is injected into the context input port of the large language model. The prompt content is used to inform the large language model that the tool instruction has been executed and does not need to be called again. For example, the injected prompt is: "Executed call ID: c8a2, continue reasoning or give the final answer" or "This call has been executed, continue reasoning based on the existing information", etc. This guides the model to avoid secondary parsing and secondary call behavior. This step does not limit the text format, content form, or injection position of the executed prompt. The prompt wording and prompt weight can be customized. At the same time, there is no limit to the specific timing of the prompt injection. It can be injected before the current round of model reasoning or embedded in the current dialogue context in real time.

[0040] 106. Execute the tool call statement and add the unique identifier to the set of executed calls.

[0041] Specifically, if the unique identifier does not exist in the executed call set, the tool call statement is executed, and the unique identifier is added to the executed call set. If the identifier comparison result is non-overlapping, it proves that the current tool call statement is a brand new, unexecuted, and valid call instruction with legitimate execution permissions. At this time, the instruction parameters and call object of the tool call statement are parsed normally, the corresponding tool call execution operation is completed, and the unique identifier corresponding to the tool call statement is synchronously written into the executed call set for subsequent rounds of duplicate verification. There are no restrictions on the writing method or timing of the unique identifier; it can be written synchronously or asynchronously, as long as subsequent verification can identify it correctly.

[0042] Through the verification mechanism of the above steps, the problems of repeated tool execution, format confusion and model inference interference caused by the echo effect can be avoided, the infinite loop operation defect of the agent can be broken, and the operation stability and accuracy of the agent under the text protocol tool call architecture can be greatly improved. Based on the above embodiments, a specific embodiment can be provided: insurance product consultation scenario (Mode A: system pre-filling) User question: "Help me compare the critical illness insurance coverage liabilities of Super Mary and Ping An Fu" Execution process: Step1: System preparation → Generate candidate IDs: [c8a2, d4e5, f6g7] → Inject Prompt: "Available call IDs: c8a2, d4e5, f6g7" Step2: LLM decision-making → Output: "I will help you inquire about these two products. [tooling:c8a2]kdb_search({"query":"Super Mary critical illness", "baseid":7})" Step3: The system checks that c8a2 is not in _executed_call_ids → new call → execute kdb_search → return product A information → record c8a2 Step4: LLM continues → Output: "[tooling:d4e5]kdb_search({"query":"Ping An Fu critical illness", "baseid":7})" Step5: The system checks that d4e5 is not in _executed_call_ids → new call → execute kdb_search → return product B information → record d4e5 Step6: LLM outputs echo → "I will confirm again. [tooling:c8a2]kdb_search({...})" → The system checks that c8a2 is in _executed_call_ids → Echo detected! Step7: Inject guidance prompt → "c8a2 has been executed. Please check the Observation to continue reasoning..." Step8: LLM based on existing data → "Based on the existing data, the comparison of the two products is as follows..." → Task completed, no repeated execution.

[0043] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: This application provides an agent echo suppression method applied to an agent in a reasoning action collaborative paradigm based on a large language model, including: obtaining the reasoning content of the large language model; determining whether there is a tool call statement in the reasoning content; the tool call statement is a call statement using a text call protocol; if the tool call statement exists, assigning a unique identifier to the tool call statement, with different tool call statements corresponding to different unique identifiers; before executing the tool call statement, determining whether the unique identifier exists in the set of executed calls; if the unique identifier exists in the set of executed calls, injecting an execution prompt into the large language model; if the unique identifier does not exist in the set of executed calls, executing the tool call statement and adding the unique identifier to the set of executed calls. This solution, by configuring a unique identifier for each tool call; and by comparing and verifying the set of executed calls, allows the system to directly determine the execution status of the current call using deterministic logic, thereby enabling the agent to distinguish between new and old calls, thus solving the echo problem.

[0044] The method of identifier allocation needs further explanation in this scheme. Specifically, the explanation can be divided into two types: (1) The method of assigning a unique identifier to the tool call statement is a pre-generated method; The pre-generation method includes: the large language model generates multiple unique identifiers when entering a task; Select one unassigned unique identifier from the plurality of unique identifiers as the unique identifier corresponding to the tool invocation statement.

[0045] The pre-generation method proposed in this application involves the system generating multiple candidate unique identifiers in advance. This passive identifier allocation mechanism is applicable to various large language models, especially production-level large language models with low performance and weak reasoning capabilities. The core principle of this method is as follows: Before each triggering of tool call reasoning in the large language model, a candidate list of unique identifiers is pre-generated at the system level. This list contains a certain number of unique identifiers and is actively injected into the dialogue context and prompts of the large language model. When the large language model outputs reasoning content carrying tool call syntax, it can only select unused unique identifiers from the candidate identifier list provided by the system as the unique identifier (call_id) corresponding to the current tool call statement, thus avoiding the defects caused by the model's self-generated identifiers.

[0046] In a specific exemplary implementation scenario, the system can use algorithms such as secrets.token_hex(4) to generate candidate unique identifiers in a fixed format. The generated identifiers can be presented as hexadecimal characters such as "c8a2b3c4". This application does not limit the generation algorithm, character format, or character length of the unique identifiers, and the generation logic can be flexibly replaced according to the business security level and log tracking requirements; at the same time, it does not limit the number of candidate identifiers generated in a single time. For example, the default is to generate 3 candidate IDs to form a candidate list in a single time, which can be increased or decreased as needed. After the system completes the generation of the candidate identifier list, on the one hand, the candidate identifier field is written into the prompt word to clearly indicate that the large language model can only use the identifiers in the list for tool calls; on the other hand, the generated candidate IDs are cached locally to provide data basis for subsequent echo detection and duplicate verification.

[0047] Compared to the model-generated identifier method, this pre-generation method has several outstanding technical advantages: First, the format is completely controllable. The format, length, and generation rules of the unique identifier are all uniformly defined and controlled by the system application layer, and are not affected by the output capability or inference bias of the large language model. Second, it has strong adaptability to weak models. The large language model does not need to have the ability to generate identifiers or perform encoding inference. Even low-performance large language models with weak inference capabilities can accurately select pre-filled identifiers to complete tool calls, resulting in wider adaptability. Third, it has high debuggability. The unique identifiers corresponding to all tool calls are uniformly generated, cached, and archived by the system, which facilitates subsequent log tracing, problem investigation, and process data analysis, greatly improving the system's maintainability.

[0048] (2) The method of assigning a unique identifier to the tool call statement is a self-generated method.

[0049] The self-generation method includes: the large language model generating a unique identifier based on the tool call statement.

[0050] The self-generation method proposed in this application is an identifier allocation mechanism that autonomously generates identifiers for large language models and performs system-wide verification and deduplication. It is suitable for high-performance, high-reasoning-capability large language models. The core principle of this method is as follows: the system does not need to inject any pre-generated candidate unique identifier list into the large language model. Instead, it standardizes the output format of the large language model through system prompts. During the generation of tool call statements, the large language model autonomously generates a unique random identifier for each tool call statement. The system extracts the autonomously generated identifier through text parsing and regular expression matching, and combines it with the set of executed calls to complete duplicate verification and deduplication, achieving unique traceability of tool call behavior.

[0051] In a specific exemplary implementation scenario, the system pre-defines a standardized tool call output format in SystemPrompt, guiding the large language model to strictly output tool call content according to the fixed format of "[tooling:<random ID>]tool name({parameters})". Here, <random ID> is a short, unique identifier generated autonomously by the large language model, which can be, for example, a combination of random characters such as "c8a2b3" or "d4e5f6". This application does not limit the character length, encoding format, or generation rules of the self-generated identifier, only requiring that the identifier be unique for a single call; it also does not limit the specific expression form, prompt weight, or injection position of the Prompt prompt words, and can adaptively adjust the prompt logic according to the model characteristics. After obtaining the inference output of the large language model, the system accurately extracts the call_id, tool name, and call parameters from the output content using preset regular expressions, completing the structured parsing and recognition of the tool call statement.

[0052] Compared to the system's pre-generated method, the self-generated method results in a more natural and fluent dialogue, without the need to inject an additional candidate ID list before each round of reasoning, and without interfering with the native reasoning logic and dialogue output effect of the large language model.

[0053] This application further sets up a preferred embodiment for identifier allocation, which uses a unique identifier allocation method based on the category differentiation of a large language model and supports dynamic switching of operating modes, thereby further improving the adaptability and anti-echo capability of the solution. The specific technical solution is as follows: 201. Based on the parameters of the large language model, determine whether the large language model is a strong model category or a production model category.

[0054] Specifically, based on core model parameters such as model size, inference accuracy, contextual understanding capability, output stability, and parameter scale, model category determination rules can be established to classify the large language models currently participating in tool inference into either the strong model category or the production model category. This step does not limit the specific category determination threshold and dimensions; they can be determined based on the actual business scenario, customized criteria, or the user's selection of the large language model's category.

[0055] 202. Determine the unique identifier allocation method based on the categories of the large language model.

[0056] This application configures differentiated unique identifier generation logic for large language models with different performance categories to achieve identifier allocation adaptation. If the current large language model is determined to be a production model category, this type of model generally has the characteristics of limited reasoning ability, weak instruction following stability, and easy output format disorder. Adaptation (1) pre-generation method to complete the unique identifier allocation of tool call statements, and avoid various abnormal problems caused by weak models autonomously generating identifiers by the system's pre-control of identifier resources.

[0057] If the current large language model is determined to be a strong model, this type of model has the characteristics of high inference accuracy, stable instruction compliance, and strong autonomous output standardization. It adapts to (2) the self-generation method to complete the unique identifier allocation of the tool call statement, and maximizes the tool call efficiency on the basis of ensuring that the identifier is unique and verifiable and has no echo anomaly.

[0058] Furthermore, in this application, the executed call set and the task currently being executed by the agent have a one-to-one binding relationship. That is, each independent task corresponds to a dedicated executed call set, and the unique identification data between different tasks are isolated from each other and do not interfere with each other. This mechanism does not limit the binding form between tasks and sets, and can be associated and bound through task IDs and session IDs. At the same time, it does not limit the life cycle of the set, which can be created when the task starts and destroyed when the task ends, ensuring the accuracy and independence of identification verification in multi-task parallel scenarios.

[0059] Furthermore, this solution also includes an adaptive switching mode, specifically including: The large language model assigns unique identifiers to tool call statements in a self-generated manner. Determine whether there is an echo based on the performance of the large model; If an echo occurs, the method of assigning unique identifiers to tool call statements using the large language model will be switched to a pre-generated method.

[0060] The default configuration prioritizes the self-generated method for assigning unique identifiers to tool call statements in the large language model category. Simultaneously, the system can dynamically detect echo-related anomalies in the current session and task based on the large language model's performance and tool call log data. Echo-related issues can include duplicate tool calls, incorrect identifier verification, model inference interference, and circular calls. This step does not limit the criteria for determining echo-related issues or the detection cycle; real-time monitoring, polling monitoring, or post-event review detection are all possible.

[0061] In actual implementation, it can be detected whether the number of times the tool call statement is executed in a single dialogue is greater than a preset value; if the number of times the tool call statement is executed is greater than the preset value, it is determined that there is an echo.

[0062] During implementation, the number of preset values ​​depends on the model's capabilities and the complexity of the problem. For large language models with strong model categories, strong inference capabilities, and high instruction stability, the tool call iteration efficiency for normal tasks is high, and there is little invalid inference. A relatively small preset threshold can be set to quickly identify abnormal model loops and intercept echo stuttering issues in advance. For large language models with weaker production model categories, weaker inference capabilities, and more task decomposition iteration steps, combined with the characteristic of requiring more tool call rounds for normal tasks, a relatively larger preset threshold can be configured to avoid misjudgments caused by multiple rounds of normal model iteration and ensure the smooth execution of normal complex tasks.

[0063] If monitoring determines that echoes exist during the current large language model's operation, a mechanism for switching the allocation method is triggered. This dynamically switches the unique identifier allocation method of the current large language model from the default self-generation method to a pre-generation method, further improving the stability of the overall tool call process. This step does not limit the trigger threshold or the timing of the mode switch; it can be done immediately or after the next task starts. Furthermore, there is no limit to the duration of the switch; it can be a permanent switch, a temporary switch, or a conditional revert.

[0064] The foregoing has described the method provided in this application. To support the implementation of the above embodiments, this application also provides an intelligent agent echo suppression device. Please refer to [link to relevant documentation]. Figure 3 One embodiment of the intelligent agent echo suppression device of this application includes: A second aspect of this application provides an agent echo suppression device, the device being used to run an agent operating a reasoning-action collaborative paradigm based on a large language model, comprising: Acquisition unit 301 is used to acquire the reasoning content of the large language model; The first judgment unit 302 is used to determine whether there is a tool call statement in the reasoning content, wherein the tool call statement is a call statement using a text call protocol; The allocation unit 303 is used to assign a unique identifier to the tool call statement if the tool call statement exists, and different tool call statements correspond to different unique identifiers. The second judgment unit 304 is used to determine whether the unique identifier exists in the already executed call set before executing the tool call statement; The prompting unit 305 is used to inject an execution prompt into the large language model if the unique identifier exists in the executed call set; The execution unit 306 is configured to execute the tool call statement and add the unique identifier to the executed call set if the unique identifier does not exist in the executed call set.

[0065] Optionally, the method for assigning unique identifiers to tool invocation statements is a pre-generated method; The pre-generation method includes: the large language model generates multiple unique identifiers when entering a task; Select one unassigned unique identifier from the plurality of unique identifiers as the unique identifier corresponding to the tool invocation statement.

[0066] Optionally, the method for assigning a unique identifier to the tool invocation statement is a self-generated method; The self-generation method includes: the large language model generating a unique identifier based on the tool call statement.

[0067] Optionally, there is a one-to-one correspondence between the set of executed calls and the tasks performed by the agent.

[0068] Optionally, the device further includes a determining unit, configured to: The category of the large language model is determined based on its parameters, either as a strong model or a production model. The unique identifier allocation method is determined based on the categories of the large language model.

[0069] Optionally, the large language model assigns unique identifiers to tool call statements in a self-generated manner; The device further includes: a switching unit, used to: determine whether there is an echo based on the performance of the large model; If an echo occurs, the method of assigning unique identifiers to tool call statements using the large language model will be switched to a pre-generated method.

[0070] Optionally, the determination of whether echo exists based on the performance of a large model includes: If the unique identifier of the tool call statement to be executed is detected to already exist in the set of executed calls, and the call parameters and tool type of the current tool call statement are consistent with the historically executed tool call records, then it is determined that there is an echo.

[0071] In this embodiment, the process executed by each unit is the same as described above. Figure 1 The method flow described in the corresponding embodiments is similar and will not be repeated here.

[0072] Figure 4 This is a schematic diagram of the structure of an intelligent agent echo suppression device provided in an embodiment of this application. The server 400 may include one or more central processing units (CPUs) 401 and a memory 405, in which one or more applications or data are stored.

[0073] In this embodiment, the specific functional module division in the central processing unit 401 can be the same as described above. Figure 3 The functional module division of each unit described in the text is similar, so it will not be repeated here.

[0074] The memory 405 can be volatile or persistent storage. The program stored in the memory 405 can include one or more modules, each module including a series of instruction operations on the server. Furthermore, the central processing unit 401 can be configured to communicate with the memory 405 and execute the series of instruction operations stored in the memory 405 on the server 400.

[0075] Server 400 may also include one or more power supplies 402, one or more wired or wireless network interfaces 403, one or more input / output interfaces 404, and / or one or more operating systems. The central processing unit 401 can execute the aforementioned... Figure 1 The specific operations performed by the agent echo suppression method in the illustrated embodiment will not be described in detail here.

[0076] This application also provides a computer storage medium for storing computer software instructions used for the above-described agent echo suppression method, including programs designed for executing the agent echo suppression method.

[0077] The agent-based echo suppression method can be described as described above. Figure 1 The agent echo suppression method described in the paper.

[0078] This application also provides a computer program product, which includes computer software instructions that can be loaded by a processor to implement the above-described functionality. Figure 1 Figure 2 The flowchart of an agent echo suppression method for any one of the following.

[0079] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, equivalent circuit transformations and unit divisions are only logical functional divisions. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connections shown or discussed may be through some interfaces, or indirect coupling or communication connections between apparatuses or units, and may be electrical, mechanical, or other forms.

[0080] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0081] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0082] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for suppressing echoes in an intelligent agent, characterized in that, The method is applied to a reasoning-action collaborative paradigm intelligent agent based on a large language model, including: Obtain the reasoning content of a large language model; Determine whether there is a tool call statement in the reasoning content, wherein the tool call statement is a call statement using a text call protocol; If the tool call statement exists, a unique identifier is assigned to the tool call statement, and different tool call statements correspond to different unique identifiers; Before executing the tool call statement, determine whether the unique identifier exists in the already executed call set; If the unique identifier exists in the executed call set, then inject the executed prompt into the large language model; If the unique identifier does not exist in the set of executed calls, then the tool call statement is executed, and the unique identifier is added to the set of executed calls.

2. The intelligent agent echo suppression method according to claim 1, characterized in that, The method for assigning unique identifiers to tool call statements is a pre-generated method; The pre-generation method includes: the large language model generates multiple unique identifiers when entering a task; Select one unassigned unique identifier from the plurality of unique identifiers as the unique identifier corresponding to the tool invocation statement.

3. The agent echo suppression method according to claim 1, characterized in that, The method for assigning unique identifiers to tool call statements is a self-generated method; The self-generation method includes: the large language model generating a unique identifier based on the tool call statement.

4. The agent echo suppression method according to claim 1, characterized in that, There is a one-to-one correspondence between the set of executed calls and the tasks performed by the agent.

5. The intelligent agent echo suppression method according to claim 1, characterized in that, The method further includes: The category of the large language model is determined based on its parameters, either as a strong model or a production model. The unique identifier allocation method is determined based on the categories of the large language model.

6. The intelligent agent echo suppression method according to claim 1, characterized in that, The large language model assigns unique identifiers to tool call statements in a self-generated manner. The method further includes: determining whether an echo exists based on the performance of a large language model; If an echo occurs, the method of assigning unique identifiers to tool call statements using the large language model will be switched to a pre-generated method.

7. The intelligent agent echo suppression method according to claim 6, characterized in that, The determination of whether echo exists based on the performance of a large model includes: Detect whether the number of times the tool call statement is executed in a single dialogue exceeds a preset value; If the number of times the tool call statement is executed exceeds a preset value, then an echo is considered to exist.

8. An intelligent agent echo suppression device, characterized in that, The device is used to run a reasoning-action collaborative paradigm intelligent agent based on a large language model, including: The acquisition unit is used to acquire the reasoning content of the large language model; The first judgment unit is used to determine whether there is a tool call statement in the reasoning content, wherein the tool call statement is a call statement using a text call protocol; The allocation unit is used to assign a unique identifier to the tool call statement if the tool call statement exists, with different tool call statements corresponding to different unique identifiers; The second judgment unit is used to determine whether the unique identifier exists in the already executed call set before executing the tool call statement; The prompting unit is used to inject an execution prompt into the large language model if the unique identifier exists in the executed call set; An execution unit is configured to execute the tool call statement and add the unique identifier to the set of executed calls if the unique identifier does not exist in the set of executed calls.

9. An intelligent agent echo suppression device, characterized in that, include: Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory on the device to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Includes instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 7.