Intelligent agent capability evolution method and electronic equipment
By analyzing the historical task trajectories of intelligent agents to generate candidate tasks and standards, and by updating the experience base and tool library with similar experiences and tools, the problem of limited evolution of intelligent agent capabilities is solved, and the continuous evolution of intelligent agent capabilities and improvement of task execution efficiency are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-16
- Publication Date
- 2026-04-14
AI Technical Summary
Existing intelligent agents require tedious reasoning and generation when performing new tasks, and historical task records cannot effectively guide their ability evolution.
By acquiring the trajectory library, experience library, and tool library formed by the agent's historical task execution, the historical trajectory is analyzed to generate candidate tasks and task criteria. Candidate inference trajectories are generated using similar experiences and tools, and the experience and tool library are updated based on successful and failed trajectories.
It enables the continuous evolution of the agent's capabilities, without relying on manually constructed datasets, and automatically updates and iterates the experience and tools in the capability library, thereby improving the agent's task execution efficiency.
Smart Images

Figure CN121859943A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to a method for the ability evolution of an intelligent agent and an electronic device. Background Technology
[0002] With the development of artificial intelligence technology, intelligent agents, as systems capable of autonomously perceiving the environment, planning tasks, and executing them, have been widely used in many fields.
[0003] Currently, intelligent agents can store historical task records in a database and retrieve similar records as a reference when executing new tasks. This method can only tell the agent how it was done before. The agent still needs to perform tedious reasoning and generation. Historical task records cannot better guide the agent to execute new tasks, which limits the evolution of the agent's capabilities. Summary of the Invention
[0004] To address the aforementioned problems, the present invention aims to provide a method and electronic device for the capability evolution of an intelligent agent, which can extract reusable experiences and tools from the historical trajectory of historical tasks, realize continuous updates of data in the experience library and tool library, and ensure the sustainable evolution of the intelligent agent's capabilities.
[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: On one hand, the present invention provides a method for the capability evolution of an intelligent agent, comprising: A capability library is obtained by the intelligent agent executing historical tasks. The capability library includes a trajectory library, an experience library, and a tool library. The historical experience in the experience library is obtained by analyzing the historical trajectories in the trajectory library. Multiple candidate tasks are generated based on the historical trajectory of the seed task, and the task criteria corresponding to each candidate task are also generated. The seed task is one of the historical tasks. Based on similar experiences and candidate tools for the candidate tasks, candidate inference trajectories for the candidate tasks are generated, wherein the similar experiences are determined from the experience base and the candidate tools are determined from the tool base. Based on the task criteria corresponding to the candidate tasks, successful and failed trajectories are determined from the candidate inference trajectories. The experience base and the tool base are updated based on the success trajectory and the failure trajectory.
[0006] On the other hand, the present invention also provides a device for the capability evolution of an intelligent agent, comprising: The acquisition module is used to acquire the capability library formed by the agent in executing historical tasks. The capability library includes a trajectory library, an experience library, and a tool library. The historical experience in the experience library is obtained by analyzing the historical trajectories in the trajectory library. The task generation module is used to generate multiple candidate tasks based on the historical trajectory of the seed task, and the task criteria corresponding to each candidate task, wherein the seed task is one of the historical tasks; The trajectory generation module is used to generate candidate inference trajectories for the candidate tasks based on similar experiences and candidate tools. The similar experiences are determined from the experience base, and the candidate tools are determined from the tool base. The trajectory determination module is used to determine the successful trajectory and the failed trajectory from the candidate inference trajectory based on the task criteria corresponding to the candidate task; The update module is used to update the experience base and the tool base based on the success trajectory and the failure trajectory.
[0007] On the other hand, the present invention also provides an electronic device including a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to execute steps in any of the capability evolution methods for intelligent agents provided by the present invention.
[0008] On the other hand, the present invention also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the capability evolution methods for intelligent agents provided by the present invention.
[0009] On the other hand, the present invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps in the capability evolution method of any intelligent agent provided by the present invention.
[0010] The beneficial effects of the technical solution provided by this invention include at least the following: In this embodiment of the invention, a capability library formed by the agent's execution of historical tasks can be obtained. The historical trajectory of the seed task selected from the historical tasks can automatically generate candidate tasks and corresponding task standards without passively relying on manually constructed datasets. By combining similar experience and candidate tools, candidate inference trajectories for each candidate task can be generated. Successful and failed trajectories can be determined according to the task standards, and reusable experience and tools can be extracted from them to automatically update and iterate the experience and tools in the capability library, ensuring that the agent's capabilities can continuously evolve. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram illustrating an application scenario of the intelligent agent capability evolution method provided in this embodiment of the invention; Figure 2 This is a flowchart illustrating the capability evolution method of an intelligent agent provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the process for generating candidate tasks and task criteria provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the updated experience library and tool library provided in the embodiments of the present invention; Figure 5 This is a schematic diagram of the capability evolution device for an intelligent agent provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0014] It is understood that in specific embodiments of the present invention, data involving user information and related data requires user permission or consent, and the collection, use and processing of such data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0015] See also Figure 1 This diagram illustrates an application scenario for the intelligent agent capability evolution method. This application scenario may include a terminal 101 and a server 102, which can exchange data via a network. The terminal 101 may have applications related to the intelligent agent installed. The terminal 101 can be a mobile phone, tablet, smart Bluetooth device, computer, large screen, robot, etc.; the server 102 can be a single server or a server cluster consisting of multiple servers.
[0016] Users can send tasks to the agent in the server 102 through the terminal 101 for execution, thereby obtaining the capability library 103 formed by the agent's historical task execution. The capability library 103 may include a trajectory library, an experience library, and a tool library. The historical experience in the experience library is obtained by analyzing the historical trajectories in the trajectory library.
[0017] Server 102 can randomly select one from historical tasks as a seed task, and generate multiple candidate tasks and corresponding task criteria based on the historical trajectory of the seed task; using similar experience and candidate tools corresponding to the candidate tasks, it generates candidate inference trajectories for the candidate tasks, determines the successful and failed trajectories from them according to the candidate task criteria, and updates the experience base and tool base based on the successful and failed trajectories.
[0018] This enables the sustainable growth of data in the experience base and tool library, ensuring the continuous evolution of the agent's capabilities.
[0019] In this embodiment, a method for the capability evolution of an intelligent agent is provided, such as... Figure 2 As shown, the specific process of the agent's capability evolution method can be as follows: S110. Obtain the capability library formed by the agent's execution of historical tasks.
[0020] An intelligent agent is a software or hardware entity that can perceive its environment, make decisions, and perform actions to achieve specific goals. It possesses learning, reasoning, and adaptive capabilities and can operate autonomously in complex and ever-changing environments. A historical task refers to a task performed by an intelligent agent within a historical time period, which is a period preceding the current time. For example, it could be a month prior to the current time, or all time prior to the current time.
[0021] A capability library refers to the collection of knowledge accumulated and refined by an intelligent agent during the execution of tasks. It may include a trajectory library, an experience library, and a tool library.
[0022] The trajectory library stores all process data and results of an agent from the start to the end of a historical task, denoted as a historical trajectory. A historical trajectory may include trajectory number, task description, time information, step sequence, final output, success status, and reason for failure. The step sequence can consist of multiple step records, each containing information such as step number, executing role, action summary for that step, name of the tool called, tool input / output summary, key information summary, and error summary.
[0023] An experience base can be used to store reusable experiences gained by an agent during task execution, denoted as historical experiences. Historical experiences can be extracted from historical trajectories and can be used to guide the agent's thinking and avoidance of pitfalls when performing tasks. Historical experiences may include information such as experience number, layer, partition, triggering conditions, experience content, and warning supplements. Among them, layer refers to the different levels of content it contains, specifically general practices, common routines, and specific examples; partitions can be used to identify whether the historical experience is a successful experience or a warning experience; triggering conditions can be used to describe the circumstances under which the historical experience is used; experience content may include specific experience practices; warning supplements can specify prohibited behaviors and alternative solutions, etc.
[0024] The tool library stores information about tools that can be invoked by the agent, including tool ID, tool name, applicable scenarios, parameter descriptions, return values, and invocation examples. Initially, the tool library can contain a basic set of tools, such as browser operation tools, retrieval tools, recognition tools, file parsing tools, and code execution tools. As the agent performs more tasks and the trajectory and experience libraries become richer, historical trajectories can be analyzed and compiled into new tools, which can then be added to the tool library.
[0025] In one implementation approach, during the initial stage of an intelligent agent system's operation, the trajectory library and experience library contain no data, and the tool library only contains a basic set of tools. Therefore, in the initial stage, it is necessary to construct the trajectory library and experience library. One implementation approach could be to collect process data and result data generated when the intelligent agent executes historical tasks; extract summaries from the process data and result data to obtain the historical trajectories corresponding to the historical tasks in the trajectory library; for the successfully executed historical trajectories, extract the execution experience of the historical tasks as historical experience; and for the failed historical trajectories, analyze the reasons for the failure of the historical tasks as historical experience.
[0026] After the intelligent agent system is operational, it can receive and execute several real tasks. The planning, execution, and verification sub-agent roles within the system collaborate normally. Data from the task execution process is organized according to the required information in the aforementioned trajectory library to form historical trajectories corresponding to historical tasks. It should be noted that task execution by the intelligent agent may result in success or failure; the historical trajectories stored in the trajectory library include both successful and failed trajectories.
[0027] Historical experience can be extracted from historical trajectories. For successful historical trajectories, the focus can be on the execution records of the tasks to form historical experience; for unsuccessful historical trajectories, the focus can be on the reasons for the failures to form historical experience.
[0028] As one implementation method, historical experience can be extracted from historical trajectories using a large language model. For example, extraction prompts can be designed, which may include role settings, input data descriptions, extraction logic, output requirements, and output examples. The role settings clarify the role the large language model will play and the task description of the extraction task it will perform; the input data description clarifies the input data for the extraction task; the extraction logic clarifies the analysis steps when performing the extraction task; the output requirements clarify the output data; and the extraction examples provide data references to ensure the large language model can accurately extract historical experience. Inputting the extraction prompts and historical trajectories into the large language model guides it to extract historical experience from the historical trajectories according to the extraction logic and requirements. The extraction prompts can be set according to actual needs. In this embodiment of the invention, the extraction prompts used may be: #
Character Design
[0029] #
Input Data Instructions
[0030] The user will provide a JSON-formatted "historical track" containing a task description, a sequence of steps, the final output, and the reason for failure (if any).
[0031] #
Extracting the Logic
[0032] Please analyze the trajectory following these steps: 1. Judgment result: If the task is successful: focus on analyzing "what was done right", extract efficient paths or key skills, and categorize them as "successful experiences".
[0033] If the task fails: focus on analyzing "what went wrong" and "failure reason tags", extracting tips to avoid pitfalls, and categorizing them as "warning experiences".
[0034] 2. Levels of abstraction: categorizing experience into one of the following three levels: `General Approach`: Macro-level problem-solving approach (e.g., break down complex problems into smaller parts first).
[0035] Common tactics: a combination of tools or standard procedures at the mid-level (e.g., verifying the source after a search).
[0036] 'Specific examples': micro-level specific scenario processing (e.g., trying OCR when processing PDF errors).
[0037] #
Output Requirements
[0038] Please output a JSON list containing the extracted lessons. Each lesson must include the following fields: `Layering`: You can only fill in "General Practice", "Common Approaches", or "Specific Examples".
[0039] `Partition`: Only "Successful Experience" or "Warning Experience" can be filled in.
[0040] `Trigger Conditions`: Briefly describe the situation / task / scenario in which this experience is used.
[0041] Experience content: If it's a successful experience: clearly describe the specific steps and key verification points.
[0042] If it's a warning or experience: clearly describe the error and the correct approach.
[0043] Warning Supplement: If it is a warning experience: you must write "prohibited behavior" and "alternative" in one sentence.
[0044] If it's a successful experience: fill in the blank with the string "".
[0045] #
Example Output Format
[0046] json [
[0048] {
[0049] "layer": "Common Techniques", "partition": "Successful Experiences", "trigger_condition": "When real-time stock information needs to be queried", "content": "Not only do we need to use the search tool, but we also need to use the time tool to confirm the current date to ensure that the data obtained is the latest closing price." "warning_supplement": "" }, { "layer": "Specific examples", "partition": "Warning Experience", "trigger_condition": "When reading a Python code file that contains Chinese comments", "content": "Direct reading may result in encoding errors; the encoding='utf-8' parameter must be specified." "warning_supplement": "Reading non-English files is prohibited using the default encoding; the encoding format must be explicitly specified." } ] ``` #
Current Task
[0050] S120. Generate multiple candidate tasks based on the historical trajectory of the seed task, and the task criteria corresponding to each candidate task.
[0051] A seed task is randomly selected from the agent's historical tasks and serves as the starting point for generating candidate tasks. Candidate tasks are new tasks generated based on the seed task, and task criteria are used to evaluate the performance of these candidate tasks. Proactively generating new tasks from historical data effectively expands the system's exploration boundaries, enhances the agent's capabilities, and accelerates the agent's evolution.
[0052] Optionally, when generating multiple candidate tasks based on the historical trajectory of the seed task, and the starting point of each candidate task, the seed task may be determined from the historical tasks; multiple intermediate tasks and acceptance criteria corresponding to each intermediate task may be generated according to the task description and historical trajectory of the seed task; a rationality check process may be performed on each intermediate task; the intermediate task that passes the rationality check process may be determined as a candidate task, and the acceptance criteria of the intermediate task may be determined as the task criteria.
[0053] See also Figure 3The diagram illustrates the process of generating candidate tasks and task criteria. A seed task can be randomly selected from the agent's historical tasks, and its description and historical trajectory can be obtained. Finally, multiple intermediate tasks can be generated using the task description and historical trajectory. To ensure the validity of the generated intermediate tasks, each intermediate task undergoes a validity check. Intermediate tasks that pass the validity check are designated as candidate tasks for subsequent use.
[0054] Among them, the execution links in the historical trajectory can be extracted. While ensuring that the execution links remain unchanged, that is, without changing the difficulty and process of solving the problem, the entity parameters in them can be modified to generate intermediate tasks and corresponding acceptance criteria.
[0055] As one implementation method, when generating intermediate tasks, the execution link of the seed task can be extracted from the historical trajectory of the seed task; based on the execution link, entity parameters in the task description can be extracted; the entity parameters can be adjusted to obtain specified parameters; and the intermediate task and corresponding acceptance criteria can be generated by combining the specified parameters, the execution link, and the historical trajectory.
[0056] As mentioned above, the historical trajectory of a seed task contains all information from the start to the end of the task. Analyzing the historical trajectory allows us to extract the execution chain of the seed task. For example, if the seed task description is "Please find the chart data on page 15 of NASA's 2015 budget report," its execution chain would be: search, download PDF, extract specific page, OCR recognition, and data cleaning. From the task description, we can extract the entity parameters corresponding to the variable entities. Variable entities can refer to time, location, object, filename, value, etc. For example, NASA, 2015, budget report, page 15, chart data, etc. By changing these data, such as changing NASA to Company A, or changing 2015 to 2025, we can obtain the specified parameters.
[0057] By combining specified parameters, execution links, and historical trajectories, intermediate tasks and corresponding acceptance criteria are generated. The acceptance criteria must be objective and automatically executable. In this embodiment, the intermediate tasks and corresponding acceptance criteria can be automatically generated by a large language model using corresponding prompt words. For example, task generation prompt words can be pre-set to guide the large language model in generating intermediate tasks and corresponding acceptance criteria. The task generation prompt words can be set according to actual needs. In this embodiment, the task generation prompt words can be: #
Character Design
[0058] #
Input Data
[0059] 1. Seed Task Description: The text of the original task.
[0060] 2. Seed trajectory summary: The sequence of key steps in the original task (e.g., search -> download -> extract -> compute).
[0061] #
Generation Logic
[0062] Please strictly follow these steps: 1. Topology Analysis: Identify the "action chain" and "logical structure" of the seed task. Keep this structure unchanged (i.e., do not change the difficulty and process of solving the problem).
[0063] 2. Entity Mutation: Identify variable entities in the task (such as time, location, object, filename, specific value). Replace these entities with new, reasonable, and specific entities.
[0064] Example: Change "NASA" to "Company A"; change "2015" to "2023".
[0065] 3. Develop acceptance criteria: Create clear acceptance standards for new tasks. Acceptance criteria must be objective and automatically verifiable.
[0066] Good standards: The output must include a "Total Revenue" field; the output format must be a Markdown table.
[0067] Bad standards: Results must be accurate; analysis must be in-depth (these cannot be automatically verified).
[0068] #
Output Requirements
[0069] Output a JSON object containing: `new_task`: The description of the newly generated task (must be clear and specific).
[0070] `acceptance_criteria`: A list of acceptance criteria (used for automatic evaluation).
[0071] `mutation_logic`: Briefly describe which entities have mutated.
[0072] #
Output Example
[0073] json
[0074] {
[0075] "new_task": "Please find Company A's 2023 financial report PDF and extract the specific amount of 'R&D expenditure' from it." "acceptance_criteria": [ The output must contain numerical values. "The currency unit (e.g., USD) must be clearly specified." "The name of the PDF file from which the data is sourced must be provided." ], "mutation_logic": "Keep the 'search -> download financial reports -> extract data' topology unchanged; change the object from 'NASA' to 'Company A', the year from '2015' to '2023', and the target data from 'budget' to 'R&D expenditure'." } ``` # [Current Input] Seed task: {{seed_task}} The historical trajectory of seed missions: {{seed_trajectory_summary}}.
[0076] After generating intermediate tasks, to ensure their reasonableness, a reasonableness check can be performed on each intermediate task. This reasonableness check can include executability checks, acceptability checks, security checks, and novelty checks.
[0077] Feasibility checks ensure that intermediate tasks are executable, predict the tools required for these tasks, and ensure that all tools are available in the tool library. Access permissions for resources are checked to ensure they are accessible. For example, does the intermediate task depend on capabilities not in the tool library? Does it require account login, payment, or access to the internal network?
[0078] Acceptability checks are used to verify whether acceptance criteria can be automatically checked, such as whether a clear format exists, whether fields can be validated, and whether the source can be verified. If the acceptance criteria are too vague, they are either removed or regenerated.
[0079] Security checks detect whether intermediate tasks involve sensitive information, dangerous operations, destructive operations, or bypassing restrictions. Novelty checks ensure that there are no other tasks in the trajectory database that are too similar to the intermediate task, thus ensuring the novelty of the intermediate task.
[0080] Optionally, when performing reasonableness detection on intermediate tasks, the task description of the seed task corresponding to the intermediate task and the capability summary of the tool library can be used as context information; detection prompt words can be generated using the context information, the intermediate task, the acceptance criteria corresponding to the intermediate task, and the detection requirements; and the large language model can be guided to perform reasonableness detection on the intermediate task according to the detection requirements using the detection prompt words.
[0081] For each intermediate task, the task description of its corresponding seed task can be obtained, which can be used for novelty checking. For each tool in the tool library, a capability summary can be pre-generated; here, the capability summaries of all tools in the tool library can be obtained, and the capability summaries and task descriptions are used as contextual information. Detection requirements refer to the relevant requirements for conducting reasonableness checks, specifically including information such as detection dimensions. Using the contextual information, intermediate tasks, the corresponding acceptance criteria for intermediate tasks, and the detection requirements, detection prompts can be generated.
[0082] For example, the detection prompt words provided in the embodiments of the present invention may be: #
Character Design
[0083] #
Contextual Information
[0084] 1. Summary of tool library capabilities: {{tool_list_summary}} (e.g., browser, search, OCR, Python code execution, file read and write).
[0085] 2. Source seed task: {{seed_task}} (used for novelty comparison).
[0086] #
Testing Requirements
[0087] Please perform the following checks on the intermediate tasks in sequence: 1. Feasibility: Does the task depend on capabilities that are not available in the toolkit? Do I need to log in, pay, or access the intranet? determination If it exceeds the scope of capability, it will be considered as a failure.
[0088] 2. Acceptability: Are the provided "acceptance criteria" specific, objective, and quantifiable? If the acceptance criteria are subjective descriptions such as "well written" or "fluent", it will be considered as failing.
[0089] 3. Security: Does it contain destructive commands such as deleting system files or attacking servers? determination If this applies, it will be considered as not approved.
[0090] 4. Novelty: Compared to the source seed task, is it just a simple synonym replacement (such as "find" becoming "search") without any substantial content change? determination If the similarity is too high, it will be considered as failing.
[0091] #
Output Requirements
[0092] Output a JSON object containing: `is_passed`: Boolean value (true / false).
[0093] `reject_reason`: If the check fails, specify which type of check was hit (e.g., "Security check failed: Sensitive information involved"); leave blank if the check passes.
[0094] `suggestion`: If the acceptance is rejected due to unclear acceptance criteria, provide suggestions for modification.
[0095] #
Output Example
[0096] json
[0097] {
[0098] "is_passed": false, "reject_reason": "Executability check failed: The task requires 'login to a social media app to retrieve a friend list,' but the system does not have permission to log in to a social media account." "suggestion": "It is recommended to change the task to scrape publicly available data." } ``` # [Enter the task to be checked] Intermediate task: {{new_task}} Acceptance criteria: {{acceptance_criteria}}.
[0099] Inputting detection prompts into a large language model guides the model to analyze and reason about the contextual information within the prompts, and to perform intermediate tasks according to the detection requirements to obtain the corresponding output. If an intermediate task fails the rationality check, the intermediate task and its corresponding acceptance criteria can be adjusted based on the reasons for failure, and the rationality check can be performed again after adjustment. If an intermediate task passes the rationality check, it can be used as a candidate task, and its acceptance criteria can be used as the task criteria for the candidate task.
[0100] S130. Based on similar experience of the candidate tasks and candidate tools, generate candidate inference trajectories for the candidate tasks.
[0101] Candidate tasks are intermediate tasks that pass the rationality check and are tasks that can be executed by the agent. Similar experiences refer to historical experiences that are semantically highly relevant to the candidate tasks and can be retrieved from an experience base. Candidate tools are tools that match the execution requirements of the candidate tasks and can be retrieved from a tool library.
[0102] Candidate inference trajectories refer to a series of hypothetical operational steps and decision paths generated by an agent in order to complete a candidate task. They can be used to predict the task execution process and results.
[0103] Optionally, when generating candidate inference trajectories for candidate tasks, similar experiences of the candidate task can be determined based on the semantic similarity between the candidate task and each historical experience in the experience base; candidate tools of the candidate task can be determined based on the semantic similarity between the candidate task and each tool in the tool base; and candidate inference trajectories corresponding to the candidate task can be generated using the similar experiences and the candidate tools.
[0104] In determining similar experiences, an embedding model can be used to convert the task description of the candidate task into a candidate task vector; each historical experience in the experience base can be used to generate a historical experience vector using the same embedding model; the semantic similarity between the candidate task vector and each historical experience vector can be calculated, and the historical experience corresponding to the historical experience vector with the highest semantic similarity can be taken as the similar experience.
[0105] Similarly, the capability description information of each tool in the tool library is obtained, and the capability description information is converted into a capability vector using an embedding model; the semantic similarity between each candidate task vector and the capability vector is calculated, and the tool corresponding to the capability vector with the highest semantic similarity is determined as a similar tool.
[0106] By incorporating similar experiences into the prompts for task execution, historical experience is provided for the execution of candidate tasks. Similar tools are added to the agent's list of available tools, providing historical tools as candidates for the execution of candidate tasks, thus ensuring that historical knowledge can be utilized in the execution of candidate tasks.
[0107] Guided by prompts, large language models can analyze candidate tasks and generate multiple inference paths in parallel for the same input through rejection sampling. The model's temperature coefficient needs to be set to a large value, such as 0.9, to ensure the diversity of generated inference paths. For example, in solving mathematical problems, different paths such as algebraic methods, geometric methods, and enumeration methods can be explored simultaneously, retaining semantically unique and logically consistent inference paths as candidate inference paths.
[0108] S140. Based on the task criteria corresponding to the candidate task, determine the successful trajectory and the failed trajectory from the candidate inference trajectory.
[0109] After identifying candidate tasks and their corresponding criteria, successful and unsuccessful inference trajectories can be determined from these candidate inference trajectories. In other words, the final results of the candidate inference trajectories can be evaluated using the task criteria to filter out successful and unsuccessful trajectories.
[0110] For the execution result of each candidate inference trajectory, the execution result is analyzed according to the task criteria. If the execution result meets the task criteria, the candidate inference trajectory can be determined as a successful trajectory; if there are cases in the execution result that do not meet the task criteria, the candidate inference trajectory can be determined as a failed trajectory.
[0111] In this way, candidate inference trajectories can be divided into successful trajectories and failed trajectories for subsequent use.
[0112] S150. Update the experience base and the tool base according to the success trajectory and the failure trajectory.
[0113] Analyzing the selected success and failure trajectories allows for the updating of the experience and tool libraries. For example, successful experiences can be extracted from success trajectories, and failure experiences from failure trajectories, or corresponding experiences can be generated by comparing success and failure trajectories to update the experience library. Optionally, more practical tools can be extracted from frequently occurring consecutive execution steps to iteratively update the tool library.
[0114] As one implementation method, when updating the experience base and tool base using successful and failed trajectories, if neither the successful nor failed trajectories are empty, a trajectory pair is constructed, the trajectory pair including a first trajectory selected from the successful trajectories and a second trajectory selected from the failed trajectories; the first trajectory and the second trajectory are analyzed and compared to extract difference data and operation combinations; a large language model is used to infer candidate experiences based on the difference data; the candidate experiences are updated in the experience base according to the retrieval results of the candidate experiences in the experience base; and the tool base is updated using the operation combinations.
[0115] See also Figure 4 This diagram illustrates the process of updating the experience base and toolkit. If a successful trajectory is empty, it indicates that all candidate reasoning trajectories have failed, and the candidate task can be marked as a high-difficulty task. If neither successful nor failed trajectories are empty, it indicates that there are both successful and failed trajectories among the candidate reasoning trajectories. By comparing and analyzing the similarities and differences between successful and failed trajectories, relevant experience can be summarized.
[0116] By arbitrarily selecting a trajectory from the successful trajectories as the first trajectory and arbitrarily selecting a trajectory from the failed trajectories as the second trajectory, and combining the first and second trajectories, trajectory pairs can be constructed. Multiple different trajectory pairs can be constructed in this way. A different trajectory pair is one in which at least one trajectory differs. For each trajectory pair, the first and second trajectories can be analyzed and compared to extract the difference data between the two trajectories.
[0117] The difference data may include key decision points, triggering conditions, and difference comparison data. Key decision points refer to the critical nodes that affect the success or failure of the task, and triggering conditions can clarify the conditions for using experience.
[0118] Specifically, when comparing two trajectories, we can first locate the first divergence point between the two trajectories from the start to the end of the task, which can be regarded as the critical decision point. Then, we analyze the contextual information of the critical decision point to determine the specific situation faced by the agent before the critical decision point, so as to obtain the triggering conditions. In addition, by comparing the two trajectories, we can clarify the policy differences between the two trajectories, such as what policy the first trajectory chose and why it was effective, and what policy the second trajectory chose and what obstacles it encountered.
[0119] By processing and organizing the content obtained from the above analysis, complete variance data can be obtained. The variance data may include the step number of the key decision point, the objective situation faced by the key decision point, i.e. the triggering conditions, the summary of the first trajectory, the summary of the second trajectory and the summary of the consequences, and the experience.
[0120] By scanning and analyzing the first trajectory, it is possible to detect whether there are multi-step, low-level, and fixed combinations of operations within it. For example, it could detect whether there are consecutive calls to multiple atomic tools within the first trajectory, such as opening a webpage, searching for an element, focusing, inputting, and clicking. If there are more than a specified number of closely related operations that can logically be merged into a single function, these operations can be recorded as operation combinations. The extracted operation combinations can include suggested tool function names and the rationale for forming the operation combination. For example, if the first trajectory continuously performs regular expression extraction, whitespace removal, currency symbol diamond-cutting, and thousands separator clearing, this constitutes a fixed set of data cleaning logic.
[0121] When extracting differential data and combining operations, corresponding analysis prompts can be set to guide the large language model to complete the process. These analysis prompts can be set according to actual needs. In this embodiment of the invention, the analysis prompts can be: #
Character Design
[0122] #
Input Data
[0123] 1. Task instructions: {{task_description}}
[0124] 2. Acceptance Criteria: {{acceptance_criteria}}
[0125] 3. Success trajectory: A set of steps to pass acceptance.
[0126] 4. Failure trajectory: A sequence of steps leading to failure.
[0127] #
Analysis Logic
[0128] Please strictly adhere to the following CoT (Cooperation of Thought) framework: Phase 1: Differential Attribution 1. Alignment and Positioning: Compare the two trajectories and find the first "critical decision point" where a fundamental divergence occurs.
[0129] 2. Context extraction: Analyze the specific context the agent faced before this node. (This is the "triggering condition" of experience).
[0130] 3. Comparison of successes and failures: What strategies did the successful trajectory employ? Why were they effective? What strategy did the failure trajectory choose? What specific obstacles did it cause (errors / hallucinations / infinite loops)? Phase Two: Pattern Recognition 1. Scan successful trajectory: Check if there is a combination of "multi-step, low-level, fixed" operations in the successful trajectory.
[0131] Typical characteristics: In succession of multiple fine-grained atomic tools (e.g., open webpage -> find element -> focus -> type -> click).
[0132] Judgment: If there are more than 3 closely related operations that can be logically merged into a single function, then mark it as a "tool capsule candidate".
[0133] #
Output Requirements
[0134] Please output a JSON object that must contain the following fields: `divergence_step_index` (int): The step number of the bifurcation point.
[0135] `trigger_context` (string): Key! Describes the objective situation faced at the fork point (e.g., "when it is necessary to extract tabular data from an unstructured PDF").
[0136] `success_strategy` (string): A summary of the approach taken for the success strategy (e.g., "calling an OCR tool to recognize the text instead of directly parsing it").
[0137] `failure_cause` (string): A summary of the failure path and its consequences (e.g., "directly parsing text resulted in garbled characters").
[0138] `semantic_reflection` (string): Natural language feedback to the agent.
[0139] `tool_capsule_candidate` (object | null): If a capsuleable operation chain is found, please fill it in; otherwise, leave it null. Includes: `start_step`: The starting step number of the sequence.
[0140] `end_step`: The step number at which the sequence ends.
[0141] `suggested_function_name`: Suggested utility function name (e.g., `search_and_download_pdf`).
[0142] `reason`: The reason for recommending encapsulation (e.g., "highly repetitive browser operation chains").
[0143] #
Output Example
[0144] json
[0145] {
[0146] "divergence_step_index": 4, "trigger_context": "When the target webpage contains dynamically loaded content (such as scroll-loaded content) and requests directly retrieves it as empty", "success_strategy": "The successful trajectory switch was dynamically rendered and obtained using the 'Browser_Scroll_and_Capture' tool." "failure_cause": "The failure trajectory repeatedly used 'Requests_Get', resulting in three consecutive empty retrievals, ultimately causing the task to time out." "semantic_reflection": "In step 4, when faced with dynamic web pages, the failed trajectory incorrectly repeated the static web scraping tool; while the successful trajectory correctly identified the page characteristics, switched to the browser simulation tool, and successfully obtained the data." "tool_capsule_candidate": { "start_step": 5, "end_step": 9, "suggested_function_name": "clean_and_format_currency_data", "reason": "Steps 5-9 in the successful data processing trajectory continuously perform regular expression extraction, whitespace removal, currency symbol conversion, and thousands separator cleaning. This is a fixed set of data cleaning logic, and it is recommended to encapsulate it." } } ``` #
Current Data Awaiting Evaluation
[0147] As one implementation method, corresponding experience-based prompts can be set to guide the large language model in extracting candidate experiences from the differential data. The experience-based prompts can be set according to actual needs. In this embodiment of the invention, the experience-based prompts can be: [Character Setting] You are an "experience generalization expert". Your task is to strip away the specific task IDs, file names, and values from the discrepancies in the data and generalize them into common "condition-action" rules.
[0148] [Input Data]
[0149] The difference data includes: `trigger_context` (the specific triggering scenario) `success_strategy` (a successful strategy) `failure_cause` (the reason for failure) Processing Logic 1. Despecification: Generalize "Company X's 2022 financial report" to "corporate financial reports for a specific year"; generalize "Tool_A" to "PDF parsing tool".
[0150] 2. Define partitions: If the focus is on correcting errors (the reasons for failure are clearly provided in the variance data), it falls under the 'Warning Experience' category.
[0151] If the focus is on recommending efficient paths, then it falls under the category of 'successful experiences'.
[0152] 3. Define the layers: Select `general approach` / `common patterns` / `specific examples` based on the depth of the content.
[0153] Output Requirements
[0154] Output a JSON object for a single experience: `layer`: Layers.
[0155] `partition`: "Successful Experience" or "Warning Experience".
[0156] `trigger_condition`: The generalized trigger condition.
[0157] `content`: Generalized experience content (action guidelines).
[0158] `warning_supplement`: If it is a warning experience, it must be filled with "Prohibit XX, should YY"; otherwise it should be empty.
[0159] Output Example
[0160] json
[0161] {
[0162] "layer": "Common Techniques", "partition": "Warning Experience", "trigger_condition": "When it is necessary to fetch dynamically rendered webpage data", "content": "Using static request tools (such as requests) directly will not retrieve the content, causing subsequent extraction to fail." "warning_supplement": "Using static HTTP requests is prohibited; you must switch to a browser emulation tool (such as BrowserUse) for dynamic loading." } ``` [Current Input] {{Difference Data}} After inferring candidate experiences, they can be stored in the experience base for later use. To avoid storing a large amount of duplicate data in the experience base, the candidate experiences can be updated in the experience base based on the retrieval results of the candidate experiences in the experience base.
[0163] As one implementation method, when updating candidate experiences to the experience base, the semantic similarity between the candidate experience and each historical experience in the experience base can be calculated; a specified experience can be determined from the historical experiences according to the semantic similarity; if the specified experience is empty, the candidate experience can be added to the experience base; if the specified experience is not empty, the candidate experience can be added to the experience base based on the specified experience.
[0164] For candidate experiences, they can be vectorized to obtain candidate vectors; each historical experience can be vectorized to obtain historical vectors, and the cosine similarity between the candidate vector and each historical vector can be calculated as semantic similarity; historical experiences corresponding to candidate vectors with semantic similarity greater than a specified value are marked as specified experiences. It is understood that if no historical experience with semantic similarity greater than the specified value exists, the specified experience is empty. If the specified experience is empty, it indicates that there are no similar historical experiences in the experience base, and the candidate experience can be directly added to the experience base.
[0165] If the specified experience is not empty, it indicates that there are historical experiences similar to the candidate experience in the experience base. To avoid duplication, the candidate experience and the specified experience can be merged and added to the experience base. As one implementation method, when adding a candidate experience to the experience base based on the specified experience, it can be done by comparing the specified experience with the candidate experience to extract common experiences; extracting incremental experiences from the specified experience compared to the candidate experience; fusing the common experiences and the incremental experiences to generate a merged experience; and replacing the specified experience in the experience base with the merged experience.
[0166] For candidate experiences and specified experiences, a comparative analysis can be performed on the two experiences to identify their core commonalities and extract the common experiences. If a candidate experience provides details not found in the specified experience, such as a more specific error message or a better alternative, it can be recorded as an incremental experience. By merging the common experiences and incremental experiences, a merged experience can be generated. The merged experience is the experience that needs to be updated in the experience base.
[0167] Optionally, when merging candidate experiences and specified experiences, a merging prompt can be designed to guide the large language model in merging the candidate experiences and specified experiences. The merging prompt can be set according to actual needs. In this embodiment of the invention, the merging prompt can be: [Character Setting] You are a "knowledge base administrator". Your task is to merge a candidate experience into a specified experience to make the knowledge more complete and accurate.
[0168] [Input Data]
[0169] 1. Specify experience: {{existing_experience_json}}
[0170] 2. Candidate experience: {{new_experience_json}}
[0171] [Merging Logic]
[0172] 1. Seek common ground while reserving differences: retain the core commonalities in the two experiences.
[0173] 2. Information increments: If candidate experiences provide details that the specified experience does not (such as more specific error messages or better alternatives), please add them.
[0174] 3. Text Conciseness: The merged text should be concise and logically coherent, avoiding simple string concatenation.
[0175] 4. Structure Preservation: The output structure must be consistent with the input structure.
[0176] Output Requirements
[0177] Output a merged JSON object (fields are the same as input).
[0178] Output Example Suppose the given rule of thumb is "Use UTF-8 to read files," and the alternative rule of thumb is "Use UTF-8 to read Python files when encountering garbled Chinese characters."
[0179] json
[0180] {
[0181] "layer": "Specific examples", "partition": "Warning Experience", "trigger_condition": "When reading a text file or code containing non-ASCII characters (such as Chinese comments)," "content": "Reading with the default encoding will result in a UnicodeDecodeError or garbled characters. The encoding format must be explicitly specified when opening the file." "warning_supplement": "The default encoding parameter is prohibited; encoding='utf-8' must be specified." } ``` This method yields merged experiences, which can then be used to replace specified experiences in the experience base, thus updating the experience base with candidate experiences.
[0182] After inferring the operation combination, the operation combination can be processed to update the tool library. Optionally, the operation combination can be encapsulated to obtain a specified tool; test code for the specified tool can be generated using a large language model; if the specified tool passes the test code, the specified tool can be added to the tool library.
[0183] Operation combinations are high-frequency and fixed multi-step operations detected from a trajectory. For example, each time, the operation is to first open a webpage, then find the input box, then enter the information, and then click search. This set of operation combinations can be re-encapsulated into a new function, that is, encapsulated into a new tool to obtain the specified tool.
[0184] The encapsulation operation combination can be implemented by setting encapsulation prompts to guide the large language model. The encapsulation prompts can be: [Character Setting] You are a senior code engineer, proficient in writing MCP tools. Your task is to encapsulate a combination of operations from a trajectory into a standalone, reusable Python function—that is, a new MCP tool.
[0185] [Input Data]
[0186] 1. Operation combination sequence: {{trajectory_segment_json}}
[0187] 2. Suggested function name: {{suggested_function_name}}
[0188] 3. Atomic tool definition: {{base_tools_def}}
[0189] Composition Logic
[0190] 1. Parameter Abstraction: Analyze the operation sequence to identify specific values (such as "Company A", "2023"), and extract them as input parameters for the function (such as `company_name`, `year`). Avoid hardcoding specific values in the code.
[0191] 2. Logical Chaining: Within the function body, organize the logic sequentially, calling the basic atomic tools one by one. The output of the previous step should serve as the input of the next step.
[0192] 3. Error handling: Add a basic `try-except` block to ensure that clear error messages are returned when intermediate steps fail.
[0193] 4. Format Specifications: Output data structures that conform to the MCP standard.
[0194] Output Requirements
[0195] Output a JSON object containing the standard fields for the tool entries: `tool_name`: Function name (Snake case).
[0196] `description`: Clearly describe the tool's functions and applicable scenarios.
[0197] `arguments`: A list of parameters (in JSON Schema format or plain text).
[0198] `python_code`: The complete Python function code. The code should include import statements and internal calls to dependencies.
[0199] Output Example
[0200] json
[0201] {
[0202] "tool_name": "search_and_download_first_pdf", "description": "Comprehensive tool: First, perform a Google search, then automatically extract the link to the first result and download it as a PDF to your local computer." "arguments": "query (str): search keywords; save_path (str): local save path", "python_code": "def search_and_download_first_pdf(query, save_path):\n # 1. Search\n results = search_tool(query)\n if not results: return 'Error:No results'\n # 2. Extract Link\n url = results[0]['url']\n # 3. Download\nreturn download_file_tool(url, save_path)" } ``` For a specific tool, test code for all specified tools can be generated to test the tool and execute subsequent steps based on the test results. The test code can be generated using a large language model. If the test passes, the specified tool can be directly added to the tool library as a new tool. If the test fails, the error message from the failed test can be used to re-execute the test. If the test still fails, the specified tool can be discarded.
[0203] Optionally, test prompts can be pre-set to guide the large language model in generating test code. In this embodiment of the invention, the test prompts can be: [Character Setting] You are a meticulous QA test engineer. Your task is to write a standalone unit test code for a specified tool.
[0204] [Input Data]
[0205] 1. Specify the tool definition: {{new_tool_json}} (including name, code, and parameter description).
[0206] [Generation Logic]
[0207] 1. Mock Simulation: Since the specified tool internally calls network or file operations (such as search, download), in order to ensure the purity and security of the test, please use `unittest.mock` to mock the atomic tools called internally (simulate the return value) to avoid actually initiating network requests.
[0208] 2. Coverage: Includes at least one "normally functioning" test case (Assert return value conforms to the expected format).
[0209] 3. Independence: The generated code must be a directly executable Python script (containing `if __name__ == '__main__':`).
[0210] Output Requirements
[0211] Output a string of Python code directly; JSON format is not required.
[0212] Output Example
[0213] Python
[0214] import unittest
[0215] from unittest.mock import patch, MagicMock
[0216] # Assuming the specified utility code has been imported or defined here
[0217] from generated_tools import search_and_download_first_pdf
[0218] class TestSearchDownload(unittest.TestCase):
[0219] @patch('generated_tools.search_tool')
[0220] @patch('generated_tools.download_file_tool')
[0221] def test_success_flow(self, mock_download, mock_search):
[0222] # 1. Setup Mock
[0223] mock_search.return_value = [{'url': 'http: / / example.com / report.pdf'}]
[0224] mock_download.return_value = "Success: / tmp / file.pdf"
[0225] # 2. Execute
[0226] result = search_and_download_first_pdf("test query", " / tmp / file.pdf")
[0227] # 3. Assert
[0228] self.assertEqual(result, "Success: / tmp / file.pdf")
[0229] mock_search.assert_called_with("test query")
[0230] if __name__ == '__main__':
[0231] unittest.main()
[0232] ```
[0233] It should be noted that after updating the specified tools to the tool library and the candidate experiences to the experience library, regression testing can be performed on the specified tools and candidate experiences before they are officially enabled to avoid catastrophic amnesia and contamination of the capability library. For example, one can be randomly selected from successfully executed historical tasks. The first group uses the unupdated capability library, and the second group uses the updated capability library. If the second group completes the historical task without causing a significant performance degradation, the specified tools and candidate experiences can be officially enabled in the capability library. A significant degradation means that the performance degradation of the historical task does not exceed a threshold. The threshold can be set according to actual needs and is not specifically limited here.
[0234] The updated capability library can be used for subsequent task execution, ensuring continuous updates and iterations to enable the agent's capabilities to evolve independently. Maintaining the experience library and tool library allows for continuous enhancement of the agent's capabilities without needing to update the parameters of the large language model, effectively mitigating the risk of catastrophic forgetting and ensuring seamless compatibility with closed models.
[0235] The agent capability evolution method provided in this embodiment of the invention can be applied to various scenarios that require the use of agents. By adopting the solution of this embodiment of the invention, the agent can better learn from the experience of historically executed tasks, realize the continuous evolution of the agent's capabilities, and improve the accuracy and efficiency of the agent in executing tasks.
[0236] As can be seen from the above, the embodiments of the present invention can extract structured experience and tools from the historical trajectories corresponding to the executed historical tasks to ensure the continuous evolution of the agent's capabilities. Through automatic task generation, new tasks with acceptance criteria can be proactively generated, expanding the agent's boundaries. By comparing the similarities and differences between successful and failed trajectories, key points leading to disagreements can be accurately identified, and reflection can be formed based on this, improving the usability of experience. Furthermore, high-frequency, fixed multi-operation sequences can be identified from the trajectories and encapsulated into new tools, improving the agent's execution speed. Moreover, enhancing the agent's capabilities in the form of an experience base and tool library eliminates the risk of forgetting.
[0237] To better implement the above methods, embodiments of the present invention also provide a capability evolution device for an intelligent agent. This capability evolution device can be integrated into an electronic device, such as a terminal or a server. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, or personal computer; the server can be a single server or a server cluster composed of multiple servers.
[0238] For example, in this embodiment, the method of the present invention will be described in detail by taking the integration of the intelligent agent's capability evolution device into the server as an example.
[0239] For example, such as Figure 5 As shown, the capability evolution device 200 of the intelligent agent may include an acquisition module 210, a task generation module 220, a trajectory generation module 230, a trajectory determination module 240, and an update module 250.
[0240] The acquisition module 210 is used to acquire the capability library formed by the intelligent agent in executing historical tasks. The capability library includes a trajectory library, an experience library, and a tool library. The historical experience in the experience library is obtained by analyzing the historical trajectories in the trajectory library. The task generation module 220 is used to generate multiple candidate tasks based on the historical trajectory of the seed task, and the task criteria corresponding to each candidate task, wherein the seed task is one of the historical tasks; The trajectory generation module 230 is used to generate candidate inference trajectories for the candidate tasks based on similar experiences and candidate tools, wherein the similar experiences are determined from the experience base and the candidate tools are determined from the tool base. The trajectory determination module 240 is used to determine the successful trajectory and the failed trajectory from the candidate inference trajectory based on the task criteria corresponding to the candidate task; The update module 250 is used to update the experience base and the tool base according to the success trajectory and the failure trajectory.
[0241] In some embodiments, the task generation module 220 is specifically used for: Seed tasks are determined from the historical tasks; Based on the task description and historical trajectory of the seed task, multiple intermediate tasks and the corresponding acceptance criteria for each intermediate task are generated. Perform a rationality check on each of the intermediate tasks; The intermediate tasks that pass the rationality test are identified as candidate tasks, and the acceptance criteria for the intermediate tasks are determined as task criteria.
[0242] In some embodiments, the task generation module 220 is specifically used for: Extract the execution chain of the seed task from its historical trajectory; Based on the execution chain, extract the entity parameters from the task description; The entity parameters are adjusted to obtain the specified parameters; By combining the specified parameters, the execution chain, and the historical trajectory, intermediate tasks and corresponding acceptance criteria are generated.
[0243] In some embodiments, the task generation module 220 is specifically used for: The task description of the seed task corresponding to the intermediate task and the capability summary of the tool library are used as context information; The context information, the intermediate task, the acceptance criteria corresponding to the intermediate task, and the testing requirements are used to generate testing prompt words; The detection prompts guide the large language model to perform rationality detection on the intermediate task according to the detection requirements.
[0244] In some embodiments, the trajectory generation module 230 is specifically used for: Based on the semantic similarity between the candidate task and each historical experience in the experience base, similar experiences of the candidate task are determined. Based on the semantic similarity between the candidate task and each tool in the tool library, candidate tools for the candidate task are determined; Using the similar experience and the candidate tools, candidate inference trajectories corresponding to the candidate tasks are generated.
[0245] In some embodiments, the update module 250 is specifically used for: If neither the successful trajectory nor the failed trajectory is empty, a trajectory pair is constructed, the trajectory pair including a first trajectory selected from the successful trajectory and a second trajectory selected from the failed trajectory; Analyze and compare the first trajectory and the second trajectory to extract the difference data and operation combinations; Based on the discrepancy data, candidate experiences are inferred using a large language model; Based on the retrieval results of the candidate experience in the experience base, the candidate experience is updated in the experience base; The tool library is updated using the aforementioned combination of operations.
[0246] In some embodiments, the update module 250 is specifically used for: Calculate the semantic similarity between the candidate experience and each historical experience in the experience base; The specified experience is determined from the historical experience based on the semantic similarity. If the specified experience is empty, the candidate experience is added to the experience library; If the specified experience is not empty, the candidate experience is added to the experience library based on the specified experience.
[0247] In some embodiments, the update module 250 is specifically used for: Compare the specified experience with the candidate experience to extract common experiences; Extract the incremental experience from the specified experience compared to the candidate experience; By integrating the common experiences and the incremental experiences, a merged experience is generated; The merged experience replaces the specified experience in the experience library.
[0248] In some embodiments, the update module 250 is specifically used for: The combination of operations is encapsulated to obtain a specified tool; Generate test code for the specified tool using a large language model; If the specified tool passes the test of the test code, the specified tool will be added to the tool library.
[0249] In practice, the above modules can be implemented as independent entities or combined in any way to be implemented as the same or several entities. For the specific implementation of each unit, please refer to the previous method implementation examples, which will not be repeated here.
[0250] As can be seen from the above, the capability evolution device of the intelligent agent provided in this embodiment can obtain the capability library formed by the intelligent agent's execution of historical tasks, select the historical trajectory of the seed task from the historical tasks to automatically generate candidate tasks and corresponding task standards, without passively relying on manually constructed datasets; combine similar experience and candidate tools to generate candidate inference trajectories for each candidate task, determine the successful trajectory and failure trajectory according to the task standards, and extract reusable experience and tools from them for automatic updating and iterating of the experience and tools in the capability library, ensuring that the capabilities of the intelligent agent can evolve continuously.
[0251] This invention also provides an electronic device, which can be a terminal, a server, or other similar devices. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers, etc.
[0252] In some embodiments, the capability evolution device of the intelligent agent can also be integrated into multiple electronic devices. For example, the capability evolution device of the intelligent agent can be integrated into multiple servers, and the capability evolution device method of the intelligent agent of the present invention can be implemented by multiple servers.
[0253] In this embodiment, a server will be used as an example for detailed description. For example, ... Figure 6 As shown, it illustrates a structural schematic diagram of the electronic device involved in an embodiment of the present invention, specifically: The electronic device may include components such as a processor 310 with one or more processing cores, a memory 320 with one or more computer-readable storage media, a power supply 330, an input module 340, and a communication module 350. Those skilled in the art will understand that... Figure 6 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 310 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes various functions and processes data by running or executing software programs and / or modules stored in the memory 320, and by calling data stored in the memory 320. In some embodiments, the processor 310 may include one or more processing cores; in some embodiments, the processor 310 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 310.
[0254] The memory 320 can be used to store software programs and modules. The processor 310 executes various functional applications and data processing by running the software programs and modules stored in the memory 320. The memory 320 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 320 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 320 may also include a memory controller to provide the processor 310 with access to the memory 320.
[0255] The electronic device also includes a power supply 330 that supplies power to the various components. In some embodiments, the power supply 330 can be logically connected to the processor 310 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 330 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0256] The electronic device may also include an input module 340, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0257] The electronic device may also include a communication module 350. In some embodiments, the communication module 350 may include a wireless module, through which the electronic device can perform short-range wireless transmission, thereby providing users with wireless broadband internet access. For example, the communication module 350 can be used to help users send and receive emails, browse web pages, and access streaming media.
[0258] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 310 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 320 according to the following instructions, and the processor 310 runs the applications stored in the memory 320, thereby implementing the steps in the methods of the various embodiments of the present invention.
[0259] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0260] As can be seen from the above, the electronic device provided in this embodiment of the invention can obtain the capability library formed by the agent's execution of historical tasks, select the historical trajectory of the seed task from the historical tasks to automatically generate candidate tasks and corresponding task standards, without passively relying on manually constructed datasets; combine similar experience and candidate tools to generate candidate inference trajectories for each candidate task, determine the successful trajectory and failure trajectory according to the task standards, and extract reusable experience and tools from them for automatic updating and iterating of the experience and tools in the capability library, ensuring that the agent's capabilities can continuously evolve.
[0261] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0262] To this end, embodiments of the present invention provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the capability evolution methods for intelligent agents provided in embodiments of the present invention. The storage medium may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0263] According to one aspect of the present invention, a computer program product or computer program is provided, comprising a computer program / instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer program / instructions from the computer-readable storage medium and executes the computer program / instructions, causing the electronic device to perform the methods provided in various alternative implementations of the capabilities evolution of the intelligent agent provided in the above embodiments.
[0264] Since the instructions stored in the storage medium can execute the steps in any of the intelligent agent capability evolution methods provided in the embodiments of the present invention, the beneficial effects that any of the intelligent agent capability evolution methods provided in the embodiments of the present invention can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0265] The above provides a detailed description of a method for the capability evolution of an intelligent agent and an electronic device provided by embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for the capability evolution of an intelligent agent, characterized in that, The method includes: A capability library is obtained from the historical tasks executed by the intelligent agent. The capability library includes a trajectory library, an experience library, and a tool library. The historical experience in the experience library is obtained by analyzing the historical trajectories in the trajectory library. Multiple candidate tasks are generated based on the historical trajectory of the seed task, and the task criteria corresponding to each candidate task are also generated. The seed task is one of the historical tasks. The generation of multiple candidate tasks based on the historical trajectory of the seed task, and the task criteria corresponding to each candidate task, include: Seed tasks are determined from the historical tasks; multiple intermediate tasks and acceptance criteria for each intermediate task are generated based on the task description and historical trajectory of the seed tasks; a rationality check is performed on each intermediate task; intermediate tasks that pass the rationality check are determined as candidate tasks, and the acceptance criteria of the intermediate tasks are determined as task criteria. Based on similar experiences and candidate tools for the candidate tasks, candidate inference trajectories for the candidate tasks are generated, wherein the similar experiences are determined from the experience base and the candidate tools are determined from the tool base. Based on the task criteria corresponding to the candidate tasks, successful and failed trajectories are determined from the candidate inference trajectories. The experience base and the tool base are updated based on the success trajectory and the failure trajectory.
2. The method according to claim 1, characterized in that, The step of generating multiple intermediate tasks and acceptance criteria for each intermediate task based on the task description and historical trajectory of the seed task includes: Extract the execution chain of the seed task from its historical trajectory; Based on the execution chain, extract the entity parameters from the task description; The entity parameters are adjusted to obtain the specified parameters; By combining the specified parameters, the execution chain, and the historical trajectory, intermediate tasks and corresponding acceptance criteria are generated.
3. The method according to claim 1, characterized in that, The reasonableness detection process for each intermediate task includes: The task description of the seed task corresponding to the intermediate task and the capability summary of the tool library are used as context information; The context information, the intermediate task, the acceptance criteria corresponding to the intermediate task, and the testing requirements are used to generate testing prompt words; The detection prompts guide the large language model to perform rationality detection on the intermediate task according to the detection requirements.
4. The method according to claim 1, characterized in that, The step of generating candidate inference trajectories for the candidate tasks based on similarity experience and candidate tools includes: Based on the semantic similarity between the candidate task and each historical experience in the experience base, similar experiences of the candidate task are determined. Based on the semantic similarity between the candidate task and each tool in the tool library, candidate tools for the candidate task are determined; Using the similar experience and the candidate tools, candidate inference trajectories corresponding to the candidate tasks are generated.
5. The method according to claim 1, characterized in that, The step of updating the experience base and the tool base based on the success trajectory and the failure trajectory includes: If neither the successful trajectory nor the failed trajectory is empty, a trajectory pair is constructed, the trajectory pair including a first trajectory selected from the successful trajectory and a second trajectory selected from the failed trajectory; Analyze and compare the first trajectory and the second trajectory to extract the difference data and operation combinations; Based on the discrepancy data, candidate experiences are inferred using a large language model; Based on the retrieval results of the candidate experience in the experience base, the candidate experience is updated in the experience base; The tool library is updated using the aforementioned combination of operations.
6. The method according to claim 5, characterized in that, The step of updating the candidate experience to the experience base based on the retrieval results in the experience base includes: Calculate the semantic similarity between the candidate experience and each historical experience in the experience base; The specified experience is determined from the historical experience based on the semantic similarity. If the specified experience is empty, the candidate experience is added to the experience library; If the specified experience is not empty, the candidate experience is added to the experience library based on the specified experience.
7. The method according to claim 6, characterized in that, Adding the candidate experience to the experience base based on the specified experience includes: Compare the specified experience with the candidate experience to extract common experiences; Extract the incremental experience from the specified experience compared to the candidate experience; By integrating the common experiences and the incremental experiences, a merged experience is generated; The merged experience replaces the specified experience in the experience library.
8. The method according to claim 5, characterized in that, The process of updating the tool library using the aforementioned combination of operations includes: The combination of operations is encapsulated to obtain a specified tool; Generate test code for the specified tool using a large language model; If the specified tool passes the test of the test code, the specified tool will be added to the tool library.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing multiple instructions; the processor loads instructions from the memory to perform steps in the agent capability evolution method as described in any one of claims 1-8.
Citation Information
Patent Citations
Iterative task execution method and system based on dynamic feedback and causal fault tolerance
CN121301846A
Intelligent agent strengthening method
CN121659990A
Inferring Security Decisions From Trusted Users
US20140189849A1