Self-evolution intelligent agent system based on double-layer ReAct mechanism and working method
The self-evolving intelligent agent system, through a two-layer ReAct mechanism, draws on historical knowledge to generate an ordered workflow and iteratively selects tools, solving the flexibility and adaptability issues of traditional intelligent agent systems in complex business scenarios, and achieving efficient and accurate self-evolving processing.
Patent Information
- Application Number
- CN202511072285.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-11
AI Technical Summary
Traditional intelligent agent systems lack flexibility and adaptability when dealing with complex and dynamic business scenarios. They are prone to interruptions, and the limited information transmission between task units leads to frequent repetitive errors and low intelligence levels.
The self-evolving intelligent agent system based on a two-layer ReAct mechanism includes a global planning subsystem, a local execution subsystem, and an evolutionary learning subsystem. Through global planning, it draws on historical knowledge to generate an ordered workflow. During local execution, it transmits the process short-term memory stream and cyclically selects target tools. Evolutionary learning updates historical knowledge, forming a closed-loop self-evolution.
It significantly reduces the vulnerability of the workflow, improves processing efficiency and accuracy, achieves self-evolution capabilities, avoids recurring errors, and continuously optimizes global planning capabilities.
Smart Images

Figure CN120930677A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent agent system technology, and in particular to a self-evolving intelligent agent system and its working method based on a two-layer ReAct mechanism. Background Technology
[0002] Intelligent agents are intelligent entities that can autonomously perceive their environment, make decisions, and execute actions. Traditional workflow orchestration systems, such as Apache Airflow and Perfect, and emerging intelligent agent frameworks, such as Lang Chain, have greatly improved the ability to automate tasks.
[0003] However, when dealing with complex and dynamic business scenarios, the relevant technologies are based on predefined directed acyclic graphs to execute tasks. Once an unexpected error is encountered, the task will be interrupted, lacking flexibility and adaptability, which can easily lead to the fragility and failure of the entire task chain. At the same time, the information transmission between task units is limited to the final business data. Every time a new task is planned, it is almost like starting from scratch, resulting in frequent repetitive errors and low intelligence. Summary of the Invention
[0004] In view of the above-mentioned defects or deficiencies in related technologies, it is desirable to provide a self-evolving intelligent agent system and working method based on a two-layer ReAct mechanism, which can have the resilience of local execution, deep context state awareness and global planning self-evolution capability, thereby improving processing efficiency and accuracy.
[0005] In a first aspect, this application provides a self-evolving intelligent agent system based on a two-layer ReAct mechanism, the self-evolving intelligent agent system comprising a global planning subsystem, a local execution subsystem, and an evolutionary learning subsystem connected together;
[0006] The global planning subsystem includes an agent module and a long-term memory module. The agent module is used to receive external tasks and, in conjunction with the historical knowledge stored in the long-term memory module, generate an ordered workflow corresponding to the external tasks. The ordered workflow includes multiple atomic task units.
[0007] The local execution subsystem includes an execution module and a tool module. The execution module is used to execute the local tasks of each atomic task unit, obtain the final short-term memory stream, the final execution report, and the target business result corresponding to the external task. During execution, the previous process short-term memory stream is passed, and the target tool of the tool module is selected in a loop based on the previous process short-term memory stream to execute the current task until the current task is completed or a preset number of loops is reached. The process short-term memory streams constitute the final short-term memory stream.
[0008] Furthermore, the evolutionary learning subsystem includes a knowledge update module, which is used to analyze and process the final short-term memory stream and the final execution report to obtain target knowledge fragments, and use the target knowledge fragments to update the historical knowledge stored in the long-term memory module.
[0009] Optionally, in some embodiments of this application, the proxy module is specifically used to convert the external task into a task vector using a pre-trained text embedding model, and to calculate the cosine similarity between the task vector and the knowledge vector corresponding to the historical knowledge, wherein the knowledge vector corresponding to the historical knowledge is obtained by the conversion of the pre-trained text embedding model when the historical knowledge is stored.
[0010] Knowledge with a cosine similarity greater than a preset similarity threshold and a ranking within a preset range is selected to form a reference knowledge set. The external task and the reference knowledge set are combined into a structured prompt and then input into a pre-trained large language model to obtain a candidate workflow.
[0011] The candidate workflows are verified and corrected to obtain the ordered workflows corresponding to the external tasks.
[0012] Optionally, in some embodiments of this application, the execution module is specifically used to parse the log sequence in the previous process short-term memory stream and extract the current task status, historical attempt records and error information;
[0013] The available toolset of the tool module is evaluated using the extracted results and a pre-trained large language model. The tool with the highest probability of task success is selected as the target tool, and the target tool is used to execute the current task to obtain the execution result.
[0014] The execution result is incrementally updated into the previous process short-term memory stream to obtain a temporary short-term memory stream. It is then determined whether the temporary short-term memory stream satisfies the final goal of the current task. If it does, the temporary short-term memory stream is output to the next task. If it does not, the previous process short-term memory stream is updated to the temporary short-term memory stream.
[0015] Optionally, in some embodiments of this application, the knowledge update module is specifically used to filter the noise logs in the final short-term memory stream and the final execution report, and to use a pre-trained large language model to identify the execution pattern, and to convert the identification result into the target knowledge fragment, wherein the target knowledge fragment is a triple structure containing condition, action and result.
[0016] Optionally, in some embodiments of this application, the knowledge update module is further specifically used to search for knowledge that conflicts with the target knowledge fragment in the historical knowledge. If a conflict exists, knowledge weighted fusion is performed based on the confidence level of the conflicting knowledge and the confidence level of the target knowledge fragment. If no conflict exists, the target knowledge fragment is added to the historical knowledge.
[0017] Secondly, this application provides a method for operating a self-evolving intelligent agent system according to any one of the first aspects, the method comprising:
[0018] Receive external tasks and generate an ordered workflow corresponding to the external tasks by combining historical knowledge. The ordered workflow includes multiple atomic task units.
[0019] Execute the local tasks of each of the atomic task units to obtain the final short-term memory stream, the final execution report, and the target business result corresponding to the external task. During execution, the previous process short-term memory stream is passed and the target tool is selected to execute the current task in a loop based on the previous process short-term memory stream until the current task is completed or a preset number of loops is reached. The process short-term memory streams constitute the final short-term memory stream.
[0020] The final short-term memory stream and the final execution report are analyzed and processed to obtain target knowledge fragments, and the historical knowledge is updated using the target knowledge fragments.
[0021] Optionally, in some embodiments of this application, the generation of an ordered workflow corresponding to the external task by combining historical knowledge includes:
[0022] The external task is converted into a task vector using a pre-trained text embedding model, and the cosine similarity between the task vector and the knowledge vector corresponding to the historical knowledge is calculated. The knowledge vector corresponding to the historical knowledge is obtained by the conversion of the pre-trained text embedding model when the historical knowledge is stored.
[0023] Knowledge with a cosine similarity greater than a preset similarity threshold and a ranking within a preset range is selected to form a reference knowledge set. The external task and the reference knowledge set are combined into a structured prompt and then input into a pre-trained large language model to obtain a candidate workflow.
[0024] The candidate workflows are verified and corrected to obtain the ordered workflows corresponding to the external tasks.
[0025] Optionally, in some embodiments of this application, the selection of a target tool to execute the current task in conjunction with the previous process short-term memory stream loop includes:
[0026] Parse the log sequence in the previous process short-term memory stream and extract the current task status, historical attempt records, and error information;
[0027] The available toolset is evaluated using the extracted results and a pre-trained large language model. The tool with the highest probability of success is selected as the target tool, and the current task is executed using the target tool to obtain the execution result.
[0028] The execution result is incrementally updated into the previous process short-term memory stream to obtain a temporary short-term memory stream. It is then determined whether the temporary short-term memory stream satisfies the final goal of the current task. If it does, the temporary short-term memory stream is output to the next task. If it does not, the previous process short-term memory stream is updated to the temporary short-term memory stream.
[0029] Optionally, in some embodiments of this application, the analysis and processing of the final short-term memory stream and the final execution report to obtain the target knowledge fragment includes:
[0030] The noise logs in the final short-term memory stream and the final execution report are filtered, and the execution pattern is identified using a pre-trained large language model. The identification result is then converted into the target knowledge fragment, which is a triple structure containing condition, action, and result.
[0031] Optionally, in some embodiments of this application, updating the historical knowledge using the target knowledge fragment includes:
[0032] Search the historical knowledge for knowledge that conflicts with the target knowledge fragment. If a conflict exists, perform knowledge weighted fusion based on the confidence levels of the conflicting knowledge and the target knowledge fragment. If no conflict exists, add the target knowledge fragment to the historical knowledge.
[0033] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0034] This application provides a self-evolving intelligent agent system and its working method based on a two-layer ReAct mechanism. During global planning, it can draw upon historical knowledge to generate an ordered workflow corresponding to external tasks. This ordered workflow includes multiple atomic task units, effectively avoiding frequent repetitive errors. When executing local tasks, it can pass on the previous process short-term memory stream and, in conjunction with the previous process short-term memory stream, cyclically select the target tool to execute the current task until the current task is completed or a preset number of iterations is reached. In other words, downstream tasks can know the execution details of upstream tasks and perform self-correction and dynamic strategy adjustment through internal loops, resolving local problems without interrupting the entire workflow. This significantly reduces the fragility of the process. Furthermore, it can automatically learn target knowledge fragments from the final short-term memory stream and the final execution report, updating historical knowledge to form a closed loop. This allows for continuous accumulation of experience, constantly optimizing global planning capabilities, improving processing efficiency and accuracy, and achieving true self-evolution. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the 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.
[0036] Figure 1 A structural block diagram of a self-evolving intelligent agent system based on a two-layer ReAct mechanism is provided for embodiments of this application;
[0037] Figure 2 This is a flowchart illustrating the working method of a self-evolving intelligent agent system based on a two-layer ReAct mechanism, as provided in an embodiment of this application. Detailed Implementation
[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0039] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The following examples illustrate this. Figures 1 to 2This application provides a detailed description of the self-evolving intelligent agent system and its working method based on a two-layer ReAct mechanism, as described in the embodiments of this application.
[0041] Please refer to Figure 1 This is a structural block diagram of a self-evolving intelligent agent system based on a two-layer ReAct mechanism provided in this application embodiment. The self-evolving intelligent agent system 10 includes a global planning subsystem 101, a local execution subsystem 102, and an evolutionary learning subsystem 103 connected to each other. The global planning subsystem 101 corresponds to a macroscopic ReAct loop, and the local execution subsystem 102 corresponds to a microscopic ReAct loop. In actual use, the self-evolving intelligent agent system 10 can be composed of one or more computers. Further, the global planning subsystem 101 includes an agent module 1011 and a long-term memory module 1012. The agent module 1011 can receive an external task T, such as "generating a sales forecast report", and combine it with the historical knowledge stored in the long-term memory module 1012 to generate an ordered workflow W corresponding to the external task T. The ordered workflow W includes multiple atomic task units Action. i 1≤i≤n, for example, an ordered workflow W={Action1,Action2,……,Action n It should be noted that the long-term memory module 1012 is a structured knowledge base that stores successful experiences, lessons learned, and best practices from past tasks. It serves as the knowledge source for the system's global planning and can be stored using methods such as vector databases, graph databases, relational databases, key-value stores, and document databases. The atomic task unit is responsible for completing a specific local task, such as "data cleaning" or "model training".
[0042] The local execution subsystem 102 includes an execution module 1021 and a tool module 1022. The execution module 1021 is capable of executing each atomic task unit (Action). i The local task obtains the final short-term memory stream S. stream Final Execution Report R final and the target business result D corresponding to external task T. nout The target business outcome D nout The processed data files, generated reports, and trained models can be used as direct deliverables of the external task T. During execution, the previous process short-term memory stream is passed along, and the target tool τ of tool module 1022 is selected iteratively based on the previous process short-term memory stream. jThe current task is executed until it is completed or a preset number of iterations is reached. The short-term memory streams of each process are combined to form the final short-term memory stream. It should be noted that the process short-term memory stream is a dynamically updated structured data object that records key metadata during execution. It is the core of achieving local adaptation and context state information flow. In the Dagster framework, the serialization and transfer of memory objects can be achieved through IOManager. In other systems, the short-term memory stream object can be serialized into JSON or Pickle format and stored in a shared file system. Alternatively, it can be transferred through in-memory databases such as Redis. The tool τ is a function or application program interface (API) that can be called within the atomic task unit Action to perform specific operations, such as RobustCleanTool or FastCleanTool.
[0043] Furthermore, the evolutionary learning subsystem 103 includes a knowledge update module 1031, which is capable of updating the final short-term memory stream S. stream and final execution report R final The system analyzes and processes the data to obtain the target knowledge fragment ΔK. This ΔK is then used to update the historical knowledge stored in the long-term memory module 1012, which is then used for planning future tasks, thus achieving a closed-loop self-evolution of the system. It should be noted that the algorithm for extracting the target knowledge fragment ΔK can be either pattern matching based on a rule engine or more advanced natural language processing methods, such as using a large language model to extract and summarize information, automatically generating high-quality knowledge. Furthermore, the global planning subsystem 101, the local execution subsystem 102, and the evolutionary learning subsystem 103 can communicate via function calls, frameworks such as HTTP RESTful API and gRPC, or decoupled communication via message queues such as RabbitMQ and Kafka.
[0044] In some embodiments of this application, the agent module 1011 is specifically able to first utilize a pre-trained text embedding model Φ embed Transform the external task T into a task vector v T And calculate the task vector v T The knowledge vector v corresponding to historical knowledge K Cosine similarity between sim(v) T, v K )=(v T ·v K ) / (|v T ||v K |), where the knowledge vector v corresponds to historical knowledge. KA pre-trained text embedding model Φ for storing historical knowledge. embed The transformation obtained ensures that the task vector v is... T With knowledge vector v K Within a unified semantic space, the text embedding model Φ embed Training is a mature technique, so I won't go into details. Then, we select the cosine similarity sim(v) T, v K Knowledge items that are greater than a preset similarity threshold and whose ranking falls within a preset range are used to form a reference knowledge set K. ref For example, the preset similarity threshold can be 0.7, the preset ranking range can be within 3, and the external task T and the reference knowledge set K are... ref After being combined into structured prompts Q, they are input into a pre-trained large language model Φ. LLM Obtain candidate workflow W candidate Large Language Model Φ LLM Training is a mature technique, so I won't go into details. The structured prompt Q follows a preset template to guide the large language model to perform formatted output. For example, the structured prompt Q can be:
[0045]
[0046] Based on the above information, please generate a YAML-formatted workflow consisting of multiple atomic task units.
[0047] Furthermore, for candidate workflow W candidate Verification and correction are performed to obtain the ordered workflow W corresponding to the external task T. For example, verification includes, but is not limited to, syntax verification and logic verification. Syntax verification can check candidate workflows W. candidate Whether it conforms to the system's predefined format specifications, such as whether it is a valid YAML format, whether key fields are missing, and logical validation can check the rationality of the workflow content, such as ensuring that each Action declared in the workflow exists in the system and that the data dependencies between Actions are valid.
[0048] In some embodiments of this application, the execution module 1021 is specifically able to first parse the log sequence in the previous process short-term memory stream and extract the current task status, historical attempt records, and error information. For example, the short-term memory stream adopts a minimalist design of plain text logs, including a timestamp text log sequence L, a session identifier (session_id), and a stage identifier (stage). The timestamp text log sequence L consists of natural language log entries recorded in chronological order, the session identifier (session_id) is used to uniquely identify the current workflow session, and the stage identifier (stage) is the identifier of the current execution stage. For the i-th Action in the workflow... iInput it into short-term memory Set as the output short-term memory of the previous action Right now The previous process short-term memory stream contains process metadata such as execution strategy, problems encountered, and solutions adopted. Then, the extracted results and a pre-trained large language model Φ are used... LLM The available toolset M = {τ1, τ2, ..., τ2} for tool module 1022 m The tool with the highest probability of success P is selected as the target tool τ through evaluation. j , 1≤j≤m, that is Exclude tools marked as failed or unavailable in the current short-term memory stream and utilize the target tool τ. j Execute the current task and obtain the execution result R. j The execution result R j It can include the execution success or failure status, as well as specific business data or error information. Furthermore, the execution result R... j Incrementally update the previous process short-term memory stream to obtain the temporary short-term memory stream. And determine the temporary short-term memory stream. Does it meet the ultimate goal of the current task, such as verifying R? j.status Whether it is a successful state, or for example, using large language models for analysis. The log content is used to determine whether the Action has been completed. i The predefined objective description can be used, such as cleaning data files and removing columns with more than 50% missing values, or checking whether the obtained results meet preset constraints such as quality, time, and resources. If they are met, the inner loop ends, and a temporary short-term memory stream is output to the next task. Right now If the condition is not met, then the short-term memory stream from the previous process will be used. Updated to Temporary Short-Term Memory stream And return to the target selection tool τ j The process continues with the internal loop.
[0049] In some embodiments of this application, the knowledge update module 1031 is specifically capable of filtering the final short-term memory stream S. stream and final execution report R final The noisy logs in the text are analyzed, and a pre-trained large language model Φ is utilized. LLMThe system identifies the execution pattern and converts the identification result into a target knowledge fragment ΔK. This target knowledge fragment ΔK is a triple structure containing a condition, action, and result. For example, it extracts structured knowledge such as "When data contains a specific format, using RobustCleanTool is the strategy with the highest success rate." Furthermore, the knowledge update module 1031 can also specifically search for knowledge that conflicts with the target knowledge fragment in historical knowledge. If a conflict exists, it performs knowledge weighted fusion based on the confidence levels of the conflicting knowledge and the target knowledge fragment. If no conflict exists, it directly adds the target knowledge fragment to historical knowledge.
[0050] The self-evolving intelligent agent system based on the two-layer ReAct mechanism provided in this application can generate an ordered workflow corresponding to external tasks by drawing on historical knowledge during global planning. This ordered workflow includes multiple atomic task units, effectively avoiding frequent repetitive errors. When executing local tasks, it can pass on the previous process short-term memory stream and combine it with the previous process short-term memory stream to cyclically select the target tool to execute the current task until the current task is completed or the preset number of cycles is reached. In other words, downstream tasks can know the execution details of upstream tasks and perform self-correction and dynamic strategy adjustment through internal loops, solving local problems without interrupting the entire workflow. This significantly reduces the fragility of the process. Furthermore, it can automatically learn target knowledge fragments from the final short-term memory stream and the final execution report and update historical knowledge to form a closed loop. This allows for continuous accumulation of experience, continuous optimization of global planning capabilities, and improvement of processing efficiency and accuracy, achieving true self-evolution.
[0051] Based on the foregoing embodiments, this application provides a method for operating a self-evolving intelligent agent system, which can be used for... Figure 1 The self-evolving intelligent agent system 10 in the corresponding embodiment. Please refer to... Figure 2 This is a flowchart illustrating a working method for a self-evolving intelligent agent system based on a two-layer ReAct mechanism, provided in an embodiment of this application. The working method specifically includes the following steps:
[0052] S101 receives external tasks and generates an ordered workflow corresponding to the external tasks by combining historical knowledge. The ordered workflow includes multiple atomic task units.
[0053] For example, in this embodiment, the external task can first be converted into a task vector using a pre-trained text embedding model, and the cosine similarity between the task vector and the knowledge vector corresponding to historical knowledge can be calculated. The knowledge vector corresponding to historical knowledge is obtained by the pre-trained text embedding model during historical knowledge storage. Then, knowledge with a cosine similarity greater than a preset similarity threshold and a ranking within a preset range is selected to form a reference knowledge set. The external task and the reference knowledge set are combined into a structured prompt and input into a pre-trained large language model to obtain candidate workflows. Furthermore, the candidate workflows are verified and corrected to obtain an ordered workflow corresponding to the external task.
[0054] S102 executes the local tasks of each atomic task unit to obtain the final short-term memory stream, the final execution report, and the target business results corresponding to the external tasks.
[0055] During execution, the previous process short-term memory stream is passed on, and the target tool is selected to execute the current task in a loop based on the previous process short-term memory stream until the current task is completed or the preset number of loops is reached. The process short-term memory streams are combined to form the final short-term memory stream.
[0056] For example, in this embodiment, the log sequence in the previous process short-term memory stream can be parsed first, and the current task state, historical attempt records, and error information can be extracted. Then, the extracted results and a pre-trained large language model are used to evaluate the available toolset, select the tool with the highest success probability as the target tool, and use the target tool to execute the current task to obtain the execution result. Subsequently, the execution result is incrementally updated into the previous process short-term memory stream to obtain a temporary short-term memory stream, and it is determined whether the temporary short-term memory stream meets the final goal of the current task. If it does, the temporary short-term memory stream is output to the next task; if it does not, the previous process short-term memory stream is updated into a temporary short-term memory stream.
[0057] S103, analyze and process the final short-term memory stream and the final execution report to obtain the target knowledge fragment, and use the target knowledge fragment to update the historical knowledge.
[0058] For example, embodiments of this application can filter noisy logs in the final short-term memory stream and the final execution report, and use a pre-trained large language model to identify execution patterns, converting the identification results into target knowledge fragments. These target knowledge fragments are triple structures containing conditions, actions, and results. Furthermore, embodiments of this application can also search for knowledge that conflicts with the target knowledge fragment in historical knowledge. If a conflict exists, knowledge weighting fusion is performed based on the confidence levels of the conflicting knowledge and the target knowledge fragment. If no conflict exists, the target knowledge fragment is added to historical knowledge.
[0059] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0060] The self-evolving intelligent agent system based on a two-layer ReAct mechanism provided in this application has the following working method: During global planning, it can draw on historical knowledge to generate an ordered workflow corresponding to external tasks. This ordered workflow includes multiple atomic task units, effectively avoiding frequent repetitive errors. When executing local tasks, it can pass on the previous process short-term memory stream and combine it with the previous process short-term memory stream to cyclically select the target tool to execute the current task until the current task is completed or a preset number of cycles is reached. In other words, downstream tasks can know the execution details of upstream tasks and perform self-correction and dynamic strategy adjustment through internal loops. This solves local problems without interrupting the entire workflow, significantly reducing the fragility of the process. Furthermore, it can automatically learn target knowledge fragments from the final short-term memory stream and the final execution report and update historical knowledge to form a closed loop. This allows for continuous accumulation of experience, continuous optimization of global planning capabilities, and improvement of processing efficiency and accuracy, achieving true self-evolution.
[0061] In another aspect, embodiments of this application provide a computer-readable storage medium for storing program code for executing the aforementioned... Figure 2 Any implementation method in the corresponding embodiment.
[0062] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0063] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed between each other can be through some interfaces, indirect coupling or communication connection between devices or modules, and can be electrical, mechanical, or other forms. Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0064] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more units can be integrated into one module. The integrated unit can be implemented in hardware or as a software functional unit. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0065] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the working methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0066] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0067] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A self-evolving intelligent agent system based on a two-layer ReAct mechanism, characterized in that, The self-evolving intelligent agent system includes a global planning subsystem, a local execution subsystem, and an evolutionary learning subsystem that are interconnected. The global planning subsystem includes an agent module and a long-term memory module. The agent module is used to receive external tasks and, in conjunction with the historical knowledge stored in the long-term memory module, generate an ordered workflow corresponding to the external tasks. The ordered workflow includes multiple atomic task units. The local execution subsystem includes an execution module and a tool module. The execution module is used to execute the local tasks of each atomic task unit, obtain the final short-term memory stream, the final execution report, and the target business result corresponding to the external task. During execution, the previous process short-term memory stream is passed, and the target tool of the tool module is selected in a loop based on the previous process short-term memory stream to execute the current task until the current task is completed or a preset number of loops is reached. The process short-term memory streams constitute the final short-term memory stream. Furthermore, the evolutionary learning subsystem includes a knowledge update module, which is used to analyze and process the final short-term memory stream and the final execution report to obtain target knowledge fragments, and use the target knowledge fragments to update the historical knowledge stored in the long-term memory module.
2. The self-evolving intelligent agent system according to claim 1, characterized in that, The proxy module is specifically used to convert the external task into a task vector using a pre-trained text embedding model, and to calculate the cosine similarity between the task vector and the knowledge vector corresponding to the historical knowledge. The knowledge vector corresponding to the historical knowledge is obtained by the conversion of the pre-trained text embedding model when the historical knowledge is stored. Knowledge with a cosine similarity greater than a preset similarity threshold and a ranking within a preset range is selected to form a reference knowledge set. The external task and the reference knowledge set are combined into a structured prompt and then input into a pre-trained large language model to obtain a candidate workflow. The candidate workflows are verified and corrected to obtain the ordered workflows corresponding to the external tasks.
3. The self-evolving intelligent agent system according to claim 1, characterized in that, The execution module is specifically used to parse the log sequence in the previous process short-term memory stream and extract the current task status, historical attempt records and error information; The available toolset of the tool module is evaluated using the extracted results and a pre-trained large language model. The tool with the highest probability of task success is selected as the target tool, and the target tool is used to execute the current task to obtain the execution result. The execution result is incrementally updated into the previous process short-term memory stream to obtain a temporary short-term memory stream. It is then determined whether the temporary short-term memory stream satisfies the final goal of the current task. If it does, the temporary short-term memory stream is output to the next task. If it does not, the previous process short-term memory stream is updated to the temporary short-term memory stream.
4. The self-evolving intelligent agent system according to any one of claims 1 to 3, characterized in that, The knowledge update module is specifically used to filter the noise logs in the final short-term memory stream and the final execution report, and to identify the execution pattern using a pre-trained large language model, and to convert the identification result into the target knowledge fragment, which is a triple structure containing condition, action and result.
5. The self-evolving intelligent agent system according to claim 4, characterized in that, The knowledge update module is also specifically used to search for knowledge that conflicts with the target knowledge fragment in the historical knowledge. If a conflict exists, knowledge weighting and fusion are performed based on the confidence level of the conflicting knowledge and the confidence level of the target knowledge fragment. If no conflict exists, the target knowledge fragment is added to the historical knowledge.
6. A method of operating the self-evolving intelligent agent system according to any one of claims 1 to 5, characterized in that, The working method includes: Receive external tasks and generate an ordered workflow corresponding to the external tasks by combining historical knowledge. The ordered workflow includes multiple atomic task units. Execute the local tasks of each of the atomic task units to obtain the final short-term memory stream, the final execution report, and the target business result corresponding to the external task. During execution, the previous process short-term memory stream is passed and the target tool is selected to execute the current task in a loop based on the previous process short-term memory stream until the current task is completed or a preset number of loops is reached. The process short-term memory streams constitute the final short-term memory stream. The final short-term memory stream and the final execution report are analyzed and processed to obtain target knowledge fragments, and the historical knowledge is updated using the target knowledge fragments.
7. The working method according to claim 6, characterized in that, The step of generating an ordered workflow corresponding to the external task by combining historical knowledge includes: The external task is converted into a task vector using a pre-trained text embedding model, and the cosine similarity between the task vector and the knowledge vector corresponding to the historical knowledge is calculated. The knowledge vector corresponding to the historical knowledge is obtained by the conversion of the pre-trained text embedding model when the historical knowledge is stored. Knowledge with a cosine similarity greater than a preset similarity threshold and a ranking within a preset range is selected to form a reference knowledge set. The external task and the reference knowledge set are combined into a structured prompt and then input into a pre-trained large language model to obtain a candidate workflow. The candidate workflows are verified and corrected to obtain the ordered workflows corresponding to the external tasks.
8. The working method according to claim 6, characterized in that, The step of combining the previous process short-term memory stream loop to select the target tool to execute the current task includes: Parse the log sequence in the previous process short-term memory stream and extract the current task status, historical attempt records, and error information; The available toolset is evaluated using the extracted results and a pre-trained large language model. The tool with the highest probability of success is selected as the target tool, and the current task is executed using the target tool to obtain the execution result. The execution result is incrementally updated into the previous process short-term memory stream to obtain a temporary short-term memory stream. It is then determined whether the temporary short-term memory stream satisfies the final goal of the current task. If it does, the temporary short-term memory stream is output to the next task. If it does not, the previous process short-term memory stream is updated to the temporary short-term memory stream.
9. The working method according to any one of claims 6 to 8, characterized in that, The analysis and processing of the final short-term memory stream and the final execution report to obtain the target knowledge fragment includes: The noise logs in the final short-term memory stream and the final execution report are filtered, and the execution pattern is identified using a pre-trained large language model. The identification result is then converted into the target knowledge fragment, which is a triple structure containing condition, action, and result.
10. The working method according to claim 9, characterized in that, The step of updating the historical knowledge using the target knowledge fragment includes: Search the historical knowledge for knowledge that conflicts with the target knowledge fragment. If a conflict exists, perform knowledge weighted fusion based on the confidence levels of the conflicting knowledge and the target knowledge fragment. If no conflict exists, add the target knowledge fragment to the historical knowledge.