AI agent memory self-evolution method and system based on cold-hot separation architecture

By employing a memory self-evolution method based on a hot-cold separation architecture, the system performance jitter and storage cost waste caused by ping-pong migration of memory fragments in existing technologies are solved, achieving adaptive scheduling of memory and efficient resource utilization.

CN122489494APending Publication Date: 2026-07-31BEIJING SANJU TIMES TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING SANJU TIMES TECHNOLOGY CO LTD
Filing Date
2026-05-08
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing hot and cold tiering schemes, the hotness score of memory segments fluctuates repeatedly around the threshold, causing ping-pong migration, which leads to a surge in system overhead, inconsistent response time, wasted storage costs, and failure to fully utilize the value of hot storage.

Method used

A memory self-evolution method based on a hot-cold separation architecture is adopted. By combining ping-pong migration detection, adaptive adjustment of migration inhibition coefficient and minimum residence time constraint, and sliding window analysis of memory migration direction and time interval, the migration threshold is dynamically adjusted to form a closed-loop adaptive control.

Benefits of technology

It effectively avoids frequent oscillations and invalid migrations of memory between hot and cold layers, reduces system I/O overhead and index update costs, improves access efficiency and resource utilization, and ensures that high-frequency access memory resides in the high-performance storage layer, while low-frequency access memory is stored in the low-cost storage layer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122489494A_ABST
    Figure CN122489494A_ABST
Patent Text Reader

Abstract

This invention discloses an AI agent memory self-evolution method and system based on a hot-cold separation architecture, belonging to the field of industrial data processing technology. The method includes the following steps: analyzing the heat value of each memory segment, dynamically adjusting the basic heating and cooling thresholds, determining whether the memory needs to migrate to a hot or cold layer, and using a linearly accumulated inhibition coefficient to suppress frequent ping-pong oscillations. Finally, data migration is performed and a structured event log is recorded. This invention avoids frequent data oscillations between hot and cold layers by introducing a migration inhibition coefficient and hysteresis interval design in the hot-cold tiered storage unit. It solves the problem in existing hot-cold tiered schemes where the heat score of memory segments fluctuates repeatedly around the threshold due to the use of static dual thresholds, leading to frequent migrations between hot and cold layers, forming ping-pong migrations. This enhances the adaptability to oscillating data, and all migration events are recorded in a structured manner for easy auditing and subsequent analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial data processing technology, and in particular to an AI agent memory self-evolution method and system based on a cold-hot separation architecture. Background Technology

[0002] AI agents are artificial intelligence entities built on large language models that can perceive the environment and perform autonomous decisions and tasks. Unlike traditional single-turn question-and-answer models, AI agents usually need to interact with users in multiple turns, maintain contextual consistency across conversations, and gradually accumulate experience in complex tasks. Therefore, memory ability is a key foundation for AI agents to achieve long-term stable service, personalized response, and task continuity.

[0003] In existing technologies, various approaches have emerged for memory management of AI agents. A common approach is to draw inspiration from the hierarchical nature of human memory and design a multi-level memory structure for the agent. This could include a memory system containing a time-limited query cache module, a short-term memory module, a medium-term memory module, and a long-term memory module. The time-limited query cache module is responsible for temporarily storing short-term interaction data, while the short-term, medium-term, and long-term memory modules handle memory storage tasks of different capacities and levels of abstraction. This system extracts historical dialogue information and stores the content in three levels: short-term, medium-term, and long-term. When a user initiates a query, the system retrieves relevant memory content from the corresponding memory layer based on the current question to enrich the prompt information, thereby helping the agent to better complete complex tasks.

[0004] Another technical approach focuses on the hierarchical management of memory, categorizing data into hot and cold layers. This method first preprocesses and vectorizes the historical interaction information of the AI ​​agent and stores it in the storage system. Then, the system calculates a "heat score" based on the access frequency and semantic relevance of the information, and automatically migrates data between cold and hot storage layers using a dual-threshold trigger mechanism. Furthermore, this method establishes an index mapping relationship, dynamically monitors changes in data heat, and, when necessary, moves cooled data to the lower layer or moves warmed data back to the hot layer. Simultaneously, the system monitors the storage level in real time and dynamically adjusts the migration strategy to balance efficient access to memory content with controllable storage costs. These two approaches, from the perspectives of multi-level memory stratification and hot / cold data migration, respectively, offer valuable explorations into the memory management of AI agents.

[0005] For example, the Chinese invention patent with announcement number CN120371781B discloses an AI intelligent agent memory management method and system based on hot and cold stratification, which includes: acquiring and preprocessing historical information of AI intelligent agents and storing it in vector form; calculating scores based on access frequency and semantic association; constructing a dual threshold triggering mechanism to realize data hot and cold stratification migration; establishing an index mapping and dynamically monitoring data popularity for migration; and dynamically adjusting the migration strategy by monitoring the storage level in real time.

[0006] For example, Chinese invention patent CN120875055B discloses a memory system and its updating and retrieval methods for an AI intelligent agent, including: a time-limited query cache module, a short-term memory module, a medium-term memory module, and a long-term memory module; the time-limited query cache module is used to store data within a short period of time, while the short-term, medium-term, and long-term memory modules store data of different capacities and representation methods, respectively. This invention extracts historical dialogue information and stores it in short, medium, and long-term memory. When a user asks a question, it retrieves relevant memory content based on the question content to enhance the prompt information.

[0007] The above-mentioned technology has at least the following technical problems: In existing hot and cold tiering schemes, a heat score is usually calculated based on access frequency and semantic similarity, and a static dual threshold is set to determine whether data should be migrated. This leads to frequent migrations of a memory segment between the hot and cold tiers when the heat score fluctuates around the threshold, resulting in ping-pong migration. This migration jitter causes a surge in system overhead because each migration involves file copying, index updates, and vector library synchronization, consuming a large amount of CPU resources and affecting response time. This results in the same memory sometimes responding quickly in the hot tier and sometimes requiring index lookups in the cold tier, leading to inconsistent user experience and wasted storage costs. Memory that resides in the hot tier for a short time cannot fully realize the value of hot storage but occupies valuable space. Summary of the Invention

[0008] On the one hand, a self-evolutionary method for AI agent memory based on a cold-hot separation architecture is provided. This method includes: collecting historical interaction data during the operation of the AI ​​agent, performing timestamp alignment, role completion, noise reduction and normalization processing to generate memory vectors, and storing them together with the original text in a cold-hot memory storage table; analyzing the heat value of the memory within a preset scheduling period; filtering and generating a candidate migration memory set; and synchronously initializing the migration inhibition coefficient.

[0009] Ping-pong transfer memory detection is performed on the candidate transfer memory set, and the final execution heating threshold and final execution cooling threshold are determined based on the ping-pong transfer label state of the memory and its transfer inhibition coefficient.

[0010] The residence time of candidate migration memories is analyzed, and the residence time threshold is adjusted in combination with the migration inhibition coefficient to filter by minimum residence time constraint. The migration benefit ratio of candidate migration memories that pass the minimum residence time constraint is analyzed to determine the cross-layer data migration execution strategy and execute it.

[0011] After cross-layer data migration, its migration behavior is continuously monitored, and the migration inhibition coefficient is adjusted based on its subsequent migration stability to form a closed-loop adaptive control.

[0012] On the other hand, an AI intelligent agent memory self-evolution system based on a cold and hot separation architecture is provided. This system includes: a data acquisition and candidate memory generation module, a ping-pong migration detection module, a residence constraint module, and a feedback adjustment and closed-loop control module.

