An agent self-adaptive evolution method and device based on a double synergy mechanism and an electronic device
The agent adaptive evolution method with dual collaborative mechanism solves the problem of low efficiency of agents in repetitive tasks by utilizing the collaborative work of the task forward network and the default mode network, realizing adaptive evolution and resource optimization, and improving task accuracy and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHIWEI XINGYI (SHANGHAI) INTELLIGENT TECH CO LTD
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-30
AI Technical Summary
Existing intelligent agents lack adaptive mechanisms when handling highly repetitive tasks, resulting in low efficiency, wasted resources, and an inability to effectively utilize existing experience.
A dual-cooperative mechanism is adopted, through the collaborative work of the task forward network and the default mode network, to achieve the adaptive evolution of the agent. The task forward network quickly queries the routine memory and initiates thought chain reasoning when no match is found, while the experience buffer is used to store the execution trajectory; the default mode network performs a deep review of the trajectory when idle, extracts high-frequency and high-success-rate operation sequences and updates the routine memory, and encapsulates them into standardized routine procedures through semantic clustering and dependency analysis.
It significantly improves the accuracy and execution stability of tasks, reduces the consumption of computing resources and energy usage, and optimizes computing efficiency through multi-level virtual function degradation operations.
Smart Images

Figure CN121835739B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, and electronic device for adaptive evolution of intelligent agents using a dual-cooperative mechanism. Background Technology
[0002] Current intelligent agents primarily rely on "Chain of Thought" (CoT) for single-step linear reasoning. Even when handling highly repetitive tasks (such as "searching for a company's stock price and drawing a graph"), the agent needs to perform a complete logical plan each time. This is analogous to humans having to re-look at a map and plan their route every time they go to school, lacking a "practice makes perfect" mechanism, resulting in inefficiency and wasted resources.
[0003] Therefore, a dual-cooperative mechanism for agent adaptive evolution, a device, and an electronic device are proposed. Summary of the Invention
[0004] This specification provides a method, device, and electronic device for adaptive evolution of intelligent agents based on a dual collaborative mechanism. By simulating the dual collaborative mechanism of the human brain's default mode network and the task-oriented network, the dynamic growth and adaptive evolution of intelligent agents are realized.
[0005] This specification provides a dual-cooperative mechanism-based agent adaptive evolution method, including:
[0006] The task forward network subsystem receives user requests;
[0007] The task forward network subsystem performs vector retrieval on the user request to query whether the target routine program can be matched in the long-term routine memory.
[0008] When the target routine program cannot be matched in the long-term routine memory, the task forward network subsystem initiates thought chain reasoning, calls basic tools to complete the task, and writes the execution trajectory into the experience buffer pool.
[0009] When the default mode network subsystem is in the target state, it scans the execution trajectory in the experience buffer pool and updates the execution trajectory to the long-term routine memory.
[0010] Optional, also includes:
[0011] When the target routine program can be matched in the long-term routine memory, the matched target routine program is directly loaded and executed.
[0012] Optionally, when the default mode network subsystem is in the target state, it scans the execution trajectory in the experience buffer pool and updates the execution trajectory to the long-term routine memory, including:
[0013] The target state includes idle or periodically triggered moments;
[0014] The default mode network subsystem cleans and removes erroneous trajectories from the scanned execution trajectories, and filters out trajectories that successfully complete the task.
[0015] The task objectives of successful trajectories are mapped to a vector space using an embedding model, and clustering algorithms are used to cluster similar task trajectories to obtain similar task clusters.
[0016] Optionally, the default mode network subsystem, when in the target state, scans the execution trajectory in the experience buffer pool and updates the execution trajectory to the long-term routine memory, further including:
[0017] For all successful trajectories within the same task cluster, calculate the longest common subsequence of their operation sequences, which serves as the common skeleton of the tasks in that cluster.
[0018] Construct an input / output symbol table to record user intent, input parameters of each tool step, output results, and tool definition;
[0019] Iterate through each tool call in the common skeleton, add the tool definition of the current step to the abstract syntax tree, and scan each input parameter of the current step to analyze the dependency relationship with the output of the previous step.
[0020] Optionally, the step of traversing each tool call in the common skeleton, adding the tool definition of the current step to the abstract syntax tree, and scanning each input parameter of the current step to analyze the dependencies with the output of the previous step, includes:
[0021] If the input parameter of the current step is directly equal to the output of the previous step, then the parameter passing relationship is established in the abstract syntax tree;
[0022] If the input parameter of the current step is a substring of the output of the previous step, then an extractable virtual function is established. The input of the extractable virtual function is the output of the previous step, and the output is the input parameter of the current step.
[0023] If the output of the preceding step is an object or an array, and the input parameter of the current step is an attribute of the object or an array element of the array, then a projection-type virtual function is established.
[0024] If the output of the previous step is natural language and the input parameters of the current step are a set of discrete values with a finite cardinality, then a deterministic mapping relationship between the input and output is established by N-gram sliding window slicing and point mutual information calculation, and encapsulated as a mapping virtual function;
[0025] If the output of the preceding step is natural language and the input parameters of the current step are a set of discrete values with a finite cardinality, making it impossible to establish a deterministic mapping relationship, then the output of the preceding step is used as a feature to establish a categorical virtual function;
[0026] If none of the above applies, a generative virtual function is created, which takes the output of the previous step as a parameter and calls the language model to generate the input of the current step.
[0027] Optional, also includes:
[0028] The implementation of the virtual function is divided into multiple computational levels, which, from high to low, include large parameter language model level, small parameter language model level, traditional classification and regression model level, heuristic algorithm level, and fixed business logic level.
[0029] For the encapsulated virtual functions, a degradation operation is performed sequentially from the higher-level implementation to the lower-level implementation.
[0030] Optionally, for the encapsulated virtual function, the degradation operation is performed sequentially from the higher-level implementation to the lower-level implementation, including:
[0031] For extractable virtual functions, if extraction fails at runtime, generative virtual functions are used instead.
[0032] For mapping virtual functions, if the mapping relationship coverage meets the preset condition when the number of terms is less than the preset threshold, then the mapping implementation is adopted; otherwise, the classification or generation implementation is adopted.
[0033] For categorical virtual functions, if the classification effect does not meet the preset standard, a language model with a small number of parameters is used for implementation. If the preset standard is still not met, fine-tuning is initiated for optimization. If it ultimately fails, a language model with a large number of parameters is used for implementation.
[0034] This specification provides an agent adaptive evolution device with a dual cooperative mechanism, comprising:
[0035] The receiving module is used by the task forward network subsystem to receive user requests;
[0036] The matching module is used by the task forward network subsystem to perform vector retrieval on the user request and query whether the target routine program can be matched in the long-term routine memory.
[0037] The writing module is used to initiate thought chain reasoning, call basic tools to complete the task, and write the execution trajectory into the experience buffer pool when the target routine program cannot be matched in the long-term routine memory.
[0038] An update module is used to scan the execution trajectory in the experience buffer pool when the default mode network subsystem is in the target state, and update the execution trajectory to the long-term routine memory.
[0039] Optional, also includes:
[0040] When the target routine program can be matched in the long-term routine memory, the matched target routine program is directly loaded and executed.
[0041] Optionally, the update module includes:
[0042] The target state includes idle or periodically triggered moments;
[0043] The default mode network subsystem cleans and removes erroneous trajectories from the scanned execution trajectories, and filters out trajectories that successfully complete the task.
[0044] The task objectives of successful trajectories are mapped to a vector space using an embedding model, and clustering algorithms are used to cluster similar task trajectories to obtain similar task clusters.
[0045] Optionally, the update module further includes:
[0046] For all successful trajectories within the same task cluster, calculate the longest common subsequence of their operation sequences, which serves as the common skeleton of the tasks in that cluster.
[0047] Construct an input / output symbol table to record user intent, input parameters of each tool step, output results, and tool definition;
[0048] Iterate through each tool call in the common skeleton, add the tool definition of the current step to the abstract syntax tree, and scan each input parameter of the current step to analyze the dependency relationship with the output of the previous step.
[0049] Optionally, the step of traversing each tool call in the common skeleton, adding the tool definition of the current step to the abstract syntax tree, and scanning each input parameter of the current step to analyze the dependencies with the output of the previous step, includes:
[0050] If the input parameter of the current step is directly equal to the output of the previous step, then the parameter passing relationship is established in the abstract syntax tree;
[0051] If the input parameter of the current step is a substring of the output of the previous step, then an extractable virtual function is established. The input of the extractable virtual function is the output of the previous step, and the output is the input parameter of the current step.
[0052] If the output of the preceding step is an object or an array, and the input parameter of the current step is an attribute of the object or an array element of the array, then a projection-type virtual function is established.
[0053] If the output of the previous step is natural language and the input parameters of the current step are a set of discrete values with a finite cardinality, then a deterministic mapping relationship between the input and output is established by N-gram sliding window slicing and point mutual information calculation, and encapsulated as a mapping virtual function;
[0054] If the output of the preceding step is natural language and the input parameters of the current step are a set of discrete values with a finite cardinality, making it impossible to establish a deterministic mapping relationship, then the output of the preceding step is used as a feature to establish a categorical virtual function;
[0055] If none of the above applies, a generative virtual function is created, which takes the output of the previous step as a parameter and calls the language model to generate the input of the current step.
[0056] Optional, also includes:
[0057] The implementation of the virtual function is divided into multiple computational levels, which, from high to low, include large parameter language model level, small parameter language model level, traditional classification and regression model level, heuristic algorithm level, and fixed business logic level.
[0058] For the encapsulated virtual functions, a degradation operation is performed sequentially from the higher-level implementation to the lower-level implementation.
[0059] Optionally, for the encapsulated virtual function, the degradation operation is performed sequentially from the higher-level implementation to the lower-level implementation, including:
[0060] For extractable virtual functions, if extraction fails at runtime, generative virtual functions are used instead.
[0061] For mapping virtual functions, if the mapping relationship coverage meets the preset condition when the number of terms is less than the preset threshold, then the mapping implementation is adopted; otherwise, the classification or generation implementation is adopted.
[0062] For categorical virtual functions, if the classification effect does not meet the preset standard, a language model with a small number of parameters is used for implementation. If the preset standard is still not met, fine-tuning is initiated for optimization. If it ultimately fails, a language model with a large number of parameters is used for implementation.
[0063] This specification also provides an electronic device, wherein the electronic device includes:
[0064] A processor; and a memory storing computer-executable instructions, which, when executed, cause the processor to perform any of the methods described above.
[0065] This specification also provides a computer-readable storage medium that stores one or more programs that, when executed by a processor, implement any of the methods described above.
[0066] In this invention, when the task forward network subsystem receives a user request, it quickly queries the long-term routine memory using vector retrieval. When a target routine program is matched, it is directly loaded and executed in intuitive mode, significantly reducing inference latency and token consumption. When no match is found, it initiates thought chain inference to complete the task and stores the execution trajectory in the experience buffer pool, ensuring reliable processing of complex tasks. The default mode network subsystem performs a deep review of the execution trajectory in the experience buffer pool when the system is idle or periodically triggered. It extracts high-frequency, high-success-rate operation sequences from unstructured logs using the thought chain crystallization algorithm. After semantic clustering, common skeleton extraction, dependency analysis, and parameter generalization, these sequences are encapsulated into standardized routine programs and stored in the long-term routine memory, enabling the system to... It automatically accumulates experience during use, becoming faster the more it is used. Furthermore, by dividing the implementation of virtual functions into multiple computational levels such as large-parameter language model level, small-parameter language model level, traditional classification and regression model level, heuristic algorithm level, and fixed business logic level, and performing degradation operations from high level to low level in sequence, the inference tasks originally performed by large language models are gradually replaced with deterministic low-overhead atomic operations. For different virtual functions such as extraction type, mapping type, and classification type, mechanisms such as runtime extraction failure fallback, word count and coverage verification, classification effect evaluation, and fine-tuning optimization are set up, which significantly reduces the consumption of computing resources and energy usage, while reducing the accumulation of failures in each tool call, and improving the overall task accuracy and execution stability. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of this application, 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0068] Figure 1 A schematic diagram illustrating the principle of an agent adaptive evolution method with a dual-cooperative mechanism provided in the embodiments of this specification;
[0069] Figure 2 A schematic diagram of the structure of an agent adaptive evolution device with a dual cooperative mechanism provided in the embodiments of this specification;
[0070] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification;
[0071] Figure 4 This is a schematic diagram of a computer-readable medium provided for embodiments of this specification. Detailed Implementation
[0072] The following description is intended to disclose the present invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art. The basic principles of the invention defined in the following description can be applied to other embodiments, modifications, improvements, equivalents, and other technical solutions that do not depart from the spirit and scope of the invention.
[0073] The following is in conjunction with the appendix Figure 1-4 Exemplary embodiments of the invention will be described more fully here. However, exemplary embodiments can be implemented in many forms and should not be construed as limiting the invention to the embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention more comprehensive and complete, and to facilitate a full communication of the inventive concept to those skilled in the art. The same reference numerals in the figures denote the same or similar elements, components, or parts, and therefore repeated descriptions of them are omitted.
[0074] Subject to the technical concept of this invention, the features, structures, characteristics or other details described in a particular embodiment may be combined in one or more other embodiments in a suitable manner.
[0075] In the description of specific embodiments, the features, structures, characteristics, or other details described in this invention are intended to enable those skilled in the art to fully understand the embodiments. However, it is not excluded that those skilled in the art can practice the technical solutions of this invention without one or more of the specific features, structures, characteristics, or other details.
[0076] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0077] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0078] The terms “and / or” or “and / or” include all combinations of any one or more of the listed items.
[0079] Figure 1 This is a schematic diagram illustrating the principle of a dual-cooperative mechanism-based agent adaptive evolution method provided in the embodiments of this specification. The method may include:
[0080] S110: The task forward network subsystem receives a user request;
[0081] S120: The task forward network subsystem performs vector retrieval on the user request to query whether the target routine program can be matched in the long-term routine memory.
[0082] S130: When the target routine program cannot be matched in the long-term routine memory, the task forward network subsystem starts the thought chain reasoning, calls the basic tools to complete the task, and writes the execution trajectory into the experience buffer pool.
[0083] S140: When the default mode network subsystem is in the target state, it scans the execution trajectory in the experience buffer pool and updates the execution trajectory to the long-term routine memory.
[0084] Optional, also includes:
[0085] When the target routine program can be matched in the long-term routine memory, the matched target routine program is directly loaded and executed.
[0086] In the specific implementation of this specification, the dual collaboration mechanism includes TPN (Task Forward Network) - the foreground executor and DMN (Default Mode Network) - the background reflector.
[0087] 1. TPN (Task Forward Network) - Foreground Executor
[0088] Function: Prompt, directly facing the user.
[0089] Decision-making logic:
[0090] Upon receiving the request, the Prompt is first subjected to vector retrieval, which queries the long-term conventional memory.
[0091] Path A (Intuitive Mode): If a Routine with a certain confidence level is matched (convention), load the Routine directly as a "macro tool" for execution (analogous to the automation of the basal kernel).
[0092] Path B (Inference Mode): If no match is found, start slow CoT inference and gradually call basic tools (analogous to deep thinking in the prefrontal cortex).
[0093] Output: The task is completed, and the complete execution trace is written to the ExperienceBuffer.
[0094] 2. DMN (Default Mode Network) - Background Reflector
[0095] Function: Instead of responding directly to the user, it periodically (or when the system is under low load) scans the experience buffer pool.
[0096] Core tasks: Cleaning error logs, summarizing successful experiences, executing crystallization algorithms, and updating the memory bank.
[0097] Optionally, when the default mode network subsystem is in the target state, it scans the execution trajectory in the experience buffer pool and updates the execution trajectory to the long-term routine memory, including:
[0098] The target state includes idle or periodically triggered moments;
[0099] The default mode network subsystem cleans and removes erroneous trajectories from the scanned execution trajectories, and filters out trajectories that successfully complete the task.
[0100] The task objectives of successful trajectories are mapped to a vector space using an embedding model, and clustering algorithms are used to cluster similar task trajectories to obtain similar task clusters.
[0101] In the specific implementation of this specification, let the set of historical trajectories be T={t1,t2, ... ,t n}, where each trajectory t i Contains the sequence {(Step1,Tool1,Args1),...,(Step... m Tool m ,Args m )}.
[0102] Semantic clustering uses an embedding model to map the task objectives in T to a vector space, and then uses the DBSCAN algorithm to cluster them, resulting in clusters of similar tasks C. k .
[0103] Optionally, the default mode network subsystem, when in the target state, scans the execution trajectory in the experience buffer pool and updates the execution trajectory to the long-term routine memory, further including:
[0104] For all successful trajectories within the same task cluster, calculate the longest common subsequence of their operation sequences, which serves as the common skeleton of the tasks in that cluster.
[0105] Construct an input / output symbol table to record user intent, input parameters of each tool step, output results, and tool definition;
[0106] Traverse each tool call in the common skeleton, add the tool definition of the current step to the abstract syntax tree, and scan each input parameter of the current step to analyze the dependency relationship with the output of the previous step.
[0107] In the specific implementation manner of this specification, for cluster C in the common skeleton extraction k , calculate the Longest Common Subsequence (LCS) of the operation sequences of all trajectories. Let the skeleton sequence be P seq = LCS(ti, t j ∈ C k ).
[0108] Construct an input-output symbol table:
[0109] Intent: Generally natural language, the user intent before the call chain (which needs to be completed according to the context). For convenience, define it as FOutput(0)
[0110] F Input(i)(parameter Name): The input of the i-th step tool (function)
[0111] F Output(i): The output of the i-th step tool (function)
[0112] F Definition(i): The definition of the i-th step tool (function)
[0113] For i = 1 to Len(F Definitions) (traverse the call chain)
[0114] Add F Definition(i) to the AST syntax tree
[0115] Scan F Input(i)(parameter Name) and its relationship with F Output(j)(j < i) (for the input of the current function, scan its relationship with the outputs of all previous functions)
[0116] Optionally, after traversing each tool call in the common skeleton, adding the tool definition of the current step to the abstract syntax tree, and scanning each input parameter of the current step to analyze the dependency relationship with the output of the previous step, it includes:
[0117] If the input parameter of the current step is directly equal to the output of the previous step, establish a parameter passing relationship in the abstract syntax tree;
[0118] If the input parameter of the current step is a substring of the output of the previous step, then an extractable virtual function is established. The input of the extractable virtual function is the output of the previous step, and the output is the input parameter of the current step.
[0119] If the output of the preceding step is an object or an array, and the input parameter of the current step is an attribute of the object or an array element of the array, then a projection-type virtual function is established.
[0120] If the output of the previous step is natural language and the input parameters of the current step are a set of discrete values with a finite cardinality, then a deterministic mapping relationship between the input and output is established by N-gram sliding window slicing and point mutual information calculation, and encapsulated as a mapping virtual function;
[0121] If the output of the preceding step is natural language and the input parameters of the current step are a set of discrete values with a finite cardinality, making it impossible to establish a deterministic mapping relationship, then the output of the preceding step is used as a feature to establish a categorical virtual function;
[0122] If none of the above applies, a generative virtual function is created, which takes the output of the previous step as a parameter and calls the language model to generate the input of the current step.
[0123] Optional, also includes:
[0124] The implementation of the virtual function is divided into multiple computational levels, which, from high to low, include large parameter language model level, small parameter language model level, traditional classification and regression model level, heuristic algorithm level, and fixed business logic level.
[0125] For the encapsulated virtual functions, a degradation operation is performed sequentially from the higher-level implementation to the lower-level implementation.
[0126] Optionally, for the encapsulated virtual function, the degradation operation is performed sequentially from the higher-level implementation to the lower-level implementation, including:
[0127] For extractable virtual functions, if extraction fails at runtime, generative virtual functions are used instead.
[0128] For mapping virtual functions, if the mapping relationship coverage meets the preset condition when the number of terms is less than the preset threshold, then the mapping implementation is adopted; otherwise, the classification or generation implementation is adopted.
[0129] For categorical virtual functions, if the classification effect does not meet the preset standard, a language model with a small number of parameters is used for implementation. If the preset standard is still not met, fine-tuning is initiated for optimization. If it ultimately fails, a language model with a large number of parameters is used for implementation.
[0130] In the specific implementation of this specification, if F Input(i) (parameter Name) == F Output(i), F Input(i) (parameter Name) is directly modified in the AST tree. (Note that it needs to be verified that this is effective for all PSeqs.)
[0131] If F Input(i)(parameter Name) is a substring of F Output(j), create a VirtualFunction with F Output(j) as input and F Input(i)(parameter Name) as output. Call the VirtualFunction. Add it to the AST tree and modify F Input(i)(parameter Name) to the output of the Virtual Function. Record in the symbol table that the Virtual Function is of type Extract. (Note that this needs to be verified to be effective for all PSeqs.)
[0132] If FOutput(j) is an object or array, and FInput(i)(parameter Name) is a descendant attribute of FOutput(j) (including array index), create a Virtual Function with FOutput(j) as input and FInput(i)(parameter) as output. Call the Virtual Function. Add it to the AST tree and modify FInput(i)(parameter) to the output of the Virtual Function. Record in the symbol table that the Virtual Function is of type Project. (Note that this needs to be verified to be effective for all PSeqs.)
[0133] If F Output(j) is a natural language, iterate through all samples of F Input(i)(parameter), if it is a discrete set with a finite cardinality (e.g., only 5-50 fixed values such as "High", "Medium", "Low" or "Refund", "Query").
[0134] Perform a 2-gram to 6-gram sliding window slice on FOutput(j). Construct a co-occurrence matrix for all samples of FInput(i)(parameter).
[0135] The co-occurrence matrix is constructed as shown in the table below:
[0136]
[0137] P(w) = 1500
[0138] Calculate the value of each F Input(i)(parameter) one by one, and calculate the PMI, taking the largest one. For example, we get P(DEP_007|w)=500 / 1500=1 / 3. Then, we eliminate candidates according to the 95% threshold (hyperparameter).
[0139] It will likely leave "Human Resources" and "HR". To search for "Human Resources", use the following heuristic algorithm:
[0140] Independent pruning:
[0141] For any two words A (short) and B (long) within a group, where A is contained in B (e.g., A = "human resources", B = "human resources").
[0142] Merge upwards:
[0143] If Freq(A)≈Freq(B) (meaning A almost never appears alone, but always appears with B).
[0144] Judgment: A is a missing part of B. Keep B and delete A.
[0145] Result: Eliminate "Human Resources" and retain "Human Resources" / "Check Human Resources".
[0146] Peeling downwards:
[0147] If Freq(A) > Freq(B) (meaning A often appears independently, while B only appears occasionally).
[0148] Judgment: B contains noise. Keep A, delete B.
[0149] Scenario: Comparing "Human Resources" (A) and "Check Human Resources" (B).
[0150] The phrase "human resources" appeared 500 times, and "check human resources" appeared 100 times (because there was also "call human resources").
[0151] 500》100.
[0152] Result: Eliminate "Check Human Resources", retain "Human Resources".
[0153] Finally, record Human Resources -> DEP_007
[0154] If such a mapping relationship can be found for each F Input(i)(parameter Name), and an effective coverage is defined:
[0155]
[0156] Plot the curve of the number of terms (k) - coverage rate (Cov). If the curve has Cov > 95 when k < 1000
[0157] Then create a Virtual Function with input F Output(j) and output F Input(i)(parameter). Call the Virtual Function. Add it to the AST tree and modify FInput(i)(parameter) to the output of the Virtual Function. Record in the symbol table that the Virtual Function is of the Mapping type.
[0158] If FOutput(j) is a natural language, traverse all samples of F Input(i)(parameter). If it is a discrete set with a finite cardinality (e.g., only 5 - 50 fixed values such as "High", "Medium", "Low" or "Refund", "Query", etc.) and step 4.4 fails due to the large number of terms. Create a Virtual Function and add all F Output(j), (j < i) as parameters of the Virtual Function, with output F Input(i)(parameter).
[0159] Call the Virtual Function. Add it to the AST tree and modify F Input(i)(parameter) to the output of the Virtual Function. Record in the symbol table that the Virtual Function is of the classification type.
[0160] If all the above rule explorations fail, create a Virtual Function and add all F Output(j), (j < i) as parameters of the Virtual Function, with output F Input(i)(parameter). Call the Virtual Function. Add it to the AST tree and modify F Input(i)(parameter) to the output of the Virtual Function. Record in the symbol table that the Virtual Function is of the Generate type.
[0161] Convert the AST into code and save it as a new tool for the LLM Agent to call.
[0162] The calculations are divided into five levels. The higher the level, the more computing power is required and the lower the accuracy.
[0163] L5: Large Parameter LLM
[0164] L4: Small parameter LLM (possibly with LoRa added)
[0165] L3: Traditional classification and regression, such as SVM
[0166] L4: Heuristic Algorithm
[0167] L1: Fixed business logic, such as regular expressions, array or object projection, etc.
[0168] Extract downgrade
[0169] Character class mask transformation
[0170] Input: The historical output sample set Y{y1,y2,...,y} of virtual node V m}
[0171] Action: Define a character mapping function Φ(c) to map raw characters to abstract metacharacters:
[0172] [0-9]→'d'(Digit)
[0173] [AZ]→'U' (Upper)
[0174] [az]→'l' (Lower)
[0175] [\u4e00-\u9fa5]→'C'(Chinese)
[0176] [\t]→'s' (Space)
[0177] Other symbols → are retained as is (e.g., -, :, .).
[0178] Output: Convert the sample set Y into a mask set M = {Φ(y1), ..., Φ(y2)} m )}.
[0179] Example: "ORD-998" → "UUU-ddd"; "ORD-102" → "UUU-ddd".
[0180] Structural consistency entropy value determination
[0181] Objective: To determine whether these data are "regular" enough to be suitable for extraction using regular expressions.
[0182] Calculate: Calculate the Shannon entropy of the mask set M:
[0183]
[0184] Where P(u) is the probability of a certain mask pattern appearing.
[0185] Judgment threshold: Set the threshold δ≈0.1.
[0186] If H(M) < δ (low entropy, indicating that the format of most samples is known, such as UUU-ddd), proceed to the next step.
[0187] If H(M)≥δ (high entropy, indicating a messy format), the L1 downgrade fails, and other levels are tried.
[0188] Core pattern extraction based on Needleman-Wunsch
[0189] Objective: To find the "maximum common architecture" and "variable components" of all samples.
[0190] Actions: 1. Sequence alignment: Select the mode sample in Y as the benchmark and perform global sequence alignment with other samples.
[0191] 2. Difference encoding: If a character at a certain position is the same in all samples, it is marked as a constant.
[0192] If the characters at a certain position are different, but the mask is the same, then mark it as a character class.
[0193] If the character and mask at a certain position are both different, it is marked as a wildcard.
[0194] 3. Run-length encoding compression: merges consecutive identical tokens.
[0195] d,d,d→\d{3} or\d+
[0196] U,U→[AZ]{2}
[0197] Core production regularization R core :
[0198] Example: "ORD-" (constant) + "\d+" (variable) → r "ORD-\d+".
[0199] Boundary anchor point mining based on prefix tree
[0200] Objective: To solve the problem of "where to start extracting". Regular expressions cannot only match values, but also the context.
[0201] Action: 1. Context extraction: For each y i In the original instruction I i Find the position in the middle and extract the first k characters as the Prefix. i The last k characters are used as the Suffix. i .
[0202] 2. Construct a suffix tree
[0203] All Prefix i Insert into the Trie tree in reverse order.
[0204] Find the longest common path starting from the root node → obtain the longest common prefix anchor point A. pre .
[0205] Example: "Query order ORD-1", "View order ORD-2". The common part after reversing the order is "Single Order" → anchor point "Order".
[0206] 3. Construct a prefix tree
[0207] All Suffix i Insert the data into the Trie tree in ascending order.
[0208] Find the longest common suffix anchor point A suf .
[0209] Output boundary regularization:
[0210] R pre =Escape(A pre )
[0211] R suf =Escape(A suf )
[0212] Regular expression synthesis and verification
[0213] Synthesis formula: R final =R pre +“(“+R core +”)”+R suf
[0214] Example: r“order\s*(ORD-\d+)”
[0215] Closed-loop verification: using R final Perform backtesting on the historical dataset. The required F1 score is 1.0. If a false match is found, increase the length k of the context anchor and retry.
[0216] If validation fails, fallback to the generate level Virtual Function.
[0217] If the runtime extract fails, it will fall back to the Generate type.
[0218] The input and output results of the Generate type Virtual Function will be logged so that DMN can continue to extract regular expressions next time.
[0219] Project model downgrade
[0220] Construction of the Golden Sample Corpus
[0221] Input: The historical log stream of virtual node V.
[0222] Action: 1. Data cleaning: Remove x i empty or y i An empty sample.
[0223] 2. Type determination: Parsing x i and y i Data structures (List, Dict, String, Int).
[0224] 3. Sample selection: Select the K most representative samples (e.g., K=20) to form the validation set D. val .
[0225] Filtering strategy: Prioritize retaining boundary values (such as list length of 1, maximum list length, value of 0, etc.).
[0226] Hypothesis space search based on primitives
[0227] Principle: For common list / object operations, the system has a pre-built atomic operator library that attempts to match logic through brute-force search.
[0228] Operator library definition Ω
[0229] Selector:Item(index),Max(field),Min(field)
[0230] Filter:Filter(field,op,value)
[0231] Projection:Map(field)
[0232] Search Algorithm: 1. Input Analysis: If the input X is a List, the output Y is an element in the List or a subfield of an element.
[0233] 2. Traversal Algorithm:
[0234] Assume H1: Try F(x) = x[0], x[-1]. Verify whether D is satisfied. val .
[0235] Assume H2: Iterate through all numeric fields f (such as cpu, memory) in the List.
[0236] Try F(x)=max(x,key=f).
[0237] Try F(x)=min(x,key=f).
[0238] Verify whether (x,y)∈D val , F(x)==y.
[0239] Result: If an operator that meets the conditions is found, the corresponding Python code is generated directly (e.g., max(x,key=lambdai:i['cpu'])).
[0240] Advantages: This process is purely mathematical logic, with zero illusions and no need for models.
[0241] Neural symbol-based program synthesis
[0242] Triggering condition: If the preceding search fails (indicating complex logic, such as involving date calculations or string concatenation).
[0243] action:
[0244] 1. Prompt construction: This constructs D... val The first 5 samples are used as Few-Shot examples.
[0245] Plaintext
[0246] Input:[{“n”:“a”,“v”:10},{“n”:“b”,“v”:20}]→Output:“b”
[0247] Input:[{“n”:“x”,“v”:10},{“n”:“b”,“y”:20}]→Output:“x”
[0248] Write a Python function 'transform(date)' to satisfy these examples.
[0249] 2. Model Inference: A code model with 7B parameters (such as CodeQwen / DeepSeek-Coder-7B) is used to generate N candidate code snippets {C1,...,C...}. n}
[0250] 3. Sandbox execution verification
[0251] In an isolated environment, for each Cj Run D val The remaining samples.
[0252] Calculate the pass rate (Pass@k).
[0253] 4. Result: If there is a code C with a 100% pass rate... best If so, it will be fixed as L4 logic.
[0254] Logical equivalence verification and deployment
[0255] Grayscale operation: Deploy the generated function F to the bypass.
[0256] Consistency check: In the next 1000 real traffic flows, compare F(x) real ) and the original L5 output y real .
[0257] Circuit breaker mechanism: If consistency is less than 100%, roll back and mark the node as "non-degradable".
[0258] If it is determined that it cannot be downgraded, then change the Virtual Function to a Generate model.
[0259] Mapping model downgrade
[0260] Mapping rule topology construction
[0261] Input: A set of mapping pairs D{(Key1,Val1),..., ... m Val m (e.g., {"Human Resources": "DEP_007", "HR": "DEP_007"}).
[0262] Action: 1. Initialize a prefix tree structure with an empty root node.
[0263] 2. Iterate through each key in set D. i :
[0264] Key i It is broken down into a sequence of characters.
[0265] Create or reuse node paths in a Trie number in character order.
[0266] At the terminal node of the path, store the corresponding standard value Val. i .
[0267] 3. State machine optimization: Build failure pointers for nodes in the tree (refer to the logic of the Aho-Corasick algorithm) to support state backtracking when a match fails, ensuring that a match can be completed in a single scan.
[0268] Flow state transition scan
[0269] Runtime logic: Receives user instruction text T as input stream.
[0270] The initialization state pointer Ptr points to the root node of the Trie tree.
[0271] Read T character by character: If the current character matches a child node of Ptr, the pointer moves down, Ptr = Ptr.next(char). If the match fails, the pointer jumps to the node pointed to by the failed pointer.
[0272] Triggered extraction: When the Ptr reaches any termination node, read the Val stored in that node. i .
[0273] According to the longest matching principle, if there is an inclusion relationship between the matching results (such as "human resources" and "human resources"), the matching result with the longer path will be retained first.
[0274] In-situ replacement and reconstruction
[0275] Action: Mark the matched original text fragments as areas to be replaced.
[0276] The corresponding standard value Val i Injected into the input parameters of downstream computing nodes.
[0277] Classification type downgrade
[0278] Initial screening of data formats
[0279] Input: The input set X (natural language) and the output set Y of the historical logs.
[0280] Decision: Check the cardinality of Y.
[0281] If Y is a finite discrete set (e.g., only 5-50 fixed values such as "High", "Medium", "Low", "Refund", "Query"); and there is no substring inclusion relationship (excluding L1) or fixed mapping relationship (excluding L2) between X and Y;
[0282] Conclusion: Meets the characteristics of a classification task; proceed to the next step.
[0283] Feature vectorization
[0284] Action: Convert the input text X into a mathematical vector.
[0285] Methods: Use the TF-IDF (term frequency-inverse document frequency) algorithm or the N-gram algorithm, which do not depend on large models.
[0286] Generation: Transform each log entry into a coordinate point in a high-dimensional sparse space.
[0287] Spatial separability measurement – (key criterion)
[0288] Action: Calculate whether similar samples "cluster together" in space.
[0289] Indicator: Calculate the profile coefficient.
[0290] (Inter-cluster distance - Intra-cluster distance) / Max(both).
[0291] Judgment: If the contour coefficient is greater than the threshold (e.g., 0.6): it indicates that sentences with different intentions are clearly demarcated in space, and is judged as L3. If the coefficient is too low: it indicates that the semantics are mixed, and a shallow model cannot be used, so it regresses to L5.
[0292] Trial training and verification
[0293] Action: Call a lightweight algorithm (such as logistic regression) for fast fitting (time < 1 second).
[0294] Judgment: If the accuracy of K-fold cross-validation is >90%, it is finally confirmed as an L3 node and a model file is generated.
[0295] generate level downgrade
[0296] Use a smaller model, such as 32b or 7b, to evaluate against the larger model and see if it can achieve the same output level as the original larger model. If not, start LoRa fine-tuning, automatically fine-tuning with the sample set as input, and then verify the output quality again. If it still doesn't work, abandon the downgrade.
[0297] In this invention, when the task forward network subsystem receives a user request, it quickly queries the long-term routine memory using vector retrieval. When a target routine program is matched, it is directly loaded and executed in intuitive mode, significantly reducing inference latency and token consumption. When no match is found, it initiates thought chain inference to complete the task and stores the execution trajectory in the experience buffer pool, ensuring reliable processing of complex tasks. The default mode network subsystem performs a deep review of the execution trajectory in the experience buffer pool when the system is idle or periodically triggered. It extracts high-frequency, high-success-rate operation sequences from unstructured logs using the thought chain crystallization algorithm. After semantic clustering, common skeleton extraction, dependency analysis, and parameter generalization, these sequences are encapsulated into standardized routine programs and stored in the long-term routine memory, enabling the system to... It automatically accumulates experience during use, becoming faster the more it is used. Furthermore, by dividing the implementation of virtual functions into multiple computational levels such as large-parameter language model level, small-parameter language model level, traditional classification and regression model level, heuristic algorithm level, and fixed business logic level, and performing degradation operations from high level to low level in sequence, the inference tasks originally performed by large language models are gradually replaced with deterministic low-overhead atomic operations. For different virtual functions such as extraction type, mapping type, and classification type, mechanisms such as runtime extraction failure fallback, word count and coverage verification, classification effect evaluation, and fine-tuning optimization are set up, which significantly reduces the consumption of computing resources and energy usage, while reducing the accumulation of failures in each tool call, and improving the overall task accuracy and execution stability.
[0298] Figure 2 This is a schematic diagram of a dual-cooperative mechanism agent adaptive evolution device provided in an embodiment of this specification. The device may include:
[0299] Receiving module 10 is used for the task forward network subsystem to receive user requests;
[0300] Matching module 20 is used by the task forward network subsystem to perform vector retrieval on the user request and query whether the target routine program can be matched in the long-term routine memory.
[0301] The writing module 30 is used to initiate the thought chain reasoning of the task forward network subsystem when the target routine program cannot be matched in the long-term routine memory bank, call the basic tools to complete the task, and write the execution trajectory into the experience buffer pool.
[0302] The update module 40 is used to scan the execution trajectory in the experience buffer pool when the default mode network subsystem is in the target state, and update the execution trajectory to the long-term routine memory.
[0303] Optional, also includes:
[0304] When the target routine program can be matched in the long-term routine memory, the matched target routine program is directly loaded and executed.
[0305] Optionally, the update module 40 includes:
[0306] The target state includes idle or periodically triggered moments;
[0307] The default mode network subsystem cleans and removes erroneous trajectories from the scanned execution trajectories, and filters out trajectories that successfully complete the task.
[0308] The task objectives of successful trajectories are mapped to a vector space using an embedding model, and clustering algorithms are used to cluster similar task trajectories to obtain similar task clusters.
[0309] Optionally, the update module 40 further includes:
[0310] For all successful trajectories within the same task cluster, calculate the longest common subsequence of their operation sequences, which serves as the common skeleton of the tasks in that cluster.
[0311] Construct an input / output symbol table to record user intent, input parameters of each tool step, output results, and tool definition;
[0312] Iterate through each tool call in the common skeleton, add the tool definition of the current step to the abstract syntax tree, and scan each input parameter of the current step to analyze the dependency relationship with the output of the previous step.
[0313] Optionally, the step of traversing each tool call in the common skeleton, adding the tool definition of the current step to the abstract syntax tree, and scanning each input parameter of the current step to analyze the dependencies with the output of the previous step, includes:
[0314] If the input parameter of the current step is directly equal to the output of the previous step, then the parameter passing relationship is established in the abstract syntax tree;
[0315] If the input parameter of the current step is a substring of the output of the previous step, then an extractable virtual function is established. The input of the extractable virtual function is the output of the previous step, and the output is the input parameter of the current step.
[0316] If the output of the preceding step is an object or an array, and the input parameter of the current step is an attribute of the object or an array element of the array, then a projection-type virtual function is established.
[0317] If the output of the previous step is natural language and the input parameters of the current step are a set of discrete values with a finite cardinality, then a deterministic mapping relationship between the input and output is established by N-gram sliding window slicing and point mutual information calculation, and encapsulated as a mapping virtual function;
[0318] If the output of the preceding step is natural language and the input parameters of the current step are a set of discrete values with a finite cardinality, making it impossible to establish a deterministic mapping relationship, then the output of the preceding step is used as a feature to establish a categorical virtual function;
[0319] If none of the above applies, a generative virtual function is created, which takes the output of the previous step as a parameter and calls the language model to generate the input of the current step.
[0320] Optional, also includes:
[0321] The implementation of the virtual function is divided into multiple computational levels, which, from high to low, include large parameter language model level, small parameter language model level, traditional classification and regression model level, heuristic algorithm level, and fixed business logic level.
[0322] For the encapsulated virtual functions, a degradation operation is performed sequentially from the higher-level implementation to the lower-level implementation.
[0323] Optionally, for the encapsulated virtual function, the degradation operation is performed sequentially from the higher-level implementation to the lower-level implementation, including:
[0324] For extractable virtual functions, if extraction fails at runtime, generative virtual functions are used instead.
[0325] For mapping virtual functions, if the mapping relationship coverage meets the preset condition when the number of terms is less than the preset threshold, then the mapping implementation is adopted; otherwise, the classification or generation implementation is adopted.
[0326] For categorical virtual functions, if the classification effect does not meet the preset standard, a language model with a small number of parameters is used for implementation. If the preset standard is still not met, fine-tuning is initiated for optimization. If it ultimately fails, a language model with a large number of parameters is used for implementation.
[0327] The functions of the apparatus in this embodiment have been described in the above method embodiments. Therefore, for any parts not detailed in this embodiment, please refer to the relevant descriptions in the foregoing embodiments, which will not be repeated here.
[0328] Based on the same inventive concept, embodiments of this specification also provide an electronic device.
[0329] The following describes embodiments of the electronic device of the present invention, which can be considered as specific implementations of the methods and apparatus embodiments of the present invention described above. Details described in the embodiments of the electronic device of the present invention should be considered as supplements to the methods or apparatus embodiments described above; details not disclosed in the embodiments of the electronic device of the present invention can be implemented with reference to the methods or apparatus embodiments described above.
[0330] Figure 3 This is a schematic diagram of an electronic device provided as an embodiment of this specification. Refer to the following... Figure 3 The electronic device 300 according to this embodiment of the present invention will be described. Figure 3 The electronic device 300 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0331] like Figure 3 As shown, the electronic device 300 is presented in the form of a general-purpose computing device. The components of the electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one storage unit 320, a bus 330 connecting different system components (including storage unit 320 and processing unit 310), a display unit 340, etc.
[0332] The storage unit stores program code that can be executed by the processing unit 310, causing the processing unit 310 to perform the steps described in the processing method section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 310 can perform, for example... Figure 1 The steps are shown.
[0333] The storage unit 320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache storage unit 3202, and may further include a read-only memory unit (ROM) 3203.
[0334] The storage unit 320 may also include a program / utility 3204 having a set (at least one) program module 3205, such program module 3205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0335] Bus 330 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0336] Electronic device 300 can also communicate with one or more external devices 400 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable viewers to interact with electronic device 300, and / or with any device that enables electronic device 300 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 350. Furthermore, electronic device 300 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 360. Network adapter 360 can communicate with other modules of electronic device 300 via bus 330. It should be understood that, although... Figure 3 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0337] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described in this invention can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, or network device, etc.) to execute the method described above according to this invention. When the computer program is executed by a data processing device, it enables the computer-readable medium to implement the method described above, i.e.: as... Figure 1 The method shown.
[0338] Figure 4 This is a schematic diagram of a computer-readable medium provided for embodiments of this specification.
[0339] accomplish Figure 1The computer program of the method shown can be stored on one or more computer-readable media. A computer-readable medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0340] The computer-readable storage medium may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0341] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the audience's computing device, partially on the audience's device, as a standalone software package, partially on the audience's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the audience's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0342] In summary, the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that in practice, general-purpose data processing devices such as microprocessors or digital signal processors (DSPs) can be used to implement some or all of the functions of some or all of the components according to the embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0343] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the present invention is not inherently related to any specific computer, virtual device, or electronic device, and various general-purpose devices can also implement the present invention. The above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0344] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0345] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A dual-cooperative mechanism agent adaptive evolution method, applied to an agent system comprising a task-oriented network subsystem and a default mode network subsystem, characterized in that, include: The task forward network subsystem receives user requests; The task forward network subsystem performs vector retrieval on the user request to query whether the target routine program can be matched in the long-term routine memory. When the target routine program cannot be matched in the long-term routine memory, the task forward network subsystem initiates thought chain reasoning, calls basic tools to complete the task, and writes the execution trajectory into the experience buffer pool. When the default mode network subsystem is in the target state, it scans the execution trajectories in the experience buffer pool and updates the execution trajectories to the long-term convention memory. This includes: the default mode network subsystem cleans the scanned execution trajectories, removes erroneous trajectories, and filters out trajectories that successfully complete the task; it uses an embedding model to map the task objectives of successful trajectories to a vector space, and uses a clustering algorithm to cluster similar task trajectories to obtain similar task clusters; for all successful trajectories within the same task cluster, it calculates the longest common subsequence of their operation sequences as the common skeleton of the tasks in that cluster; it constructs an input / output symbol table to record user intent, input parameters of each tool step, output results, and tool definitions; it iterates through each tool call in the common skeleton, adds the tool definition of the current step to the abstract syntax tree, and scans each input parameter of the current step, analyzing the dependency relationship with the output of the previous step. Specifically: if the input parameter of the current step is directly equal to the output of the previous step, then... Parameter passing relationships are established in the abstract syntax tree. If the input parameter of the current step is a substring of the output of the previous step, an extraction-type virtual function is established, where the input of the extraction-type virtual function is the output of the previous step, and the output is the input parameter of the current step. If the output of the previous step is an object or an array, and the input parameter of the current step is an attribute of the object or an array element of the array, a projection-type virtual function is established. If the output of the previous step is natural language, and the input parameter of the current step is a discrete set of values with a finite cardinality, a deterministic mapping relationship between the input and output is established through N-gram sliding window slicing and point mutual information calculation, and encapsulated as a mapping-type virtual function. If the output of the previous step is natural language, and the input parameter of the current step is a discrete set of values with a finite cardinality, and a deterministic mapping relationship cannot be established, the output of the previous step is used as a feature to establish a classification-type virtual function. If none of the above applies, a generative virtual function is established, which uses the output of the previous step as a parameter and calls the language model to generate the input of the current step.
2. The agent adaptive evolution method with a dual cooperative mechanism as described in claim 1, characterized in that, Also includes: When the target routine program can be matched in the long-term routine memory, the matched target routine program is directly loaded and executed.
3. The agent adaptive evolution method with a dual cooperative mechanism as described in claim 1, characterized in that, When the default mode network subsystem is in the target state, it scans the execution trajectory in the experience buffer pool and updates the execution trajectory to the long-term routine memory, and also includes: The target state includes idle or periodically triggered times.
4. The agent adaptive evolution method with a dual cooperative mechanism as described in claim 1, characterized in that, Also includes: The implementation of the virtual function is divided into multiple computational levels, which, from high to low, include large parameter language model level, small parameter language model level, traditional classification and regression model level, heuristic algorithm level, and fixed business logic level. For the encapsulated virtual functions, a degradation operation is performed sequentially from the higher-level implementation to the lower-level implementation.
5. The agent adaptive evolution method with a dual cooperative mechanism as described in claim 4, characterized in that, The aforementioned process for performing a degradation operation on the encapsulated virtual function, sequentially from the higher-level implementation to the lower-level implementation, includes: For extractable virtual functions, if extraction fails at runtime, generative virtual functions are used instead. For mapping virtual functions, if the mapping relationship coverage meets the preset condition when the number of terms is less than the preset threshold, then the mapping implementation is adopted; otherwise, the classification or generation implementation is adopted. For categorical virtual functions, if the classification effect does not meet the preset standard, a language model with a small number of parameters is used for implementation. If the preset standard is still not met, fine-tuning is initiated for optimization. If it ultimately fails, a language model with a large number of parameters is used for implementation.
6. A dual-cooperative mechanism agent adaptive evolution device, applied to an agent system comprising a task forward network subsystem and a default mode network subsystem, characterized in that, include: The receiving module is used by the task forward network subsystem to receive user requests; The matching module is used by the task forward network subsystem to perform vector retrieval on the user request and query whether the target routine program can be matched in the long-term routine memory. The writing module is used to initiate thought chain reasoning, call basic tools to complete the task, and write the execution trajectory into the experience buffer pool when the target routine program cannot be matched in the long-term routine memory. The update module, used by the default mode network subsystem in the target state, scans the execution trajectories in the experience buffer pool and updates the execution trajectories to the long-term routine memory. This includes: the default mode network subsystem cleaning and removing erroneous trajectories from the scanned execution trajectories, and selecting trajectories that successfully complete the task; mapping the task objectives of successful trajectories to a vector space using an embedding model, and clustering similar task trajectories using a clustering algorithm to obtain similar task clusters; for all successful trajectories within the same task cluster, calculating the longest common subsequence of their operation sequences as the common skeleton of the tasks in that cluster; constructing an input / output symbol table to record user intent, input parameters of each tool step, output results, and tool definitions; traversing each tool call in the common skeleton, adding the tool definition of the current step to the abstract syntax tree, and scanning each input parameter of the current step to analyze the dependency relationship with the output of the previous step. Specifically: if the input parameter of the current step is directly equal to the output of the previous step... If the current step's input parameter is a substring of the previous step's output, an extraction-type virtual function is established, where the input of the extraction-type virtual function is the previous step's output, and the output is the current step's input parameter. If the previous step's output is an object or array, and the current step's input parameter is an attribute of the object or an array element of the array, a projection-type virtual function is established. If the previous step's output is natural language, and the current step's input parameter is a set of discrete values with a finite cardinality, a deterministic mapping relationship between the input and output is established through N-gram sliding window slicing and point mutual information calculation, and encapsulated as a mapping-type virtual function. If the previous step's output is natural language, and the current step's input parameter is a set of discrete values with a finite cardinality, and a deterministic mapping relationship cannot be established, the previous step's output is used as a feature to establish a classification-type virtual function. If none of the above applies, a generative virtual function is established, using the previous step's output as a parameter to call the language model to generate the current step's input.
7. An electronic device, wherein, The electronic device includes: A processor; and a memory storing computer-executable instructions, which, when executed, cause the processor to perform the method according to any one of claims 1-5.
8. A computer-readable storage medium, wherein, The computer-readable storage medium stores one or more programs that, when executed by a processor, implement the method of any one of claims 1-5.