Agent system optimization method and device based on intelligent fault analysis and cross-generation knowledge inheritance
By deploying lightweight log probes, reinforcement learning models, and agent family trees, the problem of knowledge transmission breakage during agent system version iterations was solved, enabling efficient fault analysis and cross-generational knowledge inheritance of agent systems, thereby improving system stability and development efficiency.
Patent Information
- Application Number
- CN202511714473.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-11-21
AI Technical Summary
Existing intelligent agent systems generally face the problem of knowledge transmission disruption during version iteration. New versions of the system cannot effectively inherit the core experience and knowledge accumulated by previous versions, resulting in low development efficiency.
Deploy lightweight log probes to capture abnormal signals in real time, build a tool benefit prediction model based on reinforcement learning, establish an agent genealogy map and version evolution relationship tree, deploy a catastrophic forgetting blocker, realize the automatic inheritance of core memories and the discarding of invalid knowledge by new agents, and dynamically extract and inject functional modules when key capability degradation is detected.
It significantly improves the fault response efficiency and version stability of intelligent agent systems, reduces operation and maintenance costs, and maintains the high fidelity of knowledge and the continuous evolution capability of the system.
Smart Images

Figure CN121187845B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to an intelligent agent system optimization method and device based on intelligent fault analysis and cross-generation knowledge inheritance. BACKGROUND
[0002] Existing intelligent agent systems usually adopt rule-based decision mechanisms or machine learning models to realize intelligent functions, and continuously train and optimize to improve system performance. Traditional intelligent agent systems are only suitable for single tasks or relatively static environments and can effectively complete predefined target tasks. At the same time, some methods based on experience replay and transfer learning have appeared in the prior art to improve the learning efficiency of intelligent agents, which has improved the performance of intelligent agent systems to some extent.
[0003] However, with the increasing complexity of application scenarios and the continuous evolution and improvement of intelligent agents, traditional intelligent agent systems have exposed many key problems in actual operation. Intelligent agent systems generally face the problem of knowledge inheritance rupture during version iteration, and new version systems often cannot effectively inherit the core experience and knowledge accumulated by the previous generation system, resulting in the need for the system to relearn the skills it has mastered, greatly reducing development efficiency.
[0004] Based on this, the present application provides an intelligent agent system optimization method and device based on intelligent fault analysis and cross-generation knowledge inheritance. SUMMARY
[0005] In order to improve the problem that intelligent agent systems generally face the problem of knowledge inheritance rupture during version iteration, and new version systems often cannot effectively inherit the core experience and knowledge accumulated by the previous generation system, resulting in the need for the system to relearn the skills it has mastered, greatly reducing development efficiency, the present application provides an intelligent agent system optimization method and device based on intelligent fault analysis and cross-generation knowledge inheritance.
[0006] In a first aspect, the present application provides an intelligent agent system optimization method based on intelligent fault analysis and cross-generation knowledge inheritance, which adopts the following technical solution: comprising:
[0007] Deploy a lightweight log probe to capture abnormal signals in real time during the interaction of intelligent agents, and provide a data basis for fault analysis;
[0008] According to the abnormal signals, a tool benefit prediction model based on reinforcement learning is constructed, and a tool improvement proposal is automatically generated when the failure rate of a specific scene exceeds a preset threshold;
[0009] Establish an intelligent agent genealogy atlas, combine fault analysis to construct a version evolution relationship tree, realize automatic inheritance of core memories and rejection of invalid knowledge of new intelligent agents;
[0010] Deploying a catastrophic forgetting blocker based on the tool improvement proposal and the agent pedigree map, dynamically extracting corresponding function modules from the agent pedigree map for injection when detecting key capability degradation.
[0011] Preferably, the multi-deployment lightweight log probe captures abnormal signals in real time during agent interaction and provides a data basis for fault analysis, including:
[0012] Defining abnormal signal types, uniformly structuring abnormal signal templates into JSON representations, the abnormal signal types including interface timeout, state jump exception, abnormal return value, high-frequency retry / reentry, and null behavior, each abnormal signal type triggering a corresponding conditional formula;
[0013] Based on the abnormal signal types, deploying a probe module composed of logging, watchdog, and hook, injecting into the Agent microservice through a startup script, wherein the watchdog calculates an abnormal score based on the trigger conditions of the abnormal signal types;
[0014] Using asynchronous channels to collect log data, formatting and adding Agent and timestamp identifiers through unified services, filtering, time window aggregation, and abnormal signal count statistics on log data through Flink pipelines, and triggering an alarm when the number of abnormal signals in a unit time window exceeds a preset threshold;
[0015] Converting processed log data into a standardized structure containing timestamps, event types, and entities, embedding knowledge graph triples through entity extraction and relationship matching, mapping event sequence trajectories to agent task flowchart node paths, and using Embedding technology to vectorize trajectories for clustering analysis, forming a fault feature library.
[0016] Preferably, after deploying the probe module composed of logging, watchdog, and hook based on the abnormal signal types, it further includes:
[0017] Receiving high-dimensional unstructured raw log data generated during agent interaction through the logging component, converting it into structured log entries containing timestamps, interaction objects, behavior types, and key parameters through preset field extraction rules, and storing the structured log entries in JSON format;
[0018] The watchdog component inputs the structured log entries, triggers conditions based on the abnormal signal type, scans the log fields row by row through the rule matching engine, assigns corresponding weight coefficients to events that meet interface timeout, state jump anomaly and other conditions, calculates the abnormal signal comprehensive score through weighted summation, and marks as a suspected abnormal event when the comprehensive score exceeds the set threshold;
[0019] The hook component embeds the core interaction process of the agent microservice through the function hook mechanism, captures the call stack information, context environment variables and state transition trajectory in real time, and supplements the corresponding structured log entries as metadata to form enhanced log records containing complete context;
[0020] The probe module is loaded through the initialization script during the startup phase of the agent microservice, and the logging, watchdog and hook components realize data flow through the internal message queue. When the watchdog component outputs a suspected abnormal event, the enhanced log records of the hook component are pushed to the unified collection service in real time through the local cache channel for subsequent fault analysis.
[0021] Preferably, the tool benefit prediction model based on reinforcement learning is constructed according to the abnormal signal, and tool improvement proposals are automatically generated when the failure rate of a specific scene exceeds a preset threshold, including:
[0022] Collect the execution data of the agent tool in different scenes, including normal running state data, abnormal fault state data, performance degradation process data and cross-generation transfer learning data;
[0023] An efficiency evaluation index system is established, including fault detection accuracy, system response time, resource utilization efficiency and knowledge inheritance integrity. After cleaning and standardizing the execution data, the execution data is divided into training set, validation set and test set;
[0024] Based on the efficiency evaluation index system, a reinforcement learning model is constructed, the state space is the current running state of the agent tool, and the action space is the tool optimization adjustment strategy. The reward function of the reinforcement learning model considers the execution benefit, operation safety and resource consumption cost. The policy network is updated alternately through offline training and online optimization. The offline training uses experience replay and target network mechanism to improve training stability. The online optimization realizes continuous enhancement of the strategy through strategy fine-tuning and dynamic reward adjustment;
[0025] A real-time monitoring system is established to track the tool failure rate, which is the ratio of the number of tool call failures to the total number of calls within a certain time window. A sliding time window and an exponential weighted average moving method are used to smooth the failure rate. The failure rate threshold is dynamically adjusted by combining the historical failure rate mean and standard deviation. When the smoothed failure rate exceeds the dynamically adjusted threshold, the tool improvement process is triggered.
[0026] Based on the reinforcement learning model, the failure reason is analyzed. The key abnormal segment in the tool execution trajectory is identified by the risk accumulation measurement function. The structured tool improvement proposal is automatically generated based on historical successful cases, and the priority is sorted according to the potential improvement of execution efficiency and the cost of resource consumption.
[0027] Preferably, in the reinforcement learning model based on the benefit evaluation index system, the state space is the current running state of the agent tool, and the action space is the tool optimization adjustment strategy, further comprising:
[0028] The state space and action space of the reinforcement learning model are defined. The state space includes real-time running state parameters of the agent tool, including tool call frequency, resource occupancy rate, scene feature vector and historical failure rate. The action space is a limited set of tool parameter adjustment, interface adaptation optimization and process reconstruction strategy.
[0029] A structured reward function is designed, which takes execution efficiency as the core indicator, and weightedly combines operation safety measurement and resource consumption cost. The execution efficiency is quantitatively evaluated by task completion rate and efficiency improvement amount. The operation safety is measured by the number of abnormal rollbacks and data consistency check results. The resource consumption cost is calculated by CPU occupancy rate, memory usage rate and network bandwidth consumption.
[0030] An alternating update strategy network training mechanism is adopted. In the offline training stage, historical state-action-reward samples stored in the experience replay pool are used to minimize the loss function by periodically synchronizing parameters of the target network, improving the stability of model training. In the online optimization stage, the current action value is evaluated by the advantage function, and the policy network parameters are optimized in real time by combining the dynamic reward adjustment mechanism. The advantage function is calculated by the difference between the action value function and the state value function, which is used to measure the advantage degree of the current action relative to the average strategy.
[0031] According to the actual execution data of the agent tool in different scenarios, the weighting coefficients of each indicator in the reward function are dynamically adjusted. The policy network parameters are updated by gradient descent method to maximize the expected cumulative discounted reward, so as to realize the iterative improvement of tool benefit prediction accuracy and the autonomous evolution of optimization strategy.
[0032] Preferably, the establishment of the agent family genealogy map, combined with fault analysis, constructs a version evolution relationship tree, realizes the automatic inheritance of core memories and the rejection of invalid knowledge of new agents, including:
[0033] The agent instance set is scanned to extract metadata information, including creation time, parent ID, version identifier and functional characteristics, an inheritance relationship network between agents is constructed based on the metadata information, the shortest inheritance distance between agents is calculated and a genealogy inheritance graph is generated;
[0034] A version evolution relationship tree is constructed, a mixed neural network is used to process version feature sequences, version change matrices and performance index matrices, the mixed neural network includes a long short-term memory network, a one-dimensional convolutional neural network and a Transformer self-attention mechanism, to extract version time sequence evolution features, local change features and global dependency relationships, and calculate version similarity after fusing the features;
[0035] The execution trajectory data and policy network parameters of the old version agent in a typical task scenario are collected, the discounted cumulative reward value of the trajectory is calculated, the high-reward trajectory subsequence and the corresponding policy parameters are selected to construct a policy feature set, the behavior preference stability features of the old version agent are extracted through a knowledge distillation method, and the stable knowledge representation set is input into a policy transfer mapping function to generate the initialization parameters of the new agent policy network;
[0036] A multi-task evaluation environment is constructed, the extracted policy and stable knowledge unit are deployed and tested, the cumulative reward drop rate, behavior deviation metric and failure rate increase in the new task are collected, and when any index exceeds a preset threshold, the corresponding knowledge unit is determined as invalid knowledge and is rejected.
[0037] Preferably, after the agent instance set is scanned to extract metadata information, the method further includes:
[0038] When a new agent version is released, its metadata information is collected, the node and edge relationship in the genealogy inheritance graph is updated based on the shortest inheritance distance algorithm, the time sequence evolution features, local change features and global dependency relationships of the new version are processed through the mixed neural network, the comprehensive similarity with the historical version is calculated, the historical version with a similarity higher than a threshold is marked as a kinship version, and a branch node of the version evolution relationship tree is constructed;
[0039] The agent core knowledge units are classified according to the functional dimension, and the feature labels of each knowledge unit are extracted; a multi-dimensional index structure is constructed based on a graph database, wherein the main index is the mapping relationship between the knowledge unit ID and the functional classification, and the secondary index includes the performance vector index, the version association index and the invalid state index;
[0040] When the new intelligent agent completes knowledge inheritance, an index update process is automatically triggered: for the inherited core knowledge unit, an association record of the current version ID is added in the version association index; for the knowledge unit marked as invalid by the invalid knowledge judgment function, the state is updated to abandoned in the invalid state index, and a failure reason note is added in the pedigree map; an index optimization task is periodically executed to delete redundant association records and abandoned knowledge unit indexes that have not been retrieved for a long time, thereby improving retrieval efficiency;
[0041] Based on the constructed multi-dimensional index structure, two retrieval modes are provided: precise retrieval according to functional classification, which supports quick positioning of candidate knowledge units through functional tags; fuzzy retrieval according to performance characteristics, which returns a list of knowledge units with the highest matching degree to the target feature vector by combining a semantic similarity algorithm; the retrieval results are sorted according to the principle of priority of kinship versions, and historical knowledge units with high similarity to the current version are preferentially displayed to assist the catastrophic forgetting blocker in quickly extracting adaptive modules.
[0042] Preferably, the deployment of the catastrophic forgetting blocker dynamically extracts corresponding functional modules from the intelligent agent pedigree map for injection when key capability degradation is detected, including:
[0043] A multi-dimensional capability evaluation and monitoring system covering the core functions of the intelligent agent system is established, and task execution logs, state transition information, strategy action distribution, system response time and resource utilization under standard task scenarios are collected as performance observation values. The performance benchmark data of historical versions under the same task are called as comparison baselines, and the degradation rate of each performance indicator is calculated. When the degradation rate of any indicator exceeds a preset threshold, a capability degradation alarm is triggered;
[0044] Based on the capability degradation alarm, a degraded capability feature vector is extracted, and the degraded capability feature vector is input into the intelligent agent pedigree database as a retrieval condition. The semantic similarity between the degraded capability feature vector and the performance embedding vector of the historical version functional module is calculated. The semantic similarity considers the vector cosine similarity, performance distance and time decay factor. Modules with a similarity exceeding a threshold are selected into a candidate set, and compatibility scores are generated according to the interface structure, state input space and dependency component comparison results. Modules with a compatibility score higher than a minimum threshold are retained as replacement modules;
[0045] The replacement modules are subjected to parameter adaptation adjustment, historical module parameters are converted into new parameters suitable for the current system through a mapping matrix and a bias term, a fusion control factor is introduced to dynamically adjust the output weight of the replacement module and the to-be-replaced module of the current system, and the fusion control factor gradually transitions from an initial value to 1 according to an exponential growth strategy, forming a gradual fusion output.
[0046] Continuously monitor the changes of the system core indicators during the fusion process, calculate the sum of the absolute values of the deviations of the observed values of the key performance indicators from the benchmark values by weighting as the system stability evaluation value, and when the stability evaluation value is lower than the set threshold for a long time, determine that the fusion is successful and record the fusion behavior to the intelligent agent genealogy map.
[0047] Preferably, after the multi-dimensional capability evaluation monitoring system covering the core functions of the intelligent agent system is established, the following is further included:
[0048] Extract the historical parameter matrix of the replacement module, perform structure alignment through a structure alignment function, the structure alignment function generates an adaptive matrix W and a bias term b based on the input and output dimensions of the current system to be replaced module, converts the historical module parameters into adaptive parameters that meet the interface protocol of the current system, and ensures that the module input space, output dimension and data type are compatible with the current system;
[0049] Introduce a fusion control factor, which has an initial value of 0 and is dynamically adjusted according to an exponential growth strategy with the time step t of the system running, and at each time step t, the outputs of the new and old modules are fused through a weighted summation formula: current system output = fusion control factor x replacement module output + (1-fusion control factor) x original module output; set a fusion speed coefficient a to control the growth rate of the fusion control factor, and when the system stability evaluation value is lower than the preset threshold, automatically reduce a to slow down the fusion speed;
[0050] During the module injection process, the system core indicators are collected in real time, the deviation percentage of each indicator from the benchmark value is calculated, and the stability evaluation value is generated by weighted summation; if the stability evaluation value is lower than the threshold for a plurality of consecutive time steps, it is determined that the fusion process is stable, otherwise the fuse mechanism is triggered, the fusion is suspended and the state before fusion is rolled back, and the replacement module is reselected;
[0051] In the parameter adaptation stage, compare the dependency component list of the replacement module with the current system, if there is an interface version conflict or resource competition risk, perform protocol conversion or resource scheduling priority adjustment through the interface adaptation layer; in the dynamic fusion stage, capture the module interaction log through the hook component, when the output result conflict is detected, identify the conflict type based on the fault feature library, and enable the conflict resolution rules verified effective in the historical version to correct;
[0052] When the stability evaluation value continuously meets the threshold requirement and the fusion control factor reaches 1, the parameters of the replacement module are formally written into the parameter space of the current system, and the module injection is completed; at the same time, the injection behavior is recorded in the intelligent agent genealogy map, including the version traceability of the replacement module, the parameter adaptation log, the fusion process stability curve and the performance improvement data, forming a traceable module inheritance track.
[0053] In a second aspect, the application provides an agent system optimization device based on intelligent fault analysis and cross-generation knowledge inheritance, which adopts the following technical scheme and comprises:
[0054] An abnormal signal module is configured to deploy a lightweight log probe, capture abnormal signals in real time during the interaction of the agent, and provide a data basis for fault analysis;
[0055] An efficiency prediction module is configured to construct a tool efficiency prediction model based on reinforcement learning according to the abnormal signals, and automatically generate a tool improvement proposal when the failure rate of a specific scenario exceeds a preset threshold;
[0056] A memory inheritance module is configured to establish an agent genealogy map, combine fault analysis to construct a version evolution relationship tree, and realize automatic inheritance of core memories and rejection of invalid knowledge of a new agent;
[0057] A forgetting blocking module is configured to deploy a catastrophic forgetting blocker, based on the tool improvement proposal and the agent genealogy map, when a key capability degradation is detected, dynamically extract a corresponding function module from the agent genealogy map for injection.
[0058] In a third aspect, the application further provides a control device, which comprises:
[0059] The control device comprises a memory and a processor, and the memory stores a computer program capable of being loaded and executed by the processor to perform the above-mentioned agent system optimization method based on intelligent fault analysis and cross-generation knowledge inheritance.
[0060] In a fourth aspect, the application further provides a computer readable storage medium storing a computer program capable of being loaded and executed by a processor to perform the above-mentioned agent system optimization method based on intelligent fault analysis and cross-generation knowledge inheritance.
[0061] In summary, the application has the following beneficial effects:
[0062] 1. Constructing a real-time fault analysis mechanism based on lightweight log probes. By deploying "lightweight log probes" in the agent system and using a real-time exception signal capture and intelligent fault identification dual coordination mechanism, the problem of timely discovery and accurate positioning of faults in the running process of the agent is effectively solved. The lightweight probe uses a non-intrusive deployment method to realize full-link interaction monitoring while minimizing system resource occupation, automatically capturing abnormal behavior patterns and performance degradation signals; the intelligent fault identification module accurately distinguishes between occasional abnormalities and systemic faults through multi-dimensional feature analysis, avoiding false positives and false negatives. Compared with traditional passive fault handling schemes, this mechanism can shorten the fault discovery time to minutes, significantly improving system reliability and fault response efficiency, providing a high-quality data foundation for subsequent automated optimization, and showing outstanding technical advantages in complex agent deployment scenarios.
[0063] 2. By constructing a "reinforcement learning driven tool benefit prediction model" and combining failure rate threshold monitoring and automatic improvement proposal generation strategy, the invention realizes the autonomous optimization and upgrade of the agent tool chain. The prediction model accurately evaluates the success probability and benefit contribution of each tool in different scenarios by continuously learning historical execution data, and when the failure rate of a specific scenario exceeds the preset threshold, the system automatically triggers the improvement process to generate targeted tool optimization solutions. Reinforcement learning algorithm ensures that prediction accuracy improves with usage frequency, and the automatic improvement mechanism avoids the lag and subjectivity of manual intervention. Compared with traditional static tool configuration schemes, the invention can dynamically optimize tool efficiency, significantly reduce task failure rate, improve overall system performance, and significantly reduce operation and maintenance costs, with significant technical progress and practical value.
[0064] 3. Propose "agent genealogy atlas" and "version evolution relationship tree", and assist with the dynamic function injection mechanism of catastrophic forgetting blocker to solve the key problems of knowledge loss and ability degradation in the agent upgrade process. The genealogy atlas systematically records the evolution track and core ability change of the agent, supports the accurate inheritance of historical effective knowledge and intelligent abandonment of invalid knowledge by the new version agent; the catastrophic forgetting blocker monitors key ability indicators in real time, and when performance degradation is detected, automatically extracts the corresponding function module from the genealogy database for immediate injection repair. This technology realizes the "intergenerational inheritance" and "ability guardianship" of agent knowledge, effectively avoiding the performance fluctuation problem caused by the conflict between new and old knowledge in traditional incremental learning. Compared with existing knowledge distillation or experience replay methods, the invention not only maintains higher knowledge fidelity and system stability, but also provides reliable technical support for the continuous evolution of the agent, with outstanding technical progress and industrial application value in large-scale agent deployment and iteration scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0065] Figure 1It is a flowchart of an agent system optimization method based on intelligent fault analysis and cross-generation knowledge inheritance.
[0066] Figure 2 It is a structural block diagram of an agent system optimization device based on intelligent fault analysis and cross-generation knowledge inheritance. DETAILED DESCRIPTION
[0067] The following Figure 1 - Figure 2 The present application is further described in detail.
[0068] The agent system optimization method based on intelligent fault analysis and cross-generation knowledge inheritance proposed in the present application can effectively solve the key problems faced by the agent system in actual deployment, such as fault discovery lag, tool efficiency degradation, knowledge inheritance fault, and catastrophic forgetting, and brings significant technical improvement and innovative application value to the field of reliability guarantee and continuous optimization of the agent system.
[0069] Referring to Figure 1 , the embodiments of the present application at least include steps S1 to S4.
[0070] S10: Deploy a lightweight log probe to capture abnormal signals in real time during the interaction of the agent, and provide a data basis for fault analysis;
[0071] S20: Construct a tool benefit prediction model based on reinforcement learning, and automatically generate tool improvement proposals when the failure rate of a specific scene exceeds a preset threshold;
[0072] S30: Establish an agent genealogy atlas, construct a version evolution relationship tree, and realize the automatic inheritance of core memories and the rejection of invalid knowledge of new agents;
[0073] S40: Deploy a catastrophic forgetting blocker, and when detecting degradation of key capabilities, dynamically extract the corresponding functional modules from the genealogy database for injection.
[0074] In some embodiments, the specific process of step S10 is as follows:
[0075] S11: A total of five different types of abnormal signals are defined, which are interface timeout, state jump exception, abnormal return value, high-frequency retry / reentry, and empty behavior. Let the number of agents be N, and the number of different types of abnormal signals be K. The triggering condition of the i-th type of signal is , where represents the behavior log vector at time t, and the specific calculation method is as follows:
[0076] ;
[0077] , where represents an interaction delay component, an index for judging timeout exceptions, represents a preset timeout threshold.
[0078] S12: The probe module is composed of three core components: logging, watchdog, and hook. The original data in logging is usually high-dimensional unstructured data, which is converted into structured data for subsequent analysis through this component; the watchdog takes the data processed from logging as input, and outputs the score of the exception signal after rule matching. The specific calculation is as follows:
[0079] ;
[0080] where I represents an indicator function, and w is a weight coefficient; the hook captures the context through a function and finally generates a log field. Subsequently, when the microservice starts, the probe module is loaded through the startup script.
[0081] S13: First, use the asynchronous collection channel to push the local log to the unified collection service and mark it with Agent, module, and timestamp identifier, and then use Flink to perform the following preprocessing: (1) discard events that do not meet the conditions, and only keep events that meet a certain Boolean rule . That is, given the input event stream , define the filtering condition , and the output stream is: , (2) aggregate events in a certain time window into an average value. That is, set the time window , and the aggregation can be represented as , and (3) if the number of abnormal signals in a unit time window is , and the warning threshold is , then the triggering condition is:
[0082]
[0083] S14: Convert unstructured logs into normalized structures , where is the timestamp, is the event type, is the entity. Through entity extraction and relationship matching, the log event is embedded in the knowledge graph triple for intelligent agent behavior tracking and abnormal positioning, then the trajectory is constructed according to the event sequence, and is mapped to the task flowchart node path, i.e. the node sequence on the directed graph, and finally the trajectory is converted into fixed-vectors performing clustering analysis.
[0084] In some embodiments, step S20 specifically comprises the following steps:
[0085] S21: Collecting execution data under different scenarios, including normal operation state data, abnormal fault state data, performance degradation process data, and cross-generation transfer learning data. Establish an efficiency evaluation index system, including fault detection accuracy, system response time, resource utilization efficiency, knowledge inheritance integrity, and other key performance indicators. Clean and standardize the collected raw data and organize the data in input-output pair format. Finally, divide the data set according to the proportion of 70% training set, 15% validation set, and 15% test set.
[0086] S22: Traditional reinforcement learning methods have weak ability to handle complex decision-making problems and adapt to dynamic environments. Therefore, a BIM reinforcement learning model is proposed, which defines the state-action space and reward model, and updates the policy network alternately through offline training and online optimization. The specific steps are as follows: First, define the state space and the action space For each time step , the agent receives the state from the environment and selects the action according to the policy . The environment returns the reward and the next state based on the action.
[0087] The state transition relationship satisfies the Markov property:
[0088] ;
[0089] The structured reward function of the BIM reinforcement learning algorithm is as follows:
[0090] ;
[0091] Where represents the execution efficiency, represents the operation safety, represents the resource consumption cost, represents the weighting coefficient of each indicator. The policy network adopts a parameterized function to represent, which is trained by maximizing the expected cumulative discounted reward , where is the discount factor, is the maximum decision step length.
[0092] To improve the training stability, an offline training method based on experience replay and target network mechanism is adopted, and the loss function is defined as follows:
[0093] ;
[0094] wherein represents the offline data set, is the target network parameter, and is periodically synchronized with .
[0095] In the online optimization phase, through the policy fine-tuning and dynamic reward adjustment mechanism, the policy is continuously enhanced, and the updated policy is calculated by the following formula:
[0096] ;
[0097] wherein the advantage function is used to measure the degree of the current action being better than the average policy.
[0098] S23: First, set the tool , the total number of calls in the time window is , the number of failures is , and the failure rate in this window is defined as . When the scene changes dynamically, the system introduces a sliding time window and an exponential weighted moving average (EWMA) to smooth the failure rate, and the approximate estimate of the smoothed failure rate is as follows:
[0099] ;
[0100] Affected by the failure rate fluctuation and historical trend, the threshold is set adaptively and adjusted dynamically by the following formula:
[0101] ;
[0102] wherein and are the historical failure rate mean and standard deviation, is the sensitivity coefficient, and . When the condition is met, the policy feedback correction is activated.
[0103] S24: The risk accumulation measure function of each state in the trajectory is used to identify the key abnormal segment, and the function is defined as follows:
[0104] ;
[0105] wherein is a discount factor, is a failure threshold, is an indicator function that captures the low-reward state segment.
[0106] In some embodiments, step S30 specifically comprises the following steps:
[0107] S31: comprehensively record the inheritance relationship between agents by establishing a graph structure. The system first scans the metadata information of all agent instances to obtain an agent instance set , extracts the creation time, parent reference, version identifier and other key attributes to obtain the metadata information of each agent , and then constructs an inheritance relationship network based on the above information . Taking the above as input, according to the formula:
[0108] ;
[0109] wherein represents the shortest inheritance distance between agent and agent , the smaller the value, the closer the relationship, represents the weight value of the kth edge in the inheritance path, which is dynamically calculated according to the inheritance type and time interval, represents the set of all possible inheritance paths between agent and agent . After calculation, the inheritance distance query table D_table between agents is obtained, and then the genealogy inheritance graph is obtained .
[0110] S32: the system receives a version feature sequence , wherein is the number of versions, In addition, the system obtains the version change matrix , wherein represents the change-related feature and performance indicator matrix , wherein represents the performance indicator as an auxiliary feature. The output information is obtained through a designed hybrid neural network module, which contains the reorganization and aggregation of multiple neural networks. First, the long short-term memory network (LSTM) processes the time evolution pattern of the version sequence V. For each time step , the LSTM receives the input feature and the previous hidden state , wherein is the hidden state dimension. The calculation formula of the LSTM update is as follows:
[0111] ;
[0112] ;
[0113] wherein , , , update the unit state .
[0114] Meanwhile, a one-dimensional convolutional neural network (CNN) is used to process the version change matrix . For each version, the CNN uses a sliding window with kernel size k for convolution operation: wherein is the convolution kernel, is the bias term, and ∗ denotes the convolution operation. The output feature map captures local features.
[0115] Finally, the long-range dependency between versions is modeled by the self-attention mechanism of the Transformer. Given the concatenated feature sequence , the multi-head self-attention is calculated as follows:
[0116] ;
[0117] wherein , is the number of heads, and project it to . The final global feature representation of the Transformer is .
[0118] Finally, the above feature temporal features H, local features Z, and global features G are fused through LayerNorm and the similarity is calculated:
[0119] ;
[0120] wherein . The version similarity is calculated by the following steps:
[0121] Cosine similarity: ,
[0122] Performance distance: wherein is the performance vector
[0123] Time decay factor: wherein is the release time, is the decay rate.
[0124] The final similarity score is:
[0125] ;
[0126] wherein are learnable weights, and is 1.
[0127] S33: Collecting the execution trajectory dataset of the old version of the agent in multiple typical task scenarios , which contains each trajectory contains states arranged in chronological order , actions and immediate rewards triplets, that is , wherein denotes the step length of the task; while extracting the policy network parameters generated by the old version of the agent at the end of training , and its corresponding state value function . Calculate the discounted cumulative reward value brought by the policy segment under each trajectory , the calculation formula is as follows:
[0128] ;
[0129] wherein, is a discount factor, which controls the degree of emphasis on long-term rewards. According to the size of , all trajectory segments are sorted in descending order, and the top trajectory subsequences and their corresponding policy parameters are selected to construct a policy feature set , which contains policy patterns that have been verified to have high performance, for the new agent to inherit and fine-tune.
[0130] The method of knowledge distillation is used to extract the behavior preference stability features of the old version of the agent at each state, while establishing the mapping relationship between the outputs of the new and old strategies. The specific process is: extracting state samples from the trajectory, and inputting them into the old model and the new model respectively to obtain the corresponding logits outputs and , and calculating the KL divergence loss after constructing the softmax distribution:
[0131] ;
[0132] wherein denotes the softmax function, denotes the temperature coefficient, N denotes the number of selected state samples, is the Kullback-Leibler divergence, which measures the difference between the two policy output distributions. The extracted policy feature set and the stable knowledge representation set are input into the policy transfer mapping function In this function, multi-policy features are encoded and fused using a graph neural network to generate a parameter vector for initializing the policy network of the new agent. ,satisfy:
[0133] ;
[0134] S34: Constructing a Multi-Task Evaluation Environment The strategy extracted from the old version of the intelligent agent With stable knowledge units Deployment tests were conducted, and the cumulative reward decline rate in the new tasks was collected. behavioral deviation measurement With the increase in failure rate Invalid knowledge is identified using the following failure determination function:
[0135] ;
[0136] in , These are the performance and safety thresholds, if If so, the knowledge unit is considered invalid knowledge.
[0137] In some embodiments, step S40 specifically includes the following steps:
[0138] S41: Establish a multi-dimensional capability assessment and monitoring system covering the core functions of the intelligent agent system. Based on historical performance baseline data and current observation indicators, compare and analyze the data to determine in real time whether the system has experienced functional degradation. The specific steps are as follows: Collect data on the intelligent agent system in multiple standard task scenarios. The raw data generated during operation includes task execution logs, state transition information, policy action distribution, system response time, resource utilization, and other performance observations. It also retrieves performance benchmark data from previous versions of the system under the same task. As a baseline for comparison.
[0139] For the task Calculate the degradation rate of each performance indicator. The formula is as follows:
[0140] ;
[0141] in, Indicates task The next Performance benchmark value, This represents the performance value observed in the current period. Indicates the degree of degradation. Set a degradation tolerance threshold for each indicator. and construct a degradation alarm function:
[0142] ;
[0143] When there is any dimension of the degradation rate over the threshold , the ability degradation alarm signal of the task is triggered , and the triggered index dimension, degradation amplitude and comparison reference are recorded to form a degradation index set and a system alarm log.
[0144] S42: Based on the ability degradation features identified in step S41, call the historical agent version and function module relationship graph recorded in the genealogy database, perform semantic level feature matching retrieval, locate the candidate modules with excellent performance in the historical version, and evaluate their compatibility with the current system, including: according to the ability evaluation monitoring result, construct the degradation ability feature vector , where each component represents the degradation degree or performance deviation of a certain dimension ability, and the vector is input to the genealogy database retrieval module as a semantic query condition; the genealogy database records are , each represents the performance embedding vector of the th module in the historical version under the same ability dimension, and the semantic similarity between the degradation vector and the historical module vector is calculated , the formula is as follows:
[0145] ;
[0146] , where represents the vector dot product, represents the L2 norm of the vector, represents the semantic matching degree of the th module and the degradation feature, and the modules with a matching degree greater than a preset threshold are added to the candidate set , and the compatibility of each module in the set is evaluated according to the interface structure, state input space, dependent components and other information compared with the current system configuration to obtain a compatibility score , and only the modules with a compatibility score higher than a threshold are kept as replacement modules.
[0147] S43: First, the structure alignment function of the candidate module and the current system to be replaced module is satisfied, and the formula is as follows:
[0148] ;
[0149] wherein, represents historical module parameters, W and b are mapping matrix and bias term, are the new module parameters after adaptation. Secondly, a fusion control factor is introduced to dynamically control the output weighting of the old module and the new module in the system running, forming the fusion output:
[0150] ;
[0151] wherein, is the output under the current input, is the output of the old module, is gradually increased according to the set strategy, and the strategy is , wherein is a fusion speed coefficient. A system stability evaluation function is introduced to continuously monitor the changes of the core indicators of the system in the fusion process, and the formula is as follows:
[0152] ;
[0153] wherein, represents the real-time observation value of the kth key performance indicator at the fusion time t, represents the reference value, is the weight of the indicator. When is long-term lower than the set threshold , it is determined that the fusion is successful, and the fusion behavior is written into the genealogy database.
[0154] The implementation principle of an intelligent agent system optimization method based on intelligent fault analysis and intergenerational knowledge inheritance in this application is as follows: A lightweight log probe is deployed to capture five types of abnormal signals in real time, including interface timeouts and abnormal state transitions. These signals are then structured and modeled using a knowledge graph to form a fault feature library. A tool effectiveness prediction model based on reinforcement learning is constructed, dynamically evaluating tool performance by integrating execution efficiency, security, and resource costs. When the failure rate exceeds a threshold, improvement proposals are automatically generated. An intelligent agent genealogy graph and version evolution relationship tree are established. Version features are extracted and similarity is calculated using a hybrid neural network to achieve automatic inheritance of core knowledge and discarding of invalid knowledge (based on indicators such as cumulative reward decline rate and behavioral deviation). A catastrophic forgetting blocker is deployed to monitor core capability indicators in real time. When degradation is detected, semantic matching is performed from the genealogy database, and compatible functional modules are dynamically injected. System stability is ensured through parameter adaptation and gradual fusion. This method, through the collaboration of an intelligent fault analysis layer and an intergenerational knowledge inheritance network, significantly improves the system's fault self-healing capability, version stability, and business continuity, while reducing operation and maintenance costs.
[0155] Figure 1 This is a flowchart illustrating an intelligent agent system optimization method based on intelligent fault analysis and cross-generational knowledge inheritance in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows; unless explicitly stated otherwise, there is no strict order requirement for the execution of these steps, and they can be executed in other orders; and Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0156] Based on the same technical concept, referring to Figure 2 This application also provides an intelligent agent system optimization device based on intelligent fault analysis and cross-generational knowledge inheritance, which adopts the following technical solution: The device includes:
[0157] The anomaly signal module is used to deploy lightweight log probes to capture anomaly signals during agent interaction in real time and provide a data foundation for fault analysis.
[0158] The benefit prediction module is used to build a tool benefit prediction model based on reinforcement learning based on abnormal signals. When the failure rate in a specific scenario exceeds a preset threshold, it automatically generates a tool improvement proposal.
[0159] A memory inheritance module is configured to establish an agent pedigree map, combine fault analysis to construct a version evolution relationship tree, and realize automatic inheritance of core memories and rejection of invalid knowledge by a new agent;
[0160] A forgetting blocking module is configured to deploy a catastrophic forgetting blocker, dynamically extract corresponding function modules from the agent pedigree map based on tool improvement proposals and step agent pedigree maps, and inject the function modules when detecting degradation of key capabilities.
[0161] In some embodiments, the abnormal signal module is specifically configured to define abnormal signal types, uniformly structure abnormal signal templates into JSON representations, and the abnormal signal types include interface timeout, state jump exception, abnormal return value, high-frequency retry / reentry, and empty behavior. Each abnormal signal type triggers a corresponding conditional formula;
[0162] Based on the abnormal signal type, a probe module composed of logging, watchdog, and hook is deployed, and the probe module is injected into the Agent microservice through a startup script. The watchdog calculates an abnormal score based on the trigger conditions of the abnormal signal type;
[0163] Asynchronous channels are used to collect log data, which is formatted by a unified service and added with Agent and timestamp identifiers. Flink pipeline is used to filter, time window aggregate, and count abnormal signals. When the number of abnormal signals in a unit time window exceeds a preset threshold, an alarm is triggered;
[0164] The processed log data is converted into a standardized structure containing timestamps, event types, and entities. The knowledge graph triples are embedded by entity extraction and relationship matching. The event sequence trajectory is mapped to the agent task flowchart node path. The trajectory is vectorized using Embedding technology for clustering analysis to form a fault feature library.
[0165] In some embodiments, the abnormal signal module is also configured to receive high-dimensional unstructured raw log data generated during the interaction of the agent through the logging component. The raw log data is converted into structured log entries containing timestamps, interaction objects, behavior types, and key parameters through preset field extraction rules. The structured log entries are stored in JSON format;
[0166] The watchdog component takes the structured log entries as input, based on the trigger conditions of the abnormal signal type, and scans the log fields row by row through the rule matching engine. Events that meet the interface timeout, state jump exception, and other conditions are assigned corresponding weight coefficients. The abnormal signal comprehensive score is calculated by weighted summation. When the comprehensive score exceeds the set threshold, it is marked as a suspected abnormal event;
[0167] The core interaction process of the agent microservice is embedded through the function hook mechanism of the hook component, real-time call stack information, context environment variables and state transition trajectories are captured, and are supplemented as metadata to the corresponding structured log entries to form enhanced log records containing complete context;
[0168] The probe module loads through initialization scripts during the startup phase of the agent microservice, the logging, watchdog and hook components realize data flow through internal message queues, when the watchdog component outputs suspected abnormal events, the enhanced log records of the hook component are pushed to the unified collection service in real time through the local cache channel for subsequent fault analysis.
[0169] In some embodiments, the benefit prediction module is specifically used to collect execution data of the agent tool in different scenarios, the execution data including normal running state data, abnormal fault state data, performance degradation process data and cross-generation transfer learning data;
[0170] An efficiency evaluation index system including fault detection accuracy, system response time, resource utilization efficiency and knowledge inheritance integrity is established, and the execution data is cleaned and standardized, and then divided into training set, validation set and test set;
[0171] Based on the benefit evaluation index system, a reinforcement learning model is constructed, the state space is the current running state of the agent tool, the action space is the tool optimization adjustment strategy, the reward function of the reinforcement learning model comprehensively considers the execution benefit, operation safety and resource consumption cost, the policy network is updated alternately through offline training and online optimization, the experience replay and target network mechanism are used for offline training to improve the training stability, and the policy is continuously enhanced through policy fine-tuning and dynamic reward adjustment for online optimization;
[0172] A real-time monitoring system is established to track the tool failure rate, the failure rate is the ratio of the number of tool call failures to the total number of calls in a specific time window, a sliding time window and an exponential weighted moving average method are used to smooth the failure rate, and the failure rate threshold is dynamically adjusted in combination with the historical failure rate mean and standard deviation, when the smoothed failure rate exceeds the dynamically adjusted threshold, the tool improvement process is triggered;
[0173] Based on the reinforcement learning model, the failure reason is analyzed, the key abnormal fragments in the tool execution trajectory are identified through a risk accumulation measurement function, structured tool improvement proposals are automatically generated in combination with historical successful cases, and the priority is sorted according to the execution benefit improvement potential and resource consumption cost.
[0174] In some embodiments, the benefit prediction module is further configured to define a state space and an action space of the reinforcement learning model, the state space including real-time running state parameters of the agent tool, including tool invocation frequency, resource occupancy rate, scene feature vector and historical failure rate, and the action space being a limited set of tool parameter adjustment, interface adaptation optimization and process reconstruction strategies;
[0175] A structured reward function is designed, the reward function taking execution benefit as a core index, and operation safety metric and resource consumption cost are weighted and fused, wherein the execution benefit is quantitatively evaluated by task completion rate and efficiency improvement amount, the operation safety is measured by abnormal rollback times and data consistency check results, and the resource consumption cost is calculated by CPU occupancy rate, memory usage rate and network bandwidth consumption;
[0176] An alternating update strategy network training mechanism of offline training and online optimization is adopted, in the offline training stage, historical state-action-reward samples stored in the experience replay pool are used to minimize the loss function through periodic parameter synchronization of the target network to improve the stability of model training; in the online optimization stage, the current action value is evaluated by the advantage function, and the strategy network parameters are optimized in real time by combining the dynamic reward adjustment mechanism, the advantage function is calculated by the difference between the action value function and the state value function, and is used to measure the advantage degree of the current action relative to the average strategy;
[0177] According to the actual execution data of the agent tool in different scenes, the weighting coefficients of each index in the reward function are dynamically adjusted, the strategy network parameters are updated by the gradient descent method, the expected cumulative discounted reward is maximized, and the iterative improvement and optimization of the tool benefit prediction accuracy and the autonomous evolution of the optimization strategy are realized.
[0178] In some embodiments, the memory inheritance module is specifically configured to scan the set of agent instances to extract metadata information, the metadata information including creation time, parent ID, version identifier and functional characteristics, build an inheritance relationship network between agents based on the metadata information, calculate the shortest inheritance distance between agents and generate a genealogy inheritance graph;
[0179] A version evolution relationship tree is constructed, and a mixed neural network is used to process a version feature sequence, a version change matrix and a performance index matrix, the mixed neural network including a long short-term memory network, a one-dimensional convolutional neural network and a Transformer self-attention mechanism, to extract version time evolution features, local change features and global dependency relationships, and calculate version similarity after fusing the features;
[0180] The execution trajectory data and strategy network parameters of the old version agent in a typical task scenario are collected, the discounted cumulative reward value of the trajectory is calculated, the high reward trajectory subsequence and the corresponding strategy parameters are selected to construct a strategy feature set, the behavior preference stability features of the old version agent are extracted through a knowledge distillation method, and the stable knowledge representation set is combined to input a strategy migration mapping function to generate the initialization parameters of the new agent strategy network.
[0181] A multi-task evaluation environment is constructed to test the extracted strategy and stable knowledge unit. The cumulative reward reduction rate, behavior deviation metric, and failure rate increase amount in the new task are collected. When any of the indicators exceeds the preset threshold, the corresponding knowledge unit is determined to be invalid knowledge and is discarded.
[0182] In some embodiments, the memory inheritance module is also used to collect the metadata information of the new agent version when it is released, update the node and edge relationship in the pedigree inheritance graph based on the shortest inheritance distance algorithm, process the time sequence evolution features, local change features, and global dependency relationship of the new version through a hybrid neural network, calculate the comprehensive similarity with the historical version, mark the historical version with a similarity higher than the threshold as a kinship version, and construct a branch node of the version evolution relationship tree.
[0183] The core knowledge units of the agent are classified according to the function dimension, and the feature labels of each knowledge unit are extracted. A multi-dimensional index structure is constructed based on a graph database, wherein the main index is the mapping relationship between the knowledge unit ID and the function classification, and the secondary index includes the performance vector index, the version association index, and the invalid state index.
[0184] When the new agent completes knowledge inheritance, the index update process is automatically triggered: for the inherited core knowledge units, add the association record of the current version ID in the version association index; for the knowledge units marked as invalid by the invalid knowledge determination function, update the state to abandoned in the invalid state index, and add the invalid reason note in the pedigree map; periodically perform index optimization tasks to delete redundant association records and abandoned knowledge unit indexes that have not been retrieved for a long time, and improve retrieval efficiency;
[0185] Based on the constructed multi-dimensional index structure, two retrieval modes are provided: accurate retrieval according to the function classification, which supports quick positioning of candidate knowledge units through function labels; fuzzy retrieval according to performance features, which returns a list of knowledge units with the highest matching degree to the target feature vector by combining a semantic similarity algorithm; the retrieval results are sorted according to the kinship version priority principle, and the historical knowledge units with high similarity to the current version are preferentially displayed to assist the catastrophic forgetting blocker in quickly extracting the adaptation module.
[0186] In some embodiments, the forgetting blocking module is specifically used to establish a multi-dimensional capability evaluation monitoring system covering the core functions of the agent system, collect task execution logs, state transition information, policy action distribution, system response time and resource utilization under standard task scenarios as performance observation values, call the performance benchmark data of the historical version under the same task as the comparison baseline, calculate the degradation rate of each performance indicator, and trigger a capability degradation alarm when the degradation rate of any indicator exceeds the preset threshold;
[0187] Based on the capability degradation alarm, a degraded capability feature vector is extracted, the degraded capability feature vector is input into the agent genealogy database as a retrieval condition, the semantic similarity between the degraded capability feature vector and the performance embedding vector of the historical version function module is calculated, the semantic similarity comprehensively considers the vector cosine similarity, performance distance and time decay factor, modules with a similarity exceeding a threshold are screened into a candidate set, and a compatibility score is generated according to the interface structure, state input space and dependency component comparison results, and modules with a compatibility score higher than a minimum threshold are retained as replacement modules;
[0188] The replacement module is subjected to parameter adaptation adjustment, historical module parameters are converted into new parameters suitable for the current system through a mapping matrix and a bias term, a fusion control factor is introduced to dynamically adjust the output weight of the replacement module and the to-be-replaced module of the current system, the fusion control factor gradually transitions from an initial value to 1 according to an exponential growth strategy, and a gradual fusion output is formed;
[0189] The system core indicators during the fusion process are continuously monitored, the sum of the absolute values of the deviations of the key performance indicator observation values and the benchmark values is calculated as a system stability evaluation value through weighted calculation, and when the stability evaluation value is lower than a set threshold for a long time, it is determined that the fusion is successful and the fusion behavior is recorded to the agent genealogy map.
[0190] In some embodiments, the forgetting blocking module is also used to extract the historical parameter matrix of the replacement module, perform structure alignment through a structure alignment function, generate an adaptation matrix W and a bias term b based on the input and output dimensions of the to-be-replaced module of the current system, convert the historical module parameters into adaptation parameters that meet the interface protocol of the current system, and ensure that the module input space, output dimension and data type are compatible with the current system;
[0191] A fusion control factor is introduced, which has an initial value of 0 and is dynamically adjusted according to an exponential growth strategy with the system running time step t, at each time step t, the outputs of the new and old modules are fused through a weighted summation formula: current system output = fusion control factor x replacement module output + (1-fusion control factor) x original module output; a fusion speed coefficient a is set to control the growth rate of the fusion control factor, and when the system stability evaluation value is lower than the preset threshold, a is automatically reduced to slow down the fusion speed;
[0192] In the module injection process, the system core indicators are collected in real time, the deviation percentage of each indicator from the benchmark value is calculated, and a stability evaluation value is generated by weighted summation; if the stability evaluation value is lower than the threshold value for consecutive multiple time steps, it is determined that the fusion process is stable, otherwise the fuse mechanism is triggered, the fusion is suspended and the state before fusion is rolled back, and the replacement module is reselected;
[0193] In the parameter adaptation phase, if there is an interface version conflict or resource competition risk between the replacement module and the dependent component list of the current system, protocol conversion or resource scheduling priority adjustment is performed through the interface adaptation layer; in the dynamic fusion phase, the module interaction log is captured through the hook component, when the output result conflict is detected, the conflict type is identified based on the fault feature library, and the conflict resolution rule verified effective in the historical version is enabled for correction;
[0194] When the stability evaluation value continuously meets the threshold requirement and the fusion control factor reaches 1, the parameters of the replacement module are formally written into the current system parameter space, and the module injection is completed; at the same time, the injection behavior is recorded in the agent pedigree map, including the version traceability of the replacement module, the parameter adaptation log, the fusion process stability curve and the performance improvement data, forming a traceable module inheritance track.
[0195] The embodiment of the application further discloses a control device.
[0196] Specifically, the control device includes a memory and a processor, and the memory stores a computer program capable of being loaded and executed by the processor to perform the above-mentioned intelligent agent system optimization method based on intelligent fault analysis and cross-generation knowledge inheritance.
[0197] The embodiment of the application further discloses a computer readable storage medium.
[0198] Specifically, the computer readable storage medium stores a computer program capable of being loaded and executed by the processor to perform the above-mentioned intelligent agent system optimization method based on intelligent fault analysis and cross-generation knowledge inheritance, and the computer readable storage medium includes, for example, a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage program code media.
[0199] The above are preferred embodiments of the application, and are not intended to limit the protection scope of the application, therefore: any equivalent changes made on the basis of the structure, shape, principle of the application should be covered within the protection scope of the application.
Claims
1. A method for optimizing an intelligent agent system based on intelligent fault analysis and cross-generational knowledge inheritance, characterized in that, include: Deploy lightweight log probes to capture abnormal signals during agent interactions in real time and provide a data foundation for fault analysis; Based on the abnormal signals, a tool effectiveness prediction model based on reinforcement learning is constructed, and when the failure rate in a specific scenario exceeds a preset threshold, a tool improvement proposal is automatically generated. Establish an agent family tree and construct a version evolution relationship tree by combining fault analysis, so as to realize the automatic inheritance of core memory and the discarding of invalid knowledge by new agents; Deploy a catastrophic forgetting blocker, based on the tool improvement proposal and the agent family tree, and dynamically extract and inject the corresponding functional modules from the agent family tree when a key capability degradation is detected; The deployment of a lightweight log probe, which captures abnormal signals during agent interactions in real time and provides a data foundation for fault analysis, includes: Define the abnormal signal types and standardize the abnormal signal templates into a JSON representation. The abnormal signal types include interface timeout, status transition exception, abnormal return value, high frequency retry / reentry, and null behavior. Each of the abnormal signal types triggers a corresponding condition formula. Based on the abnormal signal type, a probe module consisting of logging, watchdog, and hook is deployed and injected into the Agent microservice through a startup script. The watchdog calculates an anomaly score based on the triggering conditions of the abnormal signal type. Log data is collected using an asynchronous channel, formatted by a unified service, and labeled with an Agent and timestamp. The log data is then filtered, time-window aggregated, and anomaly signal counted through a Flink pipeline. An alarm is triggered when the number of anomaly signals within a unit time window exceeds a preset threshold. The processed log data is transformed into a normalized structure containing timestamps, event types, and entities. Entity extraction and relation matching are used to embed knowledge graph triples, mapping event sequence trajectories to intelligent agent task flowchart node paths. Embedding technology is then used to vectorize the trajectories and perform cluster analysis to form a fault feature library. The step of constructing a reinforcement learning-based tool effectiveness prediction model based on the abnormal signals, and automatically generating tool improvement proposals when the failure rate in a specific scenario exceeds a preset threshold, includes: Collect execution data of intelligent agent tools in different scenarios. The execution data includes normal operation status data, abnormal fault status data, performance degradation process data, and cross-generational transfer learning data. Establish a benefit evaluation index system that includes fault detection accuracy, system response time, resource utilization efficiency, and knowledge inheritance integrity. After cleaning and standardizing the execution data, divide it into training set, validation set, and test set. A reinforcement learning model is constructed based on the aforementioned benefit evaluation index system. The state space represents the current operating state of the agent tool, and the action space represents the tool's optimization and adjustment strategy. The reward function of the reinforcement learning model comprehensively considers execution efficiency, operational safety, and resource consumption costs. The policy network is updated alternately through offline training and online optimization. The offline training adopts experience replay and target network mechanisms to improve training stability, and the online optimization achieves continuous policy enhancement through policy fine-tuning and dynamic reward adjustment. Establish a real-time monitoring system to track changes in tool failure rate. The failure rate is the ratio of the number of failed tool calls to the total number of calls within a specific time window. The failure rate is smoothed using a sliding time window and an exponentially weighted moving average method. The failure rate threshold is dynamically adjusted by combining the historical failure rate mean and standard deviation. When the smoothed failure rate exceeds the dynamically adjusted threshold, the tool improvement process is triggered. Based on the reinforcement learning model, the reasons for failure are analyzed, key abnormal segments in the tool's execution trajectory are identified through the risk accumulation metric function, and structured tool improvement proposals are automatically generated by combining historical success cases. These proposals are then prioritized according to the potential for improved execution efficiency and the cost of resource consumption.
2. The method for optimizing an intelligent agent system based on intelligent fault analysis and intergenerational knowledge inheritance as described in claim 1, characterized in that, After deploying the probe module consisting of logging, watchdog, and hook based on the aforementioned abnormal signal type, the method further includes: The logging component receives high-dimensional unstructured raw log data generated during the interaction of the intelligent agent, and transforms it into structured log entries containing timestamps, interaction objects, behavior types and key parameters through preset field extraction rules. The structured log entries are stored in JSON format. Using the structured log entries as input, the watchdog component scans the log fields line by line based on the triggering conditions of the abnormal signal type. Events that meet the conditions of interface timeout and status transition are assigned corresponding weight coefficients. The comprehensive score of the abnormal signal is calculated by weighted summation. When the comprehensive score exceeds the set threshold, it is marked as a suspected abnormal event. By embedding the core interaction process of the intelligent agent microservice through the function hook mechanism using the hook component, the call stack information, context environment variables and state transition trajectory are captured in real time and supplemented as metadata to the corresponding structured log entries, forming an enhanced log record containing a complete context. The probe module loads the intelligent agent microservice during startup via an initialization script. The logging, watchdog, and hook components transfer data through an internal message queue. When the watchdog component outputs a suspected abnormal event, the enhanced log record from the hook component is pushed to the unified collection service in real time through a local cache channel for subsequent fault analysis.
3. The method for optimizing an intelligent agent system based on intelligent fault analysis and cross-generational knowledge inheritance according to claim 1, characterized in that, After constructing the reinforcement learning model based on the aforementioned benefit evaluation index system, where the state space represents the current operating state of the agent tool and the action space represents the tool's optimization and adjustment strategy, the model further includes: Define the state space and action space of the reinforcement learning model. The state space includes the real-time running state parameters of the agent tool, including tool call frequency, resource utilization, scene feature vector and historical failure rate. The action space is a finite set of tool parameter adjustment, interface adaptation optimization and process reconstruction strategies. Design a structured reward function, which takes execution efficiency as the core indicator and weights and integrates operational safety measurement and resource consumption cost. Execution efficiency is quantitatively evaluated through task completion rate and efficiency improvement, operational safety is measured through the number of abnormal rollbacks and data consistency verification results, and resource consumption cost is calculated through CPU utilization, memory usage and network bandwidth consumption. A policy network training mechanism that alternates between offline training and online optimization is adopted. In the offline training phase, based on the historical state-action-reward samples stored in the experience replay pool, the parameters of the target network are periodically synchronized to minimize the loss function and improve the model training stability. In the online optimization phase, the value of the current action is evaluated by the advantage function, and the policy network parameters are optimized in real time by combining a dynamic reward adjustment mechanism. The advantage function is calculated by the difference between the action value function and the state value function and is used to measure the degree of advantage of the current action relative to the average policy. Based on the actual execution data of the intelligent agent tool in different scenarios, the weighting coefficients of each indicator in the reward function are dynamically adjusted, and the policy network parameters are updated by gradient descent to maximize the expected cumulative discount reward, thereby achieving iterative improvement of the tool's benefit prediction accuracy and autonomous evolution of the optimization strategy.
4. The method for optimizing an intelligent agent system based on intelligent fault analysis and intergenerational knowledge inheritance according to claim 1, characterized in that, The process of establishing an agent family tree and constructing a version evolution relationship tree based on fault analysis, enabling new agents to automatically inherit core memories and discard expired knowledge, includes: Scan the set of agent instances to extract metadata information, including creation time, parent ID, version identifier and functional characteristics. Based on the metadata information, construct an inheritance relationship network between agents, calculate the shortest inheritance distance between agents and generate a family tree inheritance graph. A version evolution relationship tree is constructed, and version feature sequences, version change matrices, and performance index matrices are processed by a hybrid neural network. The hybrid neural network includes a long short-term memory network, a one-dimensional convolutional neural network, and a Transformer self-attention mechanism to extract version temporal evolution features, local change features, and global dependencies. After fusing the features, version similarity is calculated. Collect execution trajectory data and policy network parameters of the old version of the agent in typical task scenarios, calculate the cumulative reward value of the trajectory discount, select high reward trajectory subsequences and corresponding policy parameters to construct a policy feature set, extract the behavioral preference stability features of the old version of the agent through knowledge distillation, and combine the stable knowledge representation set with the input policy transfer mapping function to generate the initialization parameters of the new agent policy network. A multi-task evaluation environment is constructed to deploy and test the extracted strategies and stable knowledge units. The cumulative reward decline rate, behavioral deviation measurement, and failure rate increase are collected in the new task. When any indicator exceeds the preset threshold, the corresponding knowledge unit is determined to be invalid knowledge and is discarded.
5. The method for optimizing an intelligent agent system based on intelligent fault analysis and cross-generational knowledge inheritance according to claim 4, characterized in that, After scanning the set of agent instances to extract metadata information, the process also includes: When a new version of the agent is released, its metadata information is collected, and the node and edge relationships in the genealogy inheritance graph are updated based on the shortest inheritance distance algorithm. The temporal evolution features, local change features and global dependencies of the new version are processed through the hybrid neural network, and the comprehensive similarity with historical versions is calculated. Historical versions with similarity higher than the threshold are marked as related versions, and branch nodes of the version evolution relationship tree are constructed. The core knowledge units of the intelligent agent are classified according to functional dimensions, and feature labels of each knowledge unit are extracted. A multi-dimensional index structure is constructed based on a graph database, where the main index is the mapping relationship between knowledge unit ID and functional classification, and the secondary indexes include performance vector index, version association index and failure status index. Once the new agent completes knowledge inheritance, the index update process is automatically triggered: for the inherited core knowledge units, add an associated record of the current version ID to the version association index; for knowledge units marked as invalid by the invalid knowledge determination function, update the status to obsolete in the invalid status index and add a note on the reason for invalidation in the genealogy graph; periodically execute index optimization tasks to delete redundant associated records and obsolete knowledge unit indexes that have not been retrieved for a long time, thereby improving retrieval efficiency; Based on the constructed multi-dimensional index structure, two retrieval modes are provided: precise retrieval by function category, which supports quick location of candidate knowledge units through function tags; and fuzzy retrieval by performance characteristics, which, combined with semantic similarity algorithm, returns a list of knowledge units with the highest matching degree to the target feature vector. The retrieval results are sorted according to the principle of relative version priority, giving priority to displaying historical knowledge units with high similarity to the current version, assisting the catastrophic forgetting blocker in quickly extracting the adaptation module.
6. The method for optimizing an intelligent agent system based on intelligent fault analysis and intergenerational knowledge inheritance according to claim 1, characterized in that, The deployment of the catastrophic forgetting blocker dynamically extracts and injects corresponding functional modules from the agent's genealogy when critical capability degradation is detected, including: Establish a multi-dimensional capability assessment and monitoring system covering the core functions of the intelligent agent system. Collect task execution logs, state transition information, policy action distribution, system response time and resource utilization rate under standard task scenarios as performance observation values. Call the performance benchmark data of historical versions under the same task as the comparison baseline, calculate the degradation rate of each performance indicator, and trigger a capability degradation alarm when the degradation rate of any indicator exceeds the preset threshold. Based on the capability degradation alarm, a degradation capability feature vector is extracted. The degradation capability feature vector is used as a retrieval condition and input into the agent genealogy database. The semantic similarity between the degradation capability feature vector and the performance embedding vector of the functional module in the historical version is calculated. The semantic similarity comprehensively considers the vector cosine similarity, performance distance and time decay factor. Modules with similarity exceeding the threshold are selected to enter the candidate set. A compatibility score is generated based on the interface structure, state input space and dependent component comparison results. Modules with compatibility scores higher than the minimum threshold are retained as replacement modules. The replacement module is adjusted to adapt its parameters. The historical module parameters are converted into new parameters that are suitable for the current system through a mapping matrix and bias terms. A fusion control factor is introduced to dynamically adjust the output weights of the replacement module and the module to be replaced in the current system. The fusion control factor gradually transitions from the initial value to 1 according to an exponential growth strategy, forming a progressive fusion output. The system continuously monitors changes in core indicators during the fusion process. The system stability assessment value is calculated by weighting the sum of the absolute values of the deviations between the observed values of key performance indicators and the benchmark values. When the stability assessment value is lower than the set threshold for a long period of time, the fusion is determined to be successful and the fusion behavior is recorded in the agent family tree.
7. The method for optimizing an intelligent agent system based on intelligent fault analysis and cross-generational knowledge inheritance according to claim 6, characterized in that, Following the establishment of a multi-dimensional capability assessment and monitoring system covering the core functions of the intelligent agent system, the following is also included: Extract the historical parameter matrix of the replacement module, and perform structural alignment using a structural alignment function. The structural alignment function generates an adaptation matrix W and a bias term b based on the input and output dimensions of the module to be replaced in the current system. This converts the historical module parameters into adaptation parameters that meet the interface protocol of the current system, ensuring that the module's input space, output dimensions, and data types are compatible with the current system. A fusion control factor is introduced, with an initial value of 0 and dynamically adjusted according to an exponential growth strategy as the system runs for time step t. At each time step t, the outputs of the old and new modules are merged using a weighted summation formula: Current system output = Fusion control factor × Replacement module output + (1 - Fusion control factor) × Original module output. A fusion speed coefficient α is set to control the growth rate of the fusion control factor. When the system stability assessment value is lower than a preset threshold, α is automatically reduced to slow down the fusion speed. During the module injection process, the system's core indicators are collected in real time, and the percentage deviation of each indicator from the benchmark value is calculated. A stability evaluation value is generated by weighted summation. If the stability evaluation value is lower than the threshold for multiple consecutive time steps, the fusion process is determined to be stable. Otherwise, the circuit breaker mechanism is triggered to pause the fusion and revert to the state before fusion, and the replacement module is selected again. During the parameter adaptation phase, the replacement module is compared with the current system's list of dependent components. If there is an interface version conflict or resource contention risk, the protocol is converted or the resource scheduling priority is adjusted through the interface adaptation layer. During the dynamic integration phase, the module interaction log is captured through the hook component. When a contradiction in the output results is detected, the conflict type is identified based on the fault feature library, and the conflict resolution rules verified in the historical version are used for correction. When the stability evaluation value continuously meets the threshold requirement and the fusion control factor reaches 1, the parameters of the replacement module are formally written into the current system parameter space to complete the module injection; at the same time, the injection behavior is recorded in the agent family tree, including the version traceability of the replacement module, parameter adaptation log, fusion process stability curve and performance improvement data, forming a traceable module inheritance trajectory.
8. An intelligent agent system optimization device based on intelligent fault analysis and intergenerational knowledge inheritance, characterized in that, The device includes: The anomaly signal module is used to deploy lightweight log probes to capture anomaly signals during agent interaction in real time and provide a data foundation for fault analysis. The benefit prediction module is used to construct a tool benefit prediction model based on reinforcement learning based on the abnormal signals, and automatically generate tool improvement proposals when the failure rate in a specific scenario exceeds a preset threshold. The memory inheritance module is used to establish a genealogy of intelligent agents and construct a version evolution relationship tree in combination with fault analysis, so as to realize the automatic inheritance of core memories and the discarding of invalid knowledge by new intelligent agents. The forgetting prevention module is used to deploy a catastrophic forgetting prevention device. Based on the tool improvement proposal and the agent family tree, when a key capability degradation is detected, the corresponding functional module is dynamically extracted from the agent family tree and injected. Specifically, the abnormal signal module is used to define abnormal signal types and standardize the abnormal signal template into a JSON representation. The abnormal signal types include interface timeout, status transition exception, abnormal return value, high-frequency retry / reentry, and null behavior. Each of the abnormal signal types triggers a corresponding condition formula. Based on the abnormal signal type, a probe module consisting of logging, watchdog, and hook is deployed and injected into the Agent microservice through a startup script. The watchdog calculates an anomaly score based on the triggering conditions of the abnormal signal type. Log data is collected using an asynchronous channel, formatted by a unified service, and labeled with an Agent and timestamp. The log data is then filtered, time-window aggregated, and anomaly signal counted through a Flink pipeline. An alarm is triggered when the number of anomaly signals within a unit time window exceeds a preset threshold. The processed log data is transformed into a normalized structure containing timestamps, event types, and entities. Entity extraction and relation matching are used to embed knowledge graph triples, mapping event sequence trajectories to intelligent agent task flowchart node paths. Embedding technology is then used to vectorize the trajectories and perform cluster analysis to form a fault feature library. Specifically, the benefit prediction module is used to collect execution data of intelligent agent tools in different scenarios. The execution data includes normal operation status data, abnormal fault status data, performance degradation process data, and cross-generational transfer learning data. Establish a benefit evaluation index system that includes fault detection accuracy, system response time, resource utilization efficiency, and knowledge inheritance integrity. After cleaning and standardizing the execution data, divide it into training set, validation set, and test set. A reinforcement learning model is constructed based on the aforementioned benefit evaluation index system. The state space represents the current operating state of the agent tool, and the action space represents the tool's optimization and adjustment strategy. The reward function of the reinforcement learning model comprehensively considers execution efficiency, operational safety, and resource consumption costs. The policy network is updated alternately through offline training and online optimization. The offline training adopts experience replay and target network mechanisms to improve training stability, and the online optimization achieves continuous policy enhancement through policy fine-tuning and dynamic reward adjustment. Establish a real-time monitoring system to track changes in tool failure rate. The failure rate is the ratio of the number of failed tool calls to the total number of calls within a specific time window. The failure rate is smoothed using a sliding time window and an exponentially weighted moving average method. The failure rate threshold is dynamically adjusted by combining the historical failure rate mean and standard deviation. When the smoothed failure rate exceeds the dynamically adjusted threshold, the tool improvement process is triggered. Based on the reinforcement learning model, the reasons for failure are analyzed, key abnormal segments in the tool's execution trajectory are identified through the risk accumulation metric function, and structured tool improvement proposals are automatically generated by combining historical success cases. These proposals are then prioritized according to the potential for improved execution efficiency and the cost of resource consumption.
Citation Information
Patent Citations
Steam turbine vibration fault diagnosis system fused with deep learning
CN120180040A
Real-time intelligent performance evaluation technology based on situation prediction
CN120542239A