[0013] The data acquisition and candidate memory generation module is used to collect historical interaction data during the operation of the AI ​​agent, perform timestamp alignment, role completion, noise reduction and normalization processing to generate memory vectors, and store them together with the original text in the cold and hot memory storage table. Within a preset scheduling period, the module analyzes the heat value of the memory, filters and generates a candidate migration memory set, and synchronously initializes the migration inhibition coefficient.

[0014] The ping-pong migration detection module is used to perform ping-pong migration memory detection on the candidate migration memory set, and determine the final execution heating threshold and the final execution cooling threshold based on the ping-pong migration label status of the memory and its migration inhibition coefficient.

[0015] The residency constraint module is used to analyze the residency duration of candidate migration memories and adjust the residency time threshold in combination with the migration inhibition coefficient to filter by minimum residency time constraints. The migration benefit ratio of candidate migration memories with minimum residency time constraints is analyzed to determine and execute the cross-layer data migration execution strategy.

[0016] The feedback adjustment and closed-loop control module is used to continuously monitor the migration behavior after cross-layer data migration, and adjust the migration inhibition coefficient based on the subsequent migration stability to form a closed-loop adaptive control.

[0017] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: 1. The AI ​​agent memory self-evolution method based on a hot-cold separation architecture provided by this invention introduces a hot-cold layered storage and dynamic migration mechanism based on heat value, and combines ping-pong migration detection, adaptive adjustment of migration inhibition coefficient, minimum residence time constraint, and migration benefit ratio analysis. This avoids frequent oscillations and invalid migrations of memory between hot and cold layers, reduces the I / O overhead and computational cost of index updates caused by repeated migrations, and continuously optimizes the migration threshold and inhibition coefficient using closed-loop feedback control. This achieves self-evolutionary intelligent scheduling of AI agent memory, ensuring that frequently accessed hot memory always resides in the high-performance storage layer to guarantee fast response, while cold memory is stably stored in the low-cost storage layer to save resources. This improves the overall system's access efficiency, resource utilization, and long-term operational stability, solving the problems of lack of stability control in memory migration, easy generation of ping-pong effect leading to performance jitter, and inability to dynamically balance access heat and migration cost in existing technologies.

[0018] 2. This invention extracts the sequence of three consecutive migration directions of a memory using a sliding window and determines whether it constitutes a round-trip structure. At the same time, it combines the time interval between adjacent migrations and the threshold of the number of round-trips to perform effective round-trip statistics, thereby accurately identifying memories with ping-pong migration behavior and recording their number of round-trips. This enables early warning and initialization of suppression coefficients for frequent hot and cold oscillations, solving the problem in the prior art that it cannot distinguish between normal migration and abnormal ping-pong migration, resulting in repeated invalid migrations consuming system resources.

[0019] 3. This invention extracts the number of round trips and the migration inhibition coefficient of ping-pong transfer memories, and makes differentiated corrections to the basic heating threshold and the basic cooling threshold. The modified execution threshold is only applied to memories marked as ping-pong transfers. This dynamically tightens the migration triggering conditions of ping-pong memories without affecting normal memory transfers, thereby achieving cooling suppression and adaptive threshold adjustment for unstable memories. This solves the problem in the prior art that fixed thresholds cannot cope with drastic fluctuations in memory temperature and are prone to inducing chain migration oscillations.

[0020] 4. This invention analyzes the residence time of candidate migration memories in the current storage layer and dynamically adjusts the residence time threshold in conjunction with the migration inhibition coefficient to perform minimum residence constraint filtering, thereby forming a closed-loop adjustment mechanism of short-term prohibition of migration, frequent penalty inhibition, and automatic window decay. This achieves fine-grained rhythm control and adaptive penalty for memory migration behavior, solving the problems of system jitter caused by allowing too frequent or adjacent migrations in the prior art, as well as the lack of self-decay capability of the inhibition coefficient. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A flowchart of an AI agent memory self-evolution method based on a cold-hot separation architecture provided in this application embodiment; Figure 2 This is a flowchart illustrating the cold and hot migration scheduling process involved in this embodiment; Figure 3 This is a flowchart illustrating the ping-pong migration detection steps involved in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an AI intelligent agent memory self-evolution system based on a cold and hot separation architecture, provided in an embodiment of this application. Detailed Implementation

[0023] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0024] Embodiment 1 of the present invention Figure 1 The diagram shows a flowchart of an AI agent memory self-evolution method based on a hot-cold separation architecture provided in this application embodiment. The method includes: collecting historical interaction data during AI agent operation; generating memory vectors after timestamp alignment, role completion, noise reduction, and normalization; storing these vectors along with the original text in a hot-cold memory storage table; calculating the heat value of each memory based on access frequency and semantic relevance within a preset scheduling period; then selecting a candidate migration memory set based on a basic heating threshold and cooling threshold; initializing a migration inhibition coefficient; and finally performing ping-pong migration detection on each memory in the candidate set, analyzing the migration direction order through a sliding window. The system identifies ping-pong memories with round-trip behavior by listing columns and time intervals. It then dynamically adjusts the heating and cooling thresholds based on the ping-pong marking status and migration inhibition coefficient as the final execution threshold. Candidate memories are filtered by minimum residence time constraints. The inhibition coefficient is dynamically adjusted by combining the historical migration count within the sliding window. Subsequently, the migration benefit ratio is calculated for memories that pass the constraints. Cross-layer data migration, index updates, and metadata synchronization are then performed. Finally, subsequent migration behavior is continuously monitored after migration, and the inhibition coefficient is adjusted in a closed-loop feedback manner based on migration stability, gradually decreasing or increasing the inhibition coefficient. This forms an adaptive and self-evolving memory hot and cold scheduling process.

[0025] Historical interaction data is collected during the operation of the AI ​​agent. All interaction data is aligned to millisecond-level timestamps using the system's master clock as a reference. For records with missing roles, user, AI agent, environment, or other agent labels are completed based on the context. Subsequently, denoising processing is performed on the dialogue text, operation trajectory, system performance indicators, and multimodal perception data. Numerical indicators are normalized, operation types are mapped to discrete IDs, images are scaled to a fixed size and normalized to pixels, and audio is converted to Mel spectrograms. Based on these, a dedicated encoder is used to vectorize them. The dialogue text is encoded into a 768-dimensional vector using sentence-level bidirectional encoder representation technology; the operation trajectory is encoded into a 256-dimensional vector using a transformer; the system performance indicators are mapped to a 128-dimensional vector through a fully connected layer; and the multimodal perception data is reduced to 512 dimensions after feature extraction by the visual geometry group. Finally, a unified memory vector is generated through fusion using a self-attention layer and stored in a cold and hot memory storage table along with the original text, timestamps, role labels, and modality identifiers. Within a preset scheduling period, the memory heat value is analyzed, and a candidate migration memory set is selected and generated, while the migration inhibition coefficient is initialized synchronously.

[0026] Among them, AI intelligent agents refer to artificial intelligence entities that can interact with the environment, perform tasks, and continuously accumulate experience data. The memories they generate include structured data content such as state perception information, decision-making paths, and intelligent agent interaction observation data. Each memory has a unique identifier, current popularity value, and recent migration timestamp in the system. To balance access performance and storage cost, a hot and cold memory storage table is used to store memory data in layers. The hot storage layer is used to store frequently accessed memories, and the cold storage layer is used to store infrequently accessed memories. The dynamic flow of memory data between the hot and cold layers is realized through a migration scheduling mechanism.

[0027] The AI ​​agent's interaction observation data generated in historical interactions is converted into a vectorized representation after being processed by timestamp alignment, role completion, noise reduction, and normalization, and then stored in a cold and hot memory storage table along with the original text.

[0028] Interactive observation data is the collection of raw records generated by AI agents when interacting with users, the environment, or other intelligent agents, including dialogue text, operation trajectories, system performance indicators, and multimodal perception data.

[0029] like Figure 2The diagram shown is a flowchart of the cold and hot migration scheduling process involved in this embodiment, including: calculating the heat value of each memory, then selecting a set of candidate migration memories and initializing the migration inhibition coefficient, then performing ping-pong migration detection and dynamic threshold correction, then performing minimum residency constraint filtering and inhibition coefficient adjustment on the candidate memories, if the migration benefit ratio is greater than or equal to the benefit threshold, then performing cross-layer migration and metadata synchronization, otherwise not migrating and adjusting the inhibition coefficient, after the migration is completed, continuously monitoring subsequent migration behavior, and further adjusting the inhibition coefficient through closed-loop feedback, thereby forming an adaptive and self-optimizing memory cold and hot scheduling process.

[0030] According to the preset scheduling cycle, the metadata of each memory in the memory state table is traversed. The total number of accesses for the memory in the most recent statistical window is read from the access log and mapped to the [0, 1] interval using max-min normalization to obtain the access frequency. At the same time, the task query vector of the current task is obtained and its dot product similarity is calculated with the memory vector converted from the original memory data by the encoding model. Then, the average of the access frequency and the dot product similarity is taken as the popularity value of the memory. After the calculation is completed, the new popularity value and the current timestamp are written into the corresponding record field in the memory state table and the old value is overwritten. The popularity value and its update timestamp are recorded to realize the periodic update and persistence of the popularity value.

[0031] The scheduling cycle is usually preset by database professionals. This cycle value is stored in the internal system configuration table and read periodically by a background daemon. When each scheduling cycle arrives, a full or incremental heat assessment task is automatically triggered, traversing the memory state table and performing access frequency statistics and semantic relevance calculations. At the same time, the scheduling cycle also supports event-based triggering logic. This preset logic ensures that the heat assessment can run at a fixed frequency while also having a certain degree of flexibility, thereby balancing system overhead and the real-time requirements of data heat.

[0032] Each memory in the memory state table is traversed, its current storage layer and the most recently calculated heat value are read. At the same time, the preset base heating threshold and base cooling threshold are obtained from the database. If the memory is currently in the cold layer and the heat value is greater than or equal to the base heating threshold, it means that the memory has been frequently accessed recently and is highly relevant to the current query semantics, and has become popular. In order to improve the performance of subsequent accesses, it needs to be moved from the cold layer to the hot layer. If the memory is currently in the hot layer and the heat value is less than or equal to the base cooling threshold, it means that the memory has been rarely accessed recently and has weak relevance, and has become unpopular. In order to save hot storage costs, it needs to be moved from the hot layer to the cold layer. If the heat value is between the cooling threshold and the heating threshold, or is in the cold layer but the heat value is less than the heating threshold, or is in the hot layer but the heat value is greater than the cooling threshold, it means that the memory is in the hysteresis interval, that is, the heat is moderate or does not meet the migration conditions. In this case, the existing storage layer can remain unchanged, and it is determined that no migration is needed to avoid frequent ping-pong effects caused by small fluctuations in heat.

[0033] The preset basic warm-up threshold and basic cooling threshold are usually determined by data analysis professionals based on historical access logs and migration behavior data. The professionals will analyze the distribution of the heat value of each memory, access patterns, and business query characteristics over a period of time, and statistically determine the proportion of memory with heat value in different intervals and the trend of actual access frequency changes. Then, in combination with storage cost and performance requirements, appropriate warm-up thresholds and cooling thresholds are selected by manual parameter tuning so that most high-frequency access memory can be warmed up in time and low-frequency access memory can be cooled down, while a certain hysteresis interval is reserved to prevent frequent migration. This preset process often requires multiple iterations of verification. Finally, the thresholds are fixed in the system configuration table and can be dynamically adjusted according to business changes in subsequent operation and maintenance.

[0034] In this embodiment, the preset logic of the time threshold, round trip threshold, migration upper limit threshold, revenue threshold, and basic dwell time threshold is similar to that of the basic heating threshold and basic cooling threshold. The specific values ​​can be flexibly set by professional technicians in combination with business scenarios, equipment characteristics and control requirements. This embodiment will not be elaborated on further.

[0035] For memories deemed to require migration, they are added to the candidate migration memory set, and the memory ID, current level, target migration direction, and current popularity value are recorded. Simultaneously, a migration inhibition coefficient is initialized for each candidate memory to prevent repeated migrations within a short period. A structured migration event is then generated and written to a pre-defined migration event log table. Each migration event contains at least three core fields: timestamp, migration direction, and the memory's current popularity value, along with metadata such as memory ID, task identifier, and entity type.

[0036] like Figure 3The flowchart of the ping-pong migration detection steps in this embodiment includes: reading the historical migration event logs of each candidate migration memory from the candidate migration memory set; extracting three consecutive migration direction sequences using a sliding window; determining whether they satisfy a round-trip structure where the first and third directions are consistent and opposite to the second direction; and simultaneously checking whether the time interval between adjacent migrations is less than a preset time threshold. Only when both the structure condition and the time interval condition are met is it counted as a valid round-trip. All valid round-trip counts are counted; if the number of round-trip counts reaches the threshold, the memory is marked as a ping-pong migration memory. Ping-pong transfer memory detection is performed on the candidate transfer memory set, and the final execution heating threshold and final execution cooling threshold are determined based on the ping-pong transfer label state of the memory and its transfer inhibition coefficient.

[0037] For each memory in the candidate migration memory set, firstly, all migration records within a preset statistical period are retrieved from the migration event log table based on the memory's unique identifier and sorted in ascending order by timestamp. Then, the migration direction field is extracted from each record and concatenated into a migration direction sequence in chronological order. Next, a sliding window of length three is used to traverse this sequence, with the window starting at the first element of the sequence. Each time, three consecutive direction values ​​are extracted from the window as a continuous migration segment, and the window is then moved one position to the right until the right end of the window exceeds the sequence length. Each extracted continuous migration segment of length three is used for subsequent round-trip structure determination.

[0038] For each continuous migration segment of length three extracted by the sliding window, the first, second, and third migration direction values ​​are obtained respectively. First, it is determined whether the first migration direction and the third migration direction are the same. If they are different, it is directly determined that the round-trip structure is not satisfied. If they are the same, it is further determined whether the second migration direction is opposite to the first migration direction. If the second migration direction is opposite to the first migration direction, it is determined that the continuous migration segment satisfies the round-trip structure; otherwise, it does not.

[0039] For consecutive migration segments that satisfy the round-trip structure, the first and second migrations in the segment are read from the migration event log table, and then a preset time threshold is obtained. If either of the two time intervals is greater than or equal to the time threshold, the round-trip is determined to be a low-frequency migration behavior, indicating that the memory stays for too long between the two migrations. This is a normal natural fluctuation in temperature rather than a short-term dense oscillation and should not be counted in the ping-pong migration count to avoid over-suppression. It does not belong to the ping-pong oscillation that needs to be suppressed, so it is not counted as a valid round-trip. The segment is skipped and the next segment is detected directly. Only when both time intervals are less than the time threshold, indicating that the round-trip structure indicates that the memory is migrating back and forth between the hot and cold layers, is the segment counted as a valid round-trip.

[0040] After completing the sliding window detection of all consecutive migration segments, the cumulative effective round-trip count of the memory is counted. If the count is greater than or equal to the preset round-trip count threshold, the memory is determined to have obvious ping-pong migration behavior and is marked as a ping-pong migration memory. At the same time, its effective round-trip count is recorded, and its migration inhibition coefficient is increased proportionally according to the size of the round-trip count. By quantifying the degree of short-term intensive round-trip between hot and cold layers, those memories that oscillate frequently and cause ineffective migration overhead are identified, thereby increasing their migration inhibition coefficient. This allows the subsequent heating and cooling thresholds to be appropriately corrected, thereby weakening the migration tendency of the memory and reducing the ping-pong phenomenon.

[0041] The database has a pre-defined mapping logic that increases the migration inhibition coefficient proportionally based on the number of round trips, using linear proportional control: after calculating the number of round trips, the increase in the inhibition coefficient is proportional to the number of round trips. The increase is equal to the proportional coefficient multiplied by the number of round trips, and the smaller of the product and the maximum allowable increase is taken. The proportional coefficient is a preset value by expert technicians. This coefficient determines the sensitivity of the inhibition coefficient increase when the number of round trips exceeds the threshold. Then, the increase is applied to the current inhibition coefficient, that is, the new inhibition coefficient is equal to the current inhibition coefficient plus the increase, so that the migration tendency of high-frequency round trip memory is reduced accordingly.

[0042] If the suppression coefficient adjustment is triggered simultaneously, it will be executed sequentially according to the natural order of occurrence of the process in this embodiment. That is, each adjustment is based on the real-time value of the current suppression coefficient for incremental update, rather than overwrite assignment. If multiple events are triggered in the same scheduling cycle, they will be calculated sequentially and superimposed. When the increase or decrease directions are opposite, algebraic summation is used. To avoid excessive adjustment in a single cycle, professional technicians will set a maximum change limit for a single cycle, and any excess will be truncated. At the same time, the reason and magnitude of each adjustment will be recorded for auditing purposes.

[0043] If the number of valid round trips is less than the preset threshold, it means that a small number of round trip migrations may be due to normal heat fluctuations or occasional changes in access patterns, and have not yet reached the severity required for additional suppression. If they are marked rashly, it will interfere with normal migration decisions. Therefore, the ping-pong marking step for this memory is skipped directly, and the ping-pong marking field in its memory status table is kept empty or negative. At the same time, the migration suppression coefficient remains unchanged, and the next memory in the candidate migration memory set is processed.

[0044] After completing the ping-pong transfer detection, records marked as ping-pong transfer memories are selected from the memory status table, and the effective round-trip count corresponding to each memory is read. The purpose of this operation is to identify those memories that have high-frequency, short-term round-trip behavior between hot and cold layers, so that the base heating threshold and base cooling threshold can be differentiated and modified according to their round-trip count and transfer inhibition coefficient, thereby specifically suppressing ping-pong oscillations.

[0045] For memories not marked as ping-pong transfer memories, it means that the number of effective round trips within the statistical period did not reach the threshold. Therefore, memories that did not undergo ping-pong transfer will not generate invalid transfer overhead due to frequent oscillations. There is no need to reduce their transfer tendency by adjusting the threshold. The basic threshold can be used directly to ensure normal hot and cold transfer decisions.

[0046] For memories marked as ping-pong transfer memories, it indicates that the number of effective round trips within the statistical period has reached or exceeded the threshold for the number of round trips, and there is short-term intensive hot and cold layer round trip behavior, which can easily lead to invalid migration overhead and system performance degradation. In order to suppress this ping-pong oscillation, the basic heating threshold is multiplied by one and a migration suppression coefficient is added, and the basic cooling threshold is multiplied by one and the migration suppression coefficient is subtracted for correction, thereby raising the heating threshold and lowering the cooling threshold. This makes it more difficult for the memory to be triggered for cross-layer migration, thereby reducing its round trip frequency. The two corrected thresholds are used as the final execution heating threshold and the final execution cooling threshold for the memory, respectively, for subsequent heat verification and migration decision-making.

[0047] The residence time of candidate migration memories is analyzed, and the residence time threshold is adjusted in combination with the migration inhibition coefficient to filter by minimum residence time constraint. The migration benefit ratio of candidate migration memories that pass the minimum residence time constraint is analyzed to determine the cross-layer data migration execution strategy and execute it.

[0048] The system reads the most recent migration completion timestamp from the memory state table. If the timestamp exists, it means the memory has undergone at least one cross-layer migration. The system then obtains the current system time, subtracts the most recent migration completion timestamp from the current system time to get the current residency duration, and checks whether each memory meets the minimum residency time constraint. This prevents recently migrated memories from being immediately migrated again, thus reducing invalid ping-pong migrations. If the timestamp of the most recent migration completion of a memory does not exist, meaning that the memory has not undergone any cross-level migration since it was stored in the cold and hot memory storage table, then the timestamp of the memory's first storage in the cold and hot memory storage table recorded in the memory status table is read as a substitute value. At the same time, the current system time is obtained to ensure the integrity of the residence time calculation. This provides an initial residence time calculation benchmark for memories that have not yet been migrated, enabling them to participate in the judgment of minimum residence time constraints. This avoids the inability to execute migration decisions or the occurrence of logical anomalies due to missing timestamps. The current residence time is obtained by subtracting it from the current system time for subsequent residence time constraint verification.

[0049] After obtaining the current residence time of the memory, the preset base residence time threshold is dynamically adjusted based on the current migration inhibition coefficient of the memory to generate the actual residence time threshold used by the memory. The adjustment method is usually to multiply the base residence time threshold by one and add the migration inhibition coefficient. That is, the larger the migration inhibition coefficient, the more likely the memory has undergone ping-pong migration or high-frequency round trips. The higher the actual residence time threshold, the more the memory must wait for a longer time after migration before it can participate in migration decision again. By extending the residence constraint time of ping-pong memory, its short-term repeated migration between hot and cold layers is further suppressed, reducing ineffective migration overhead. For unlabeled ping-pong memories, since the migration inhibition coefficient is low or zero, the actual residence time threshold is close to the base threshold and does not affect the normal migration response.

[0050] The current residence time of each memory is compared with the residence time threshold adjusted by the migration inhibition coefficient. If the current residence time is less than the threshold, the memory is determined not to meet the minimum residence time constraint, meaning that the time since the memory was last migrated or first stored is too short to stabilize its popularity. If it is migrated again immediately, it is likely to cause ping-pong oscillations. In this case, the current migration operation of the memory is suspended, and no cross-layer migration is performed on it in the current scheduling cycle. At the same time, the memory is kept in the candidate migration memory set, waiting for the next scheduling cycle to recalculate its current residence time and compare it with the threshold. By forcing a cooldown time, the memory that has just been migrated is prevented from being migrated repeatedly, thereby reducing the ineffective migration overhead. This, together with the dynamic adjustment of the migration inhibition coefficient, helps to suppress ping-pong behavior.

[0051] If the current residence time of a memory is greater than or equal to its corresponding residence time threshold, thus satisfying the minimum residence time constraint, the migration count of that memory in the migration event log table is further counted based on a sliding time window. Taking the current time as the endpoint, a preset time window length is extracted, and the total number of all cross-layer migration events occurring for that memory is counted within this window. Then, the migration inhibition coefficient of the memory is dynamically adjusted based on the statistically obtained migration count. The migration count within the window is multiplied by the step size factor preset by the professional technician and then added to the migration inhibition coefficient to obtain the updated migration inhibition coefficient. For memories that have met the residence time threshold but have been migrating frequently recently, their migration inhibition coefficient is increased, so that the subsequent residence time threshold and cold / hot migration threshold are adjusted accordingly, thereby further suppressing the tendency of repeated migration in the short term and avoiding the evolution into ping-pong oscillation. If the number of migrations within the window is small, the inhibition coefficient may remain unchanged or be appropriately reduced to release the flexibility of normal migration.

[0052] If the current residence time of a memory meets the minimum residence time constraint, then, with the current time as the endpoint, the total number of migrations of that memory in the migration event log table is counted within a preset sliding time window. Then, the count is compared with a preset migration upper limit threshold. If the count is greater than or equal to the migration upper limit, it indicates that the memory has migrated frequently in a short period of time, posing a ping-pong risk. The migration upper limit is subtracted from the count to obtain the migration deviation value. The migration inhibition coefficient is increased based on the migration deviation value. If the count is less than the migration upper limit, the migration upper limit is subtracted from the migration count to obtain the migration deviation value. The migration inhibition coefficient is decreased based on the migration deviation value, so that the migration inhibition coefficient can respond in real time to the actual migration frequency of the memory recently, realizing dynamic feedback control of ping-pong behavior and avoiding over- or under-inhibition.

[0053] The increase in the migration inhibition coefficient is obtained based on the migration deviation value and is controlled linearly proportionally. After the migration deviation value is calculated, the increase in the inhibition coefficient is proportional to the migration deviation value. The increase in the inhibition coefficient is equal to the migration number proportionality coefficient multiplied by the migration deviation value, and the smaller value between this product and the maximum allowable increase in the inhibition coefficient is taken. The migration number proportionality coefficient is a preset value by experts and technicians. This coefficient determines the sensitivity of the increase in the inhibition coefficient when the migration deviation value exceeds the benchmark range. Then, the increase in the inhibition coefficient is applied to the current inhibition coefficient. That is, the new migration inhibition coefficient is equal to the current inhibition coefficient plus the increase in the inhibition coefficient, so that the migration tendency of high-frequency round-trip memory is reduced accordingly, realizing fine feedback control, matching the degree of inhibition intensity with the degree of migration deviation from the normal level, avoiding insufficient or excessive inhibition caused by uniform increment, thereby improving the adaptive ability of ping-pong migration detection and inhibition.

[0054] When the number of migrations counted within the sliding time window is less than the preset upper limit threshold for migration, it indicates that the recent migration frequency of the memory is within the normal range and the ping-pong risk is low. At this time, the migration inhibition coefficient should be appropriately reduced to avoid excessive inhibition affecting the normal migration response. The reduction value of the migration inhibition coefficient is determined based on the deviation between the upper limit of migration and the number of counts. The larger the migration deviation value, the sparser the current migration behavior, and the more the inhibition coefficient can be reduced accordingly. The reduction value of the inhibition coefficient is equal to the migration count ratio factor multiplied by the migration deviation value, and the smaller value between this product and the maximum allowable reduction value of the inhibition coefficient is taken. The migration count ratio factor is a preset value of the expert technicians. This migration count ratio factor determines the sensitivity of the inhibition coefficient reduction when the migration deviation value exceeds the benchmark range. Then, the reduction value of the inhibition coefficient is applied to the current inhibition coefficient, that is, the new migration inhibition coefficient is equal to the current inhibition coefficient minus the reduction value of the inhibition coefficient, so that the migration tendency of high-frequency round-trip memory is reduced accordingly, realizing fine feedback control, matching the degree of inhibition intensity with the degree of migration deviation from the normal level, avoiding insufficient or excessive inhibition, thereby improving the adaptive ability of ping-pong migration detection and inhibition to obtain the updated inhibition coefficient. Meanwhile, as the sliding time window advances over time, historical migration records within the window will gradually move out of the window. Even without active adjustment, the number of migrations counted will naturally decrease, thereby indirectly reducing the inhibition coefficient. This mechanism achieves dynamic feedback adjustment of the migration inhibition coefficient, which can release the inhibition of low-frequency migration memories in a timely manner and maintain the flexibility and efficiency of cold and hot migrations.

[0055] For memories that have passed the minimum residence time constraint, a second heat check is performed based on the final execution threshold corresponding to their candidate migration direction: if the candidate direction is to migrate into a hot layer, the current heat value is checked to see if it is still greater than or equal to the final execution heating threshold; if the candidate direction is to migrate into a cold layer, the current heat value is checked to see if it is still less than or equal to the final execution cooling threshold. There may be a time difference between the generation of the candidate set from the basic migration scheduling and the completion of the residence time check. The heat value of the memory may change during this period, causing the memory that originally met the migration conditions to no longer meet the threshold requirements. The second check can avoid invalid migration decisions caused by heat fluctuations and ensure that only memories whose heat status still meets the final threshold can enter the subsequent benefit calculation and migration execution stage, thereby improving the accuracy of migration decisions and resource utilization.

[0056] If the secondary check finds that the current heat value of a memory does not meet the final execution threshold corresponding to its candidate migration direction (e.g., the heat value is lower than the final execution heating threshold when the candidate migrates into a hot layer, or the heat value is higher than the final execution cooling threshold when the candidate migrates into a cold layer), then the memory is determined to no longer meet the migration conditions. In this case, no cross-layer migration operation is performed, and the current processing flow for the memory is directly terminated. At the same time, the memory is retained in the candidate migration memory set, waiting to participate in the residence time check and heat check again in the next scheduling cycle. Retaining it in the candidate set allows the memory to be re-evaluated in the next cycle, avoiding the permanent loss of migration opportunities due to a single check failure.

[0057] If a memory passes the secondary verification (i.e., its current heat value meets the final execution threshold corresponding to its candidate migration direction), then the access benefit of that memory is further evaluated. The access frequency of that memory within the current statistical period is calculated. For memories that have undergone cold / hot migration, the access logs during their time in the cold and hot layers are calculated separately. For warming migrations from the cold layer to the hot layer, the benefit equals the access frequency within the current scheduling period multiplied by the difference between the average access latency of the cold layer and the average access latency of the hot layer, i.e., the expected saving in access time cost. When the benefit is greater than the migration cost, it is considered executable. For cooling migrations from the hot layer to the cold layer, the benefit is defined as the memory data volume multiplied by the heat value. The difference between the unit storage cost of the cold tier and the unit storage cost of the hot tier represents the storage cost saved per scheduling cycle by migrating to the cold tier. This difference is then divided by a preset unit time cost conversion factor. This unit time cost conversion factor is a constant preset by a professional technician, representing how much time is willing to be spent in exchange for a unit storage cost saving. This quantifies the potential performance improvement brought about by the migration operation, making migration decisions not only based on the hot threshold but also combined with the actual access patterns and storage tier performance differences. This prioritizes the migration of high-frequency access and latency-sensitive memories, avoiding low-frequency or latency-insensitive memories from undergoing low-return migrations, thereby improving the resource utilization efficiency of the migration operation.

[0058] While evaluating the access benefits, the migration cost of migrating memory from the current storage layer to the target storage layer is also calculated. The migration cost mainly consists of two parts: first, the data migration time overhead estimated based on the memory data volume and the transmission bandwidth between storage layers; and second, the index update operation time required to update the vector index and metadata mapping after the migration. Both of these overheads are quantified in time units and added together to obtain the total time cost. This unifies the system load and latency impact brought by the migration into a comparable time dimension, which facilitates the subsequent calculation of the migration benefit ratio with the access benefits, thereby determining whether the migration is worthwhile. The migration cost consists of two parts: data migration time overhead and index update operation time. These two indicators are completely symmetrical in the cold-to-hot and hot-to-cold migration directions. The data volume and the transmission bandwidth between storage layers are the same, so the migration time is the same. Whether the index is migrated in or out, the metadata mapping or vector index needs to be modified, and the operation complexity and time consumption are also the same. Therefore, the calculation of migration cost is independent of the migration direction and can always be quantified by the same formula.

[0059] The calculated access benefit is divided by the migration cost to obtain the migration benefit ratio, which is used to measure the efficiency between the performance improvement brought by this migration and the required overhead. If the migration benefit ratio is less than the preset benefit threshold, it is determined that the benefit of this migration is insufficient to cover its cost, which is a low-benefit operation. At this time, the memory is marked as a low-benefit state, and the cross-layer data migration execution strategy is marked as no migration is performed, that is, no actual migration operation is performed this time. At the same time, the migration suppression coefficient of the memory is dynamically adjusted according to the deviation between the migration benefit ratio and the benefit threshold. The larger the deviation value, the lower the migration efficiency, and the more the migration suppression coefficient increases, thereby further reducing the migration tendency of the memory in subsequent scheduling cycles. The feedback control mechanism automatically suppresses low-benefit migration requests to avoid ineffective resource consumption, and links the suppression strength with the degree of benefit deviation to achieve fine-grained adaptive adjustment.

[0060] The migration inhibition coefficient of the memory is dynamically adjusted based on the deviation between the migration gain ratio and the gain threshold, using linear proportional control: after subtracting the gain threshold from the migration gain ratio to obtain the gain deviation value, the increase in the migration inhibition coefficient is proportional to the deviation value. The increase in the migration inhibition coefficient is equal to the gain ratio coefficient multiplied by the gain deviation value, and the smaller value between this product and the maximum allowable increase is taken. The gain ratio coefficient is a preset value by expert technicians, which determines the sensitivity of the increase in the inhibition coefficient when the gain ratio deviation value exceeds the benchmark range. Subsequently, the increase in the migration inhibition coefficient is applied to the current inhibition coefficient, that is, the new migration inhibition coefficient is equal to the current inhibition coefficient plus the increase in the migration inhibition coefficient, so that the migration tendency of memories with too low or too high migration gain ratio is reduced accordingly, realizing fine-grained feedback control, matching the degree of inhibition intensity with the degree of deviation of the gain ratio from the normal level, avoiding insufficient or excessive inhibition caused by uniform increment, thereby improving the adaptive capability of ping-pong migration detection and inhibition based on gain assessment.

[0061] When the migration benefit ratio is greater than or equal to the preset benefit threshold, it indicates that the performance improvement brought by this migration is sufficient to cover its time cost, and it is a high-benefit operation. The cross-layer data migration execution strategy is recorded as execution migration, and the memory is added to the migration execution queue. Then, the memory data is migrated from the current storage layer to the target storage layer to complete the cross-layer data transfer. Then, the vector index related to the memory is updated. Finally, the metadata information is updated synchronously to ensure the consistency of each unit, so that the high-benefit migration can take effect in a timely manner, while avoiding data inconsistency or index errors.

[0062] After the migration is completed, a new migration event record is added to the migration event log table, including fields such as timestamp, memory ID, migration direction, data volume, and migration time. This record is used for subsequent ping-pong detection, frequency statistics, and suppression coefficient adjustment. At the same time, the most recent migration completion timestamp of the memory in the memory status table is updated to the current system time, and its cumulative migration count is incremented by one. By persisting the migration history, an accurate data foundation is provided for subsequent residence time verification, sliding window statistics, and feedback control. Meanwhile, the most recent migration timestamp is updated to ensure that the next minimum residence time constraint can be calculated based on the latest migration completion time, forming a closed-loop migration self-evolution management.

[0063] After cross-layer data migration, its migration behavior is continuously monitored, and the migration inhibition coefficient is adjusted based on its subsequent migration stability to form a closed-loop adaptive control.

[0064] After the cross-layer data migration is completed, a post-migration monitoring window is established for the memory. That is, the migration behavior of the memory is tracked and recorded in a key manner within the subsequent preset continuous scheduling cycle. During this period, each time a new migration event occurs for the memory, its migration direction, migration timestamp, and cumulative migration count are continuously written into the migration event log table to form dense observation data for the memory. Through short-term intensive monitoring after migration, it is possible to quickly capture whether the memory has reversed migration shortly after migration, thereby effectively identifying early signs of ping-pong oscillations and providing timely and accurate data support for subsequent ping-pong detection, dynamic adjustment of inhibition coefficient, and correction of residence time threshold.

[0065] At the end of each scheduling cycle, based on the migration event logs collected within the post-migration monitoring window, the migration frequency of the memory in the current cycle and whether there are any alternating back-and-forth migration segments are statistically analyzed. If no alternating back-and-forth migration behavior is detected by the technical personnel within a preset number of consecutive scheduling cycles, it is determined that the migration behavior of the memory has stabilized and there is no longer a risk of ping-pong oscillation. At this time, the migration inhibition coefficient of the memory is gradually reduced according to the preset decay step size until it is restored to the initial value. When the ping-pong risk is eliminated, the excessive inhibition is released in time, so that the memory can migrate normally in response to changes in heat, avoiding permanent migration inhibition from affecting the system flexibility and achieving adaptive recovery of the inhibition coefficient.

[0066] If the memory is detected to be migrating back and forth again within the post-migration monitoring window, it is determined that it still has the risk of frequent migration or ping-pong oscillation and has not yet stabilized. At this time, the migration inhibition coefficient of the memory is increased by a preset step size to enhance the inhibition of its subsequent migration. At the same time, a prompt message is generated to notify the operation and maintenance personnel or upper-level applications that the memory has continuous ping-pong behavior. Progressive inhibition and reinforcement are implemented for memories that repeatedly migrate back and forth to prevent ping-pong behavior from continuously consuming system resources. The prompt message enables observability and facilitates manual intervention for further analysis.

[0067] like Figure 4 The schematic diagram of the AI ​​intelligent agent memory self-evolution system based on the cold and hot separation architecture provided in the embodiments of this application includes: a data acquisition and candidate memory generation module, a ping-pong migration detection module, a residence constraint module, and a feedback adjustment and closed-loop control module.

[0068] The data acquisition and candidate memory generation module is used to collect historical interaction data during the operation of the AI ​​agent, perform timestamp alignment, role completion, noise reduction and normalization processing to generate memory vectors, and store them together with the original text in the cold and hot memory storage table. Within a preset scheduling period, the module analyzes the heat value of the memory, filters and generates a candidate migration memory set, and synchronously initializes the migration inhibition coefficient.

[0069] The ping-pong migration detection module is used to perform ping-pong migration memory detection on the candidate migration memory set, and determine the final execution heating threshold and the final execution cooling threshold based on the ping-pong migration label status of the memory and its migration inhibition coefficient.

[0070] The residency constraint module is used to analyze the residency duration of candidate migration memories and adjust the residency time threshold in combination with the migration inhibition coefficient to filter by minimum residency time constraints. The migration benefit ratio of candidate migration memories with minimum residency time constraints is analyzed to determine and execute the cross-layer data migration execution strategy.

[0071] The feedback adjustment and closed-loop control module is used to continuously monitor the migration behavior after cross-layer data migration, and adjust the migration inhibition coefficient based on the subsequent migration stability to form a closed-loop adaptive control.

[0072] In Embodiment 2 of the present invention, based on the unchanged aspects of Embodiment 1, the migration inhibition coefficient can be dynamically adjusted according to the relationship between the number of migrations and the preset migration upper limit. This can be achieved by dynamically adjusting the migration inhibition coefficient through an exponential backoff and migration interval decay mechanism. The specific analysis method is as follows: For each memory, three variables are maintained independently in the database: the current migration inhibition coefficient, the timestamp of the last migration completion, and the count of consecutive short-interval migrations.

[0073] After a memory completes a cross-level migration, the current system time is recorded. If there is no previous migration record, the previous migration time is updated directly and the current cycle ends. Otherwise, the time interval between the current time and the previous migration time is calculated, and a baseline interval threshold is set.

[0074] The baseline interval threshold is preset based on the system's fixed scheduling cycle duration as the basic time unit. The baseline interval threshold is set to an integer multiple of the scheduling cycle duration. The multiple is explicitly specified by professional technicians through the configuration file. Therefore, the baseline interval threshold is the scheduling cycle duration multiplied by the preset multiple. This threshold is loaded once when the system starts up and remains unchanged during operation. It does not rely on any historical statistical data or uncertain external sources. All data are known system configuration parameters.

[0075] If the time interval is less than the baseline interval threshold, it indicates that the time between the current migration and the previous migration is too short, meaning that the two migrations occurred too closely and have not yet experienced a sufficient stabilization period. Therefore, it is determined to be a short-interval migration, and punitive suppression measures need to be applied to the memory to prevent frequent cross-layer oscillations caused by short-term heat fluctuations. The consecutive short interval count is increased by one, and then the suppression coefficient is updated according to the exponential backoff rule. That is, the new suppression coefficient is equal to the base step size multiplied by two minus the previous consecutive short interval count, while ensuring that the new suppression coefficient does not exceed the preset upper limit value.

[0076] If the time interval is greater than or equal to the baseline interval threshold, it means that the time interval between this migration and the last migration is long enough, and the memory has undergone a sufficient stabilization period at the new level. There has been no frequent short-interval migration behavior. Therefore, it is determined that the migration behavior tends to be stable, the consecutive short-interval count is reset to zero, and the current inhibition coefficient is exponentially decayed. That is, the new inhibition coefficient is equal to the original inhibition coefficient multiplied by the decay factor preset by the professional technician, while ensuring that the new inhibition coefficient is not less than zero.

[0077] The updated suppression coefficient will be used to subsequently correct the base heating threshold and base cooling threshold. That is, the base heating threshold is multiplied by the suppression coefficient to obtain the final execution heating threshold, and the base cooling threshold is divided by the suppression coefficient to obtain the final execution cooling threshold. This suppresses the rapid growth of frequent short-interval migrations, while giving an exponentially decaying reward to stable migrations. Finally, the last migration time is updated to the current time to complete the processing of this cycle.

[0078] While an overview of the subject matter has been described with reference to specific example embodiments, various modifications and changes can be made to these embodiments without departing from the broader scope of embodiments of this disclosure. Such embodiments of the subject matter are referred to herein, individually or collectively, as inventions, for convenience only, and if more than one disclosure or concept is disclosed in fact, it is not intended to limit the scope of this application to any single disclosure or concept.

[0079] The embodiments described herein have been described in sufficient detail to enable those skilled in the art to practice the disclosed teachings. Other embodiments may be used and derived therefrom, such that structural and logical substitutions and changes may be made without departing from the scope of this disclosure. Therefore, the detailed description should not be construed as limiting, and the scope of the various embodiments is defined only by the appended claims and the full scope of their equivalents.

Claims

1. A self-evolutionary method for AI agents based on a hot-cold separation architecture, characterized in that, Includes the following steps: During the operation of the AI ​​agent, historical interaction data is collected, and memory vectors are generated after time stamp alignment, role completion, noise reduction and normalization. These vectors are stored together with the original text in the cold and hot memory storage table. The heat value of the memory is analyzed within the preset scheduling cycle, and a candidate migration memory set is selected and generated to synchronously initialize the migration inhibition coefficient. Ping-pong transfer memory detection is performed on the candidate transfer memory set, and the final execution heating threshold and final execution cooling threshold are determined based on the ping-pong transfer label state of the memory and its transfer inhibition coefficient. The residence time of candidate migration memories is analyzed, and the residence time threshold is adjusted in combination with the migration inhibition coefficient to filter by minimum residence time constraint. The migration benefit ratio of candidate migration memories with minimum residence time constraint is analyzed to determine the cross-layer data migration execution strategy and execute it. After cross-layer data migration, its migration behavior is continuously monitored, and the migration inhibition coefficient is adjusted based on its subsequent migration stability to form a closed-loop adaptive control.

2. The AI ​​agent memory self-evolution method based on a cold-hot separation architecture as described in claim 1, characterized in that: The process involves collecting historical interaction data during the operation of the AI ​​agent, performing timestamp alignment, role completion, noise reduction, and normalization to generate a memory vector, which is then stored along with the original text in a cold and hot memory storage table. The memory's popularity value is analyzed within a preset scheduling period. The specific analysis method is as follows: The AI ​​agent's interaction observation data generated in historical interactions is converted into a vectorized representation after being processed by timestamp alignment, role completion, noise reduction and normalization, and stored together with the original text in a cold and hot memory storage table; The interactive observation data is a collection of raw records generated by the AI ​​agent when interacting with users, the environment, or other intelligent agents, including dialogue text, operation trajectory, system performance indicators, and multimodal perception data; The hot and cold memory storage table reads the access frequency of each memory and obtains the current task query vector. It calculates the similarity with the memory vector as the semantic relevance. The average of the access frequency and the semantic relevance is processed to calculate the memory's popularity value and update it to the memory status table. At the same time, the popularity value and its update timestamp are recorded. When the preset base heating threshold and base cooling threshold determine that a memory needs to be migrated from the hot layer to the cold layer or from the cold layer to the hot layer, a structured migration event is recorded synchronously, which includes three core fields: timestamp, migration direction, and the current heat value of the memory. The structured migration event is written to the preset migration event log table. Each event also includes the memory ID, task identifier, and entity type metadata.

3. The AI ​​agent memory self-evolution method based on a cold-hot separation architecture as described in claim 1, characterized in that: The process of screening and generating a candidate migration memory set while simultaneously initializing the migration inhibition coefficient is analyzed using the following specific method: When the basic migration scheduling task is triggered at fixed time intervals, the memory state table is traversed to read the current heat value of each memory and its storage layer. When the memory is located in the cold layer and the heat value is greater than or equal to the temperature rise threshold, it is marked as a candidate for migration into the hot layer; When the memory is located in the hot layer and the heat value is less than or equal to the cooling threshold, it is marked as a candidate to migrate into the cold layer; When the heat value is between the cooling threshold and the heating threshold, or when the memory is in the cold layer and the heat value is less than the heating threshold, or when the memory is in the hot layer and the heat value is greater than the cooling threshold, the memory is determined to be in the hysteresis interval, its current storage layer remains unchanged, and no migration request is generated. The marked candidate migration hot layer and candidate migration cold layer memories are added to the candidate migration memory set, and their memory ID, current level, candidate migration direction and current heat value are recorded. At the same time, the migration inhibition coefficient of each memory is initialized.

4. The AI ​​agent memory self-evolution method based on a cold-hot separation architecture as described in claim 1, characterized in that: The specific analysis method for performing ping-pong transfer memory detection on the candidate transfer memory set is as follows: For each memory in the candidate migration memory set, read its migration event log within the statistical period, extract the migration direction sequence in chronological order, and use a sliding window method to extract continuous migration segments of length three from the migration direction sequence. For each consecutive migration segment, determine whether its migration direction satisfies the round-trip structure, that is, determine whether the first migration direction is consistent with the third migration direction and opposite to the second migration direction; If the structure is not satisfied, the continuous migration segment is determined not to constitute a round-trip structure, the segment is skipped directly and the next segment is detected. If the round-trip structure is satisfied, the time interval between two adjacent migrations in the continuous migration segment is further calculated. If any time interval is greater than or equal to a preset time threshold, the round-trip is determined to be a low-frequency migration behavior and is not counted in the effective round-trip count. A continuous migration segment is counted as a valid round trip only if both the round-trip structure and the adjacent time intervals are less than the time threshold. After all consecutive migration segments have been detected, the number of valid round trips is counted. If the number of valid round trips is greater than or equal to the number of round trips threshold, the memory is marked as a ping-pong transfer memory, its number of round trips is recorded, and its migration inhibition coefficient is increased according to the number of round trips. If the number of valid round trips is less than the threshold, it is determined that there is no ping-pong transfer behavior in the memory and no ping-pong labeling is performed.

5. The AI ​​agent memory self-evolution method based on a cold-hot separation architecture as described in claim 1, characterized in that: The final execution heating threshold and final execution cooling threshold are determined based on the memorized ping-pong migration marker state and its migration inhibition coefficient. The specific analysis method is as follows: Extract ping-pong transfer memories and round-trip times from the candidate transfer memory set; For unlabeled ping-pong transfer memories, the preset base heating and cooling thresholds are directly used as the final execution heating and cooling thresholds; For memories marked as ping-pong transfer memories, the base heating threshold and base cooling threshold are adjusted according to the current transfer inhibition coefficient of each memory, and the adjusted base heating threshold and base cooling threshold are used as the final execution heating threshold and final execution cooling threshold.

6. The AI ​​agent memory self-evolution method based on a cold-hot separation architecture as described in claim 1, characterized in that: The analysis of candidate transfer memory residence time, combined with the transfer inhibition coefficient to adjust the residence time threshold, is used for minimum residence time constraint filtering. The specific analysis method is as follows: Read the timestamp of the most recent migration completion for each memory in the candidate migration memory set. If a timestamp of the most recent migration completion exists, directly obtain the current system time. If the timestamp of the most recent migration completion does not exist, the time when the memory was stored in the cold and hot memory storage table is used as a substitute, and the current system time is obtained. The time difference between the two is recorded as the current residence time of each memory. The residence time threshold of the memory is adjusted according to the migration inhibition coefficient and the basic residence time threshold. If the current residence time of a memory is less than the corresponding residence time threshold, it is determined that the minimum residence time constraint is not met, and its migration operation is suspended. The migration will not be performed in this cycle, and the memory will be retained in the candidate migration memory set until the next scheduling cycle to participate in the current residence time judgment again. If the current residence time of a memory is greater than or equal to the corresponding residence time threshold, the migration inhibition coefficient is dynamically adjusted based on the migration event log table counted by the sliding time window.

7. The AI ​​agent memory self-evolution method based on a cold-hot separation architecture as described in claim 6, characterized in that: The method for dynamically adjusting the migration suppression coefficient based on the migration event log table using a sliding time window is as follows: The migration inhibition coefficient is dynamically adjusted based on the migration event log table by counting the number of migrations of the memory in the sliding time window and the relationship between the number of migrations and the preset migration limit. When the number of migrations is greater than or equal to the upper limit of migration, the increase in the migration inhibition coefficient is determined based on the deviation between the number of migrations and the upper limit of migration. When the number of migrations is less than the upper limit of migration, the migration inhibition coefficient is reduced based on the deviation between the upper limit of migration and the number of migrations. As time progresses, historical migration records in the sliding window are gradually moved out, and the number of migrations automatically decreases.

8. The AI ​​agent memory self-evolution method based on a cold-hot separation architecture as described in claim 1, characterized in that: The candidate migration memories constrained by minimum residence time are analyzed for their migration benefit ratios to determine and execute cross-layer data migration strategies. The specific analysis method is as follows: For memories that pass the minimum dwell time constraint, the current heat value is checked again based on its candidate migration direction to see if it still meets the final execution heat-up threshold or the final execution heat-down threshold. If the conditions are not met, the migration will not be performed and the current processing of the memory will end. The memory will be retained in the candidate migration memory set to wait for re-verification in the next cycle. If the condition is met, the access frequency of the memory in the current cycle is counted, and the latency difference between accessing the cold layer and accessing the hot layer is estimated. The product of the two is taken as the access benefit. Simultaneously calculate migration costs, including the data migration time overhead corresponding to the data volume and the time consumed by index update operations, and convert them into time costs in a unified manner; The migration benefit ratio is obtained based on access benefits and time costs. When the migration benefit ratio is less than the preset benefit threshold, the memory is marked as a low benefit state, the cross-layer data migration execution strategy is marked as not executing migration, and the migration inhibition coefficient is adjusted by the deviation between the migration benefit ratio and the benefit threshold to achieve feedback control. When the migration benefit ratio is greater than or equal to the preset benefit threshold, the cross-layer data migration execution strategy is recorded as execution migration, the memory is added to the migration execution queue, and the cross-layer data migration, vector index update and metadata synchronization operations are executed in sequence. After the migration is completed, record the migration event log and update the most recent migration timestamp and migration count for that memory.

9. The AI ​​agent memory self-evolution method based on a cold-hot separation architecture as described in claim 1, characterized in that: After the cross-layer data migration, its migration behavior is continuously monitored, and the migration inhibition coefficient is adjusted based on its subsequent migration stability to form a closed-loop adaptive control. The specific analysis method is as follows: After cross-layer data migration, a post-migration monitoring window is established to record the migration execution memory. The migration event log is continuously recorded in the subsequent preset continuous scheduling cycle, including migration direction, migration timestamp and migration number. At the end of each scheduling cycle, the migration frequency of the memory and whether there are alternating round-trip migration segments are statistically analyzed based on the monitoring window. When no alternating round-trip migration behavior is detected within a preset number of consecutive scheduling cycles, the migration behavior of the memory is determined to be stable, and its migration inhibition coefficient is gradually reduced by a preset step size until it is restored to the initial value or lower limit value. When round-trip migration behavior is detected again within the monitoring window, it is determined that frequent migration or ping-pong behavior still exists. The migration inhibition coefficient is increased by a preset step size, and a prompt message is generated simultaneously.

10. An AI intelligent agent memory self-evolution system based on a cold-hot separation architecture, characterized in that, include: The module includes a data acquisition and candidate memory generation module, a ping-pong migration detection module, a dwell constraint module, and a feedback adjustment and closed-loop control module. The data acquisition and candidate memory generation module is used to collect historical interaction data during the operation of the AI ​​agent, perform timestamp alignment, role completion, noise reduction and normalization processing to generate memory vectors, and store them together with the original text in the cold and hot memory storage table. Within a preset scheduling period, the heat value of the memory is analyzed, and a candidate migration memory set is selected and generated to synchronously initialize the migration inhibition coefficient. The ping-pong migration detection module is used to perform ping-pong migration memory detection on the candidate migration memory set, and determine the final execution heating threshold and the final execution cooling threshold based on the ping-pong migration label state of the memory and its migration inhibition coefficient. The residence constraint module is used to analyze the residence time of candidate migration memories and adjust the residence time threshold in combination with the migration inhibition coefficient to filter by minimum residence time constraint. Through the candidate migration memories with minimum residence time constraint, the migration benefit ratio is analyzed to determine the cross-layer data migration execution strategy and execute it. The feedback adjustment and closed-loop control module is used to continuously monitor the migration behavior after cross-layer data migration, and adjust the migration inhibition coefficient based on its subsequent migration stability, thereby forming a closed-loop adaptive control.