Intelligent agent memory management method and device based on asynchronous processing and storage medium

The intelligent agent memory management method, which uses asynchronous processing and multi-storage area design, solves the response latency and model dependency problems caused by synchronous writing in existing technologies, achieving fast response, reduced costs and improved auditability, and is applicable to fields such as finance and healthcare.

CN121598989BActive Publication Date: 2026-04-14ZHUHAI FANTAI GEEK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-30
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing intelligent agent memory systems suffer from high response latency due to synchronous writing, system fragility and unauditability due to model dependence, and cannot meet the requirements of high concurrency and compliance.

Method used

An asynchronous processing architecture is adopted, in which interactive events are appended to an immutable storage area in the form of raw data, processed asynchronously through an event queue and judged for importance based on preset rules or model scoring, and structured memory data is stored in partitions, supporting complete auditing and traceability.

Benefits of technology

Reduce interaction response latency, lower model call costs, improve the auditability of memory processing and system reliability, and meet high concurrency and compliance requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121598989B_ABST
    Figure CN121598989B_ABST
Patent Text Reader

Abstract

The application provides an agent memory management method and device based on asynchronous processing and a storage medium. The method comprises the following steps: after an interaction event is written into a first storage area, a processing event associated with an event identifier is published to an event queue, and the corresponding interaction event is read from the first storage area according to the event identifier; when the interaction event passes an importance determination, the interaction event is converted into structured memory data; a second storage area is determined based on a type identifier field of the structured memory data, and the structured memory data is written into at least one second storage area; a query request is parsed to obtain a query condition, at least one target second storage area is determined based on the query condition, the structured memory data related to the query request is read from the target second storage area and is subjected to aggregation processing, and the aggregated memory data is output to an agent to generate a response result. The application can reduce interaction response delay, reduce model calling cost and improve memory processing auditability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus and storage medium for intelligent agent memory management based on asynchronous processing. Background Technology

[0002] With the development of artificial intelligence technology, intelligent agents are widely used in finance, healthcare, education, and other scenarios for information consultation, task processing, and personalized services. To maintain the continuity of cross-turn dialogues, intelligent agents typically need to possess memory management capabilities to extract key information from user interactions and retrieve and reuse it in subsequent interactions. Existing intelligent agent memory systems mostly adopt a synchronous processing architecture: after receiving a user message, they immediately call the model to perform memory retrieval, classification, or scoring, and write the processing results into the storage system; at the same time, they generally adopt a single storage architecture, storing different types of memory data uniformly in the same type of storage medium, and lack immutable preservation of original interaction events and recording of decision-making processes in the processing chain.

[0003] The aforementioned existing technologies have the following problems: First, synchronous writing links event consumption, model invocation, and storage writing on the critical interaction path. The time-consuming model invocation can easily lead to increased response latency, limited throughput, and the risk of queue accumulation and event loss. Second, memory processing is highly dependent on model services. When the model is unavailable or its performance fluctuates, the processing flow can be interrupted, and the invocation cost increases significantly with concurrency, making it difficult to scale independently in stages. Third, there is a lack of complete auditing and traceability mechanisms, making it difficult to explain the basis for memory retention or rejection. The original data context is easily lost, making compliance auditing and problem localization difficult. Summary of the Invention

[0004] In view of this, embodiments of this application provide an intelligent agent memory management method, apparatus and storage medium based on asynchronous processing to solve the problems of synchronous write blocking, fragile model dependency and untraceable processing in the prior art.

[0005] A first aspect of this application provides an agent memory management method based on asynchronous processing, comprising: receiving an interaction event between a user and an agent; generating an event identifier for identifying the interaction event; and appending the interaction event to a first storage area in the form of raw data, wherein the first storage area is an immutable storage area; after the interaction event is written to the first storage area, publishing a processing event associated with the event identifier to an event queue, enabling an asynchronous processing module to obtain the processing event based on the event queue, and reading the corresponding interaction event from the first storage area according to the event identifier; and having the asynchronous processing module perform an importance determination on the interaction event, the importance determination including determination based on preset rules or based on model output. The system performs the following steps: First, it compares the score with a threshold. Second, when an interaction event passes the importance assessment, it converts the event into structured memory data. Third, it determines a second storage area based on the type identifier field of the structured memory data and writes the structured memory data into at least one second storage area. The system configures at least two second storage areas, each used to store different types of structured memory data. Fourth, upon receiving a query request, it parses the query request to obtain query conditions. Based on these conditions, it determines at least one target second storage area, reads the structured memory data related to the query request from the target second storage area, performs aggregation processing, and outputs the aggregated memory data to the agent for generating a response result.

[0006] A second aspect of this application provides an intelligent agent memory management device based on asynchronous processing, comprising: a receiving module, configured to receive interaction events between a user and an intelligent agent, generate an event identifier for identifying the interaction events, and append the interaction events to a first storage area in the form of raw data, wherein the first storage area is an immutable storage area; a publishing module, configured to publish a processing event associated with the event identifier to an event queue after the interaction events are written to the first storage area, enabling the asynchronous processing module to obtain the processing events based on the event queue and read the corresponding interaction events from the first storage area according to the event identifier; and a determination module, configured to perform an importance determination on the interaction events by the asynchronous processing module, the importance determination including determination based on preset rules or based on model output. The system comprises the following modules: a score comparison and threshold determination module; a conversion module, used to convert interactive events into structured memory data when the event passes the importance determination; a determination module, used to determine a second storage area based on the type identifier field of the structured memory data, and write the structured memory data into at least one second storage area, wherein the system is configured with at least two second storage areas, and different second storage areas are used to store different types of structured memory data; and an output module, used to parse the query request to obtain the query conditions when a query request is received, determine at least one target second storage area based on the query conditions, read the structured memory data related to the query request from the target second storage area and perform aggregation processing, and output the aggregated memory data to the agent for generating response results.

[0007] A third aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.

[0008] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:

[0009] By receiving interaction events between the user and the agent, an event identifier is generated to identify the interaction event, and the interaction event is appended to the first storage area in the form of raw data. The first storage area is an immutable storage area. After the interaction event is written to the first storage area, the processing event associated with the event identifier is published to the event queue, enabling the asynchronous processing module to retrieve the processing event based on the event queue and read the corresponding interaction event from the first storage area according to the event identifier. The asynchronous processing module performs an importance determination on the interaction event, which includes determination based on preset rules or determination based on a comparison between the model output score and a threshold. When the interaction event passes the importance determination, the interaction event is converted into structured memory data. A second storage area is determined based on the type identifier field of the structured memory data, and the structured memory data is written to at least one second storage area. The system configures at least two second storage areas, and different second storage areas are used to store different types of structured memory data. When a query request is received, the query request is parsed to obtain the query conditions. At least one target second storage area is determined based on the query conditions. The structured memory data related to the query request is read from the target second storage area and aggregated. The aggregated memory data is output to the agent for generating the response result. This application can reduce interactive response latency, reduce model call costs, and improve the auditability of memory processing. Attached Figure Description

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

[0011] Figure 1 This is a flowchart illustrating the intelligent agent memory management method based on asynchronous processing provided in an embodiment of this application;

[0012] Figure 2 This is a schematic diagram of the structure of the intelligent agent memory management device based on asynchronous processing provided in the embodiments of this application;

[0013] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0014] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0015] With the rapid development of artificial intelligence technology, agent systems are being widely used in finance, healthcare, education, and other fields. Agents need to possess memory capabilities, enabling them to extract, store, and retrieve relevant information from interactions with users in order to provide personalized service experiences.

[0016] Existing intelligent agent memory systems mainly adopt the following technical approaches:

[0017] 1. Synchronous Processing Architecture: When an agent receives a user message, it immediately invokes the Large Language Model (LLM) for memory retrieval and processing, and then writes the processing result directly into the storage system. The typical flow of this architecture is: receive interaction event → invoke LLM to retrieve memory → write to storage system → return response.

[0018] 2. Single storage architecture: Uses a single storage system (such as a vector database or relational database) to store all types of memory data, lacking dedicated storage optimizations for different memory types.

[0019] 3. Synchronous write architecture: Memory retrieval and storage are performed synchronously with user interaction responses, and processing latency directly affects user experience.

[0020] In the implementation of intelligent agent memory systems, existing technologies typically employ the following methods:

[0021] Direct storage method: All interactions between the user and the agent are directly stored as memory without quality assessment or classification. This method results in a large amount of low-value content being stored, impacting retrieval efficiency.

[0022] Single storage method: All memory data is stored in a single type of storage system, which cannot optimize storage and retrieval based on the characteristics of different memory types.

[0023] Synchronous processing method: Memory processing and user interaction are carried out simultaneously. When the processing takes a long time (such as an LLM call that takes 30-60 seconds), it will block the user response and affect the user experience.

[0024] However, existing technologies still have the following defects and shortcomings:

[0025] Defect 1: Synchronous writes cause system blocking and performance bottlenecks.

[0026] Existing technologies employ a synchronous write architecture, where the processing and storage of interactive events occur concurrently with user interaction responses. This results in serious performance and reliability issues, such as:

[0027] High response latency: Users need to wait for all steps such as memory retrieval, processing, and storage to be completed before they receive a response. When the processing time is long (such as an LLM call that takes 30-60 seconds), the user's waiting time increases significantly.

[0028] System throughput is limited: synchronous processing means that the system can only process interactive events serially, which cannot fully utilize system resources, and the throughput is limited by the time taken by a single processing flow.

[0029] Event loss risk: When the processing service is slow or malfunctions, event consumption is blocked, and events accumulate in the queue, which may lead to memory overflow or message expiration and loss.

[0030] Poor user experience: The response delay perceived by users directly affects the interactive experience, making it impossible to achieve the optimization strategy of "fast response and background processing".

[0031] Resource waste: During the synchronization wait period, system resources are idle and cannot process other requests, resulting in low resource utilization.

[0032] Technical reasons: The synchronous write architecture executes event consumption, memory retrieval, LLM calls, and storage writing in a chain. Each step must wait for the previous step to complete, and any delay in any step will affect the entire process.

[0033] Defect 2: Model dependency leads to system fragility and difficulty in expansion.

[0034] Existing technologies heavily rely on Large Language Models (LLMs) for memory retrieval and processing, leading to system fragility and scalability issues, for example:

[0035] Model service dependency: Core functions such as memory retrieval, classification, and scoring all depend on the LLM service. When the LLM service is unavailable or slow to respond, the entire memory processing flow is interrupted.

[0036] Limited processing capacity: The LLM service has limited processing capacity and cannot quickly handle a large number of concurrent requests, becoming a bottleneck in system performance.

[0037] High cost: Each processing requires calling the LLM, generating a large number of API call costs, especially in high-concurrency scenarios where costs increase significantly.

[0038] Unable to scale independently: Because event consumption and LLM processing are coupled together, it is not possible to scale independently for the characteristics of different processing stages. It is necessary to scale both event consumption and LLM processing capabilities simultaneously.

[0039] Wide-ranging impact: A failure of the LLM service can render the entire memory processing system inoperable, resulting in a wide-ranging impact and low system availability.

[0040] Lack of degradation strategy: When the LLM service is unavailable, the system lacks a rule-based degradation mechanism and cannot provide basic memory processing functions.

[0041] Technical reasons: The existing architecture uses LLM calls as the core of the processing flow, which is tightly coupled with event consumption and storage writing. It lacks decoupling design and cannot achieve independent expansion of processing capacity and fault isolation.

[0042] Defect 3: Lack of auditability leads to compliance risks and difficulties in data traceability.

[0043] Existing technologies lack a complete auditing mechanism, making it impossible to trace the decision-making process for memory processing, resulting in serious compliance and data management issues, such as:

[0044] The decision-making process is not traceable: it is impossible to record and query the decision-making process such as "why this memory was stored" or "why that memory was rejected", and the decision lacks interpretability.

[0045] Lack of original data retention: Processed memory data often overwrites or replaces the original interaction data, making it impossible to trace back to the original interaction content and losing the complete context of the data.

[0046] Audit logs are missing: There are no complete records of each step of memory processing (importance determination, classification, storage, etc.), making it impossible to conduct post-event audits and trace problems.

[0047] High compliance risk: In sectors requiring strict compliance, such as finance and healthcare, a lack of auditing capabilities can lead to an inability to meet regulatory requirements (such as GDPR, CCPA, and other data protection regulations).

[0048] Difficulty in locating the problem: When memory quality problems occur (such as incorrect memories or omissions of important memories), it is impossible to trace the processing process and it is difficult to locate the cause of the problem.

[0049] Data governance is difficult because it is impossible to understand the source, processing, and storage location of the stored data, making it difficult to carry out effective data governance and quality control.

[0050] Technical reasons: Existing technologies focus on memory storage and retrieval functions, neglecting auditing and traceability needs. They lack a complete audit log mechanism and original data retention strategy, resulting in an inability to support compliant auditing and data traceability.

[0051] In view of the defects and shortcomings of the prior art, this application mainly solves the following technical problems:

[0052] 1. How to eliminate the performance bottleneck of synchronous writes: By using an asynchronous processing architecture, the writing of raw data of interactive events is decoupled from memory processing, enabling fast response and background processing, and eliminating system blocking and performance bottlenecks caused by synchronous waiting.

[0053] 2. How to reduce the vulnerability of model-dependent systems: Design a flexible processing mechanism that supports both judgment based on preset rules and judgment based on model output. When the model service is unavailable, rule-based judgment can be used as a fallback, thereby improving the reliability and scalability of the system.

[0054] 3. How to achieve complete audit traceability: Establish a complete audit log mechanism to record the complete decision-making process of memory processing, and store the original interaction events in an immutable form in an independent storage area to support data traceability and compliance auditing.

[0055] In view of the problems existing in the prior art, this application provides an intelligent agent memory management method based on asynchronous processing. This method mainly includes the following processing operations: receiving and storing raw interaction events, asynchronously processing interaction events, classifying and storing structured memory data, and querying and providing memory data. This method adopts an asynchronous processing architecture and a multi-storage area design to realize the importance determination, structure transformation, and classified storage of interaction events, solving problems such as synchronous writing, model dependency, and lack of auditability in the prior art.

[0056] The intelligent agent memory management method of this application mainly includes the following core processes: a. Receiving interaction events between the user and the intelligent agent, and writing the interaction events into a first storage area in the form of raw data; b. Processing the interaction events in the first storage area through an asynchronous processing module, including: c. Performing importance determination on the interaction events; d. Converting interaction events that meet preset conditions into structured memory data; e. Storing the structured memory data into at least two different second storage areas according to the type of structured memory data; f. Upon receiving a query request, reading the memory data related to the query request from the second storage area and providing it to the intelligent agent to generate a response result. The importance determination includes comparing the results with a preset rule or a model output with a threshold. The asynchronous processing module operates in an event queue manner. The structured memory data includes at least one type identifier field. The first storage area is immutable storage.

[0057] The technical solution of this application will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0058] Figure 1 This is a flowchart illustrating the intelligent agent memory management method based on asynchronous processing provided in an embodiment of this application. Figure 1 As shown, the agent memory management method based on asynchronous processing may specifically include:

[0059] S101, receive the interaction event between the user and the intelligent agent, generate the event identifier to identify the interaction event, and append the interaction event to the first storage area in the form of raw data, wherein the first storage area is an immutable storage area;

[0060] S102, after the interactive event is written to the first storage area, the processing event associated with the event identifier is published to the event queue, so that the asynchronous processing module can obtain the processing event based on the event queue and read the corresponding interactive event from the first storage area according to the event identifier;

[0061] S103, The asynchronous processing module performs an importance determination on the interactive event. The importance determination includes determination based on preset rules or determination based on a comparison between the model output score and a threshold.

[0062] S104, when an interactive event passes the importance determination, the interactive event is converted into structured memory data;

[0063] S105, determine the second storage area based on the type identifier field of the structured memory data, and write the structured memory data into at least one second storage area respectively. The system is configured with at least two second storage areas, and different second storage areas are used to store different types of structured memory data.

[0064] S106, upon receiving a query request, the query request is parsed to obtain query conditions, at least one target second storage area is determined based on the query conditions, structured memory data related to the query request is read from the target second storage area and aggregated, and the aggregated memory data is output to the agent for generating response results.

[0065] In some embodiments, receiving interaction events between a user and an intelligent agent, generating an event identifier to identify the interaction event, and appending the interaction event to a first storage area in the form of raw data includes:

[0066] Acquire user input messages and corresponding agent output messages, and construct interaction events based on user input messages and agent output messages. Interaction events include user identifier, session identifier, message identifier, role identifier, message content, timestamp, and metadata fields.

[0067] Event identifiers are generated based on certain fields in the interaction events, and the association between the event identifiers and the interaction events is established.

[0068] The interactive events are encapsulated according to the original data structure and written to the first storage area using an append-only method. The first storage area does not perform any on-site modification or deletion operations on the written interactive events.

[0069] Specifically, the first storage area is used to store the original data of the interactive events. It adopts append-only and immutable storage semantics, that is, it only allows new event records to be appended to the end of the storage, does not support in-situ modification of written events, and does not support deletion operations, thereby maintaining the integrity and immutability of the original interactive events.

[0070] In practical implementation, the reception and construction of interactive events can be completed by the interactive event receiving module. After receiving a user input message, the interactive event receiving module first parses it to obtain the user identifier, session identifier, and message content, and can obtain session state information from the session context. Subsequently, the agent generates an agent output message corresponding to the user input message. After generating the output message, the interactive event receiving module integrates the user input message and the agent output message into the same interactive event data structure and completes the interactive event field set.

[0071] In some examples, user identifiers are used to distinguish data isolation boundaries between different users; session identifiers are used to identify multiple rounds of interaction within the same session; message identifiers are used to identify the uniqueness of a single message, which can be user input message identifiers and agent output message identifiers, or a unified set of message identifier fields; role identifiers are used to indicate the type of message sender, including at least user roles and agent roles; message content is used to store the text content output by the corresponding role; timestamps are used to record the message generation time or the formation time of the interaction event; metadata fields are used to record the interaction environment and source information. To ensure originality, the interaction event receiving module maintains the original semantics of the fields when constructing the interaction event, and does not perform important filtering, semantic compression, or rewriting of the message content.

[0072] Furthermore, in generating event identifiers, this embodiment adopts the method of "generating event identifiers from partial fields of interactive events and establishing an association between event identifiers and interactive events." Specifically, a combination of fields that can jointly ensure uniqueness can be selected from interactive events, such as user identifiers, session identifiers, message identifiers, timestamps, and preset incremental sequence numbers or random number seeds, to form a composite key to be identified; based on this, a digest operation or standardized encoding process is performed on the composite key to generate a fixed-length event identifier.

[0073] In some examples, to achieve traceable association, the interactive event receiving module writes an event identifier field within the interactive event, or establishes an index information from the event identifier to the storage location of the interactive event in the first storage area. This allows the subsequent asynchronous processing module to locate and read the corresponding interactive event based solely on the event identifier. The selection of the aforementioned "partial fields" is configurable to adapt to the parsing and privacy compliance requirements of different businesses. For example, when it is necessary to reduce the exposure of sensitive information, only the event identifier after the field combination is summarized can be generated instead of directly exposing the plaintext fields.

[0074] Furthermore, regarding the writing of interactive events to the first storage area, this embodiment emphasizes two key implementation points: "encapsulation according to the original data structure" and "append writing." Encapsulation according to the original data structure means serializing and saving interactive events according to the original hierarchical relationship of their field sets, maintaining the complete structure and values ​​of user identifiers, session identifiers, message identifiers, role identifiers, message content, timestamps, and metadata fields, ensuring no fields are lost, content is truncated, or semantics are rearranged during writing. Append writing refers to appending each interactive event as an independent record to the end of the first storage area, forming a continuous log chain according to the order of event occurrence.

[0075] The first storage area can be implemented using a file log system, a time-series database, or a relational database that supports immutable write policies. Regardless of the implementation method, the storage policy ensures that no in-situ modification or deletion operations are performed on written interactive events. When storage capacity and long-term preservation are required, historical events can be archived or compressed in segments, but archived objects still maintain immutable semantics and event identification traceability.

[0076] Through the above embodiments, interactive events form continuous and immutable fact records in the first storage area in the form of raw data. Event identifiers run through the writing, locating, and associating processes of interactive events, enabling subsequent asynchronous processing modules to stably read back the corresponding interactive events and perform importance determination and structure transformation. At the same time, immutable storage and append writing prevent the original interactive data from being overwritten or deleted, which helps to reduce the risk of data loss due to synchronous link blockage or processing failure, and improves the traceability and auditability of the original interactive data and processing links.

[0077] In some embodiments, a processing event associated with an event identifier is published to an event queue, enabling the asynchronous processing module to retrieve the processing event based on the event queue and read the corresponding interaction event from a first storage area according to the event identifier, including:

[0078] After the interactive event is appended to the first storage area, a processing event associated with the event identifier is generated. The processing event includes the event identifier and storage reference information in the first storage area used to indicate the interactive event.

[0079] Processed events are written to an event queue, which is hosted by a message queue middleware and configured to persistently store processed events.

[0080] The asynchronous processing module establishes a subscription or pull relationship with the event queue to retrieve processing events from the event queue and parses the processing events to obtain event identifiers;

[0081] The asynchronous processing module reads the corresponding interactive event from the first storage area based on the event identifier or storage reference information;

[0082] If reading an interactive event fails or processing an event fails, the event will be rewritten to the event queue or retrieved again according to the preset retry strategy.

[0083] Specifically, after appending the interactive event to the first storage area, the interactive event receiving module generates a processing event based on the event identifier. In addition to carrying the event identifier, the processing event also carries storage reference information used to locate the interactive event.

[0084] Taking the first storage area as an example of log-based storage with append-only writing, the storage reference information may include at least one of the following: log segment identifier, segment offset, append sequence number, and write time partition identifier. The log segment identifier is used to indicate the log file or segment object where the interactive event is located, and the segment offset or append sequence number is used to indicate the specific location of the interactive event in the segment.

[0085] Taking the first storage area as an example of time-series partitioned storage, the storage reference information may include a time partition key and a sequence number within the partition. The time partition key is used to locate the time partition, and the sequence number within the partition is used to locate the event record. Through this storage reference information, the asynchronous processing module can choose between two reading methods in subsequent processing stages: "querying the index by event identifier" or "directly locating by storage reference information," to adapt to the reading cost and latency requirements under different storage implementations.

[0086] In some examples, this embodiment uses a message queue middleware to host the event queue for writing processing events to the event queue, and configures the event queue to persistently store the processing events. Persistent storage means that after a processing event is written, it can be saved in the persistent medium of the message queue middleware. Even if an asynchronous processing module restarts, experiences network jitter, or is temporarily unavailable, the processing event can still be retrieved and consumed after recovery.

[0087] Furthermore, the message queue middleware can provide a consumption confirmation mechanism for processing events. After the asynchronous processing module finishes reading the interactive event corresponding to the processing event and enters the subsequent processing flow, it returns a consumption confirmation to the event queue. If the asynchronous processing module exits abnormally or does not return a consumption confirmation during the processing, the message queue middleware can re-deliver the processing event according to the configuration, thereby forming a recoverable consumption semantic.

[0088] In some examples, after establishing a subscription or pull relationship with the event queue, the asynchronous processing module retrieves processing events from the event queue and parses the events to obtain event identifiers. During the parsing process, the asynchronous processing module can simultaneously extract storage reference information to prioritize more efficient read paths. For example, when the storage reference information includes log segment identifiers and offsets, the asynchronous processing module can directly locate the event by segment and read the interactive event from the offset; when the storage reference information only contains event identifiers, the asynchronous processing module can first locate the interactive event based on the event identifier in the index structure or associated index of the first storage area, and then perform the read operation.

[0089] To adapt to concurrent scenarios, the asynchronous processing module can retrieve multiple processing events in batches within a single processing instance and create a list of events to be processed based on their identifiers. Alternatively, multiple asynchronous processing module instances can be deployed to consume the processing events in the event queue in parallel, thereby improving overall throughput.

[0090] Furthermore, in the event of failure to read an interactive event or failure to process an event, this embodiment reprocesses the event according to a preset retry strategy. The preset retry strategy may include at least one of the following: a maximum number of retries, a retry interval, and a retry backoff rule. For example, if the asynchronous processing module encounters a temporary read / write exception when reading the first storage area, it can retrieve the same event again or rewrite the event into the event queue, and consume it again after a period of time. If multiple retries still fail, the event can be marked as an abnormal event and written into an exception queue or error queue for subsequent manual investigation or offline compensation processing.

[0091] To reduce the risk of duplicate processing caused by duplicate delivery, the asynchronous processing module can also establish idempotent control information based on event identifiers. For example, the processing status corresponding to the event identifier can be recorded in local or independent state storage. When the same event identifier is detected to have entered the processing completion state, the re-execution of the duplicate processing event is skipped, thereby reducing duplicate reading and duplicate processing.

[0092] The above process will be further explained below with a specific example. Assume the interactive event receiving module has appended an interactive event to the first storage area and generated an event identifier E202601090001; the first storage area uses date-segmented log storage, and the interactive event is written to offset 4096 in log segment D20260109. Then, the processing event generated by the interactive event receiving module can include the event identifier E202601090001 and storage reference information {log segment identifier is D20260109, offset within the segment is 4096}. After writing the processing event to the event queue, the interactive event receiving module immediately terminates the front-end link without waiting for asynchronous processing to complete.

[0093] The asynchronous processing module then retrieves the processing event from the event queue using a pull method, parses it to obtain the event identifier and storage reference information, and prioritizes reading the interaction event from the first storage area based on the storage reference information. If the read fails due to a brief unavailability of the first storage area, the asynchronous processing module will retrieve the processing event again according to a preset retry policy, or rewrite the processing event into the event queue to await subsequent retries. After a successful read, the asynchronous processing module then enters the importance determination and structure transformation process, and returns a consumption confirmation to the event queue at an appropriate stage. If an abnormal exit occurs during processing and consumption confirmation is not completed, the message queue middleware can re-deliver the processing event, which the asynchronous processing module can retrieve and continue processing after recovery.

[0094] In this embodiment, the processing event serves as the asynchronous trigger carrier after the interactive event is written to the first storage area. Combined with the persistence and retry mechanism of the event queue, the asynchronous processing module can stably obtain the task to be processed without occupying the critical path of the interaction. Based on the event identifier or storage reference information, it can read back the original interactive event from the first storage area, thereby reducing the risk of synchronous waiting and blocking in the interaction link, improving the recoverability and reliability of the processing link in fault and jitter scenarios, and providing basic support for the expansion deployment and traceability association of the subsequent processing stage.

[0095] In some embodiments, the asynchronous processing module performs an importance determination on the interaction event. The importance determination includes determination based on preset rules or determination based on a comparison of the model output score with a threshold, including:

[0096] The system obtains the message content and metadata fields of the interaction event, calls the rule engine to perform preset rule matching on the interaction event, and includes filtering rules for identifying preset low-information content and outputting filtering tags, and retention rules for identifying content containing preset key information and outputting retention tags. The system generates rule determination results based on the filtering tags and retention tags.

[0097] When performing a judgment based on comparing the model output score with a threshold, at least some fields in the interaction event are input into the model service to obtain model output scores for multiple scoring dimensions, and a comprehensive importance score is calculated based on the model output scores and corresponding weights for multiple scoring dimensions.

[0098] The overall importance score is compared with a preset threshold to generate the model's judgment result;

[0099] Whether an interaction event passes the importance determination is determined based on the rule-based or model-based determination results.

[0100] Specifically, preset rules are a set of configurable rules managed by the rule engine, including at least two categories: filtering rules and retention rules. Filtering rules are used to identify preset low-information content and output filtering tags, such as matching text patterns like greetings, thank-you messages, farewell messages, and system confirmation messages, or filtering out messages that are too short and lack entity elements. Retention rules are used to identify content containing preset key information and output retention tags, such as identifying message content or metadata fields containing high-signal characteristics like numbers, dates, preference expressions, entity names, location descriptions, and planned items.

[0101] In its implementation, after reading an interaction event, the asynchronous processing module first obtains the message content and metadata fields of the interaction event, and then calls the rule engine to perform preset rule matching on the interaction event. The rule engine can match the message content and metadata fields separately according to the rule type. For example, on the filtering rule side, the rule engine can perform text pattern matching and length threshold matching on the message content: when the message content meets the matching conditions of the preset greeting dictionary or confirmation dictionary, a filtering flag is output; when the message content length is less than the preset length threshold and does not contain identifiable entity elements, a filtering flag is output.

[0102] On the retention rule side, the rule engine can perform key element matching on message content: when the message content contains numeric sequences, date formats, preferred keywords, or entity name characteristics, a retention flag is output. Simultaneously, the rule engine can also perform retention rule matching based on metadata fields; for example, when metadata fields representing specific business scenario identifiers, task category identifiers, or source channel identifiers meet preset conditions, a retention flag is output. Finally, the asynchronous processing module generates rule determination results based on the filtering flags and retention flags. To avoid overly rigid rule logic, the rule engine in this embodiment supports configurability and dynamic updates. The rule set can be enabled, disabled, or version switched according to business scenarios, enabling rule determination to adapt to the differentiated definitions of "memory value" in different domains.

[0103] Furthermore, when performing a judgment based on comparing the model output score with a threshold, the asynchronous processing module inputs at least some fields from the interaction event into the model service to obtain model output scores across multiple scoring dimensions. "At least some fields" may include at least one of the following: message content, role identifier, session identifier, metadata fields, and rule matching results, thus providing sufficient contextual information for the model service. After the model service outputs its results, the asynchronous processing module calculates a comprehensive importance score based on the model output scores across multiple scoring dimensions and their corresponding weights. Weights can be pre-configured according to business strategies; for example, increasing the stability score weight in preference memory scenarios, increasing the sensitivity score weight in compliance-sensitive scenarios, and increasing the target alignment score weight in task collaboration scenarios. To maintain computational consistency, the asynchronous processing module can set a unified normalization range for each scoring dimension and normalize the model output scores before fusion.

[0104] Furthermore, after obtaining the overall importance score, the asynchronous processing module compares the overall importance score with a preset threshold to generate a model judgment result. The preset threshold can employ a fixed threshold strategy, such as configuring a default threshold in general scenarios; or a dynamic threshold strategy, such as adjusting the threshold based on recent interaction event pass rates, queue backlog levels, or business time period strategies to control the proportion of events entering the structured transformation stage. The asynchronous processing module can also associate and record threshold version information with the comparison results for subsequent auditing and strategy backtracking.

[0105] In this embodiment, the asynchronous processing module can determine whether an interaction event passes the importance determination based on the rule determination result or the model determination result, and supports the combined use of the two determination methods, specifically including:

[0106] The first combination method is rule pre-screening followed by model fine-tuning: the asynchronous processing module first executes the rule engine for matching. When the rule judgment result indicates that the interaction event belongs to the category of clear low-information content, it is directly judged as failing, thus skipping the model service call; when the rule judgment result indicates that the interaction event may contain key information, the model service is then called to calculate the comprehensive importance score and compare it with the threshold to form the final judgment.

[0107] The second approach involves rule degradation when the model fails: When the model service is unavailable, the response times out, or costs are limited, the asynchronous processing module outputs an importance judgment result based solely on the rule judgment outcome, thus maintaining the system's basic processing capabilities. The asynchronous processing module can record the judgment method identifier used in this instance within the context of the processing event, enabling subsequent traceability analysis of the importance judgment behavior.

[0108] The importance determination process is further explained below with an example. Assume the asynchronous processing module reads an interaction event from the first storage area. The message content is "Thanks," and the metadata field shows a typical casual chat scenario. The rule engine matches the message content to a preset thank-you dictionary, outputs a filter flag but no retain flag, so the rule determination result is "failed." The asynchronous processing module directly determines that the interaction event failed the importance determination and ends the processing, without calling the model service again.

[0109] For example, another interaction event might contain the message "I prefer Chinese replies and a reminder for a meeting every Monday at 10 AM." The rule engine matches this, finding it includes both preference and time information, and outputs a "retain" flag without a "filter" flag. Therefore, the rule judgment result is "possibly passable." The asynchronous processing module further inputs the message content, session identifier, and metadata fields into the model service. The model service outputs model output scores across multiple scoring dimensions. The asynchronous processing module then merges these scores according to preset weights to obtain a comprehensive importance score of 0.62. When the preset threshold is 0.30, the comparison result is "pass," and the generated model judgment result is "passable." Ultimately, the interaction event passes the importance judgment and enters the subsequent structured transformation process. If the model service times out in this example, the asynchronous processing module uses a fallback strategy to directly adopt the rule judgment result as the final judgment, allowing the interaction event to either still enter structured transformation or be filtered out.

[0110] In this embodiment, the asynchronous processing module performs importance determination on interactive events in the background processing chain driven by the event queue. It uses the filtering and retention rules of the rule engine to quickly screen out low-value interactive events. When needed, it forms a refined determination by comparing multi-dimensional scores and thresholds of the model service. At the same time, when the model service is unavailable, it can degrade to rule determination to maintain processing continuity, thereby reducing the number of model calls and processing overhead, improving the configurability and stability of importance determination, and providing a clear filtering entry point for subsequent structured transformation and classified storage.

[0111] In some embodiments, when an interaction event passes an importance determination, the interaction event is converted into structured memory data, including:

[0112] Based on the message content, metadata fields, and session identifiers of interactive events, key information extraction and redundant information removal are performed on the interactive events to generate memory content.

[0113] Generate memory identifiers to identify structured memory data, and determine the memory time information of structured memory data based on the timestamps of interactive events;

[0114] Based on the message content of the interaction event, metadata fields, and the determination result of importance judgment, the type identifier field of the structured memory data is determined by a classification model or preset rules. The type identifier field is used to characterize the memory type to which the structured memory data belongs, and multiple type identifiers are allowed to be determined for the same structured memory data.

[0115] Construct structured memory data, which includes memory identifier, event identifier, user identifier, memory content, type identifier fields, importance score, and metadata fields associated with interaction events.

[0116] Specifically, after reading back the interaction event, the asynchronous processing module first performs key information extraction and redundant information removal based on the message content, metadata fields, and session identifier of the interaction event. The session identifier is used in this process to provide the context boundary within the session, enabling the extraction process to distinguish between "temporary session information" and "reusable information."

[0117] For example, when a user expresses multiple constraints or preferences in the same session, the asynchronous processing module can aggregate these contents into unified memory content; when the metadata field contains business scenario identifiers or input channel identifiers, the asynchronous processing module can select different extraction strategies accordingly, such as focusing more on amount, term and risk preference in financial consulting scenarios, and focusing more on time range and reminder rules in calendar assistant scenarios.

[0118] Key information extraction can be achieved through a combination of rule-based extraction and model-based extraction: on the rule-based extraction side, key fragments are extracted based on a pre-defined entity dictionary, time expression patterns, and preference expression patterns; on the model-based extraction side, the message content is summarized and refined using a model to output more concise core information text. Redundant information removal can include removing repeated sentences, deleting greetings, merging synonyms, and removing invalid symbols, making the memorized content suitable for subsequent storage and retrieval.

[0119] Furthermore, in generating memory identifiers and memory time information, this embodiment adopts the method of "generating an independent memory identifier for each piece of structured memory data and using the interaction event timestamp as the time anchor." Specifically, after the asynchronous processing module completes the generation of memory content, it generates a memory identifier for the structured memory data. The memory identifier can be generated randomly, sequentially, or derived from event identifiers.

[0120] To maintain consistency across the audit chain, the asynchronous processing module retains event identifiers, creating a key link between memory identifiers and event identifiers that connects memory data to the original interaction event. Memory time information is determined based on the timestamp of the interaction event and is used for subsequent time-range retrieval in the time-series storage area or for sorting and fusion during query aggregation. If the system needs to support historical state tracing, the asynchronous processing module can also record both valid time information and transaction time information in the structured memory data. Valid time information corresponds to the time the interaction event occurred, while transaction time information corresponds to the time the structured memory data was generated or written, thus meeting the requirements for dual-time-series queries.

[0121] Furthermore, in determining the type identifier field, this embodiment combines the message content of the interaction event, the metadata field, and the importance determination result to determine the type identifier field of the structured memory data using a classification model or preset rules. The importance determination result is used here to provide auxiliary features. For example, when the model determination result includes the output scores of each rating dimension, it can serve as a reference clue for type discrimination; when the rule determination result indicates that a certain type of message is a preference expression or process instruction, the corresponding type identifier can be directly triggered.

[0122] The determination of type identifier fields can be carried out through two paths: the first is rule-based type labeling, which labels memories containing expressions such as "preference", "favorite", "default", and "please in the future" as semantic memories according to preset rules, labels event descriptions such as "I did something" and "something happened today" as plot memories, labels method descriptions such as "steps", "process", and "how to do" as procedural memories, and labels emotional descriptions such as "happy" and "anxious" as emotional memories; the second is model-based type labeling, in which the asynchronous processing module inputs the message content and metadata fields into the classification model, and the classification model outputs one or more type labels and can provide a confidence score for each type label.

[0123] To support the coexistence of multiple types, this embodiment allows the same structured memory data to carry multiple type identifiers at the same time. For example, a memory about "reminding a meeting at 10 a.m. every Monday" can be labeled as semantic memory for semantic retrieval or as procedural memory for rule execution or process reasoning, so that it can be written into multiple second storage areas in the subsequent classification and storage stage.

[0124] Furthermore, after completing the memory content, memory identifier, memory time information, and type identifier fields, the asynchronous processing module constructs structured memory data and performs field encapsulation. Specifically, the structured memory data includes at least: memory identifier, event identifier, user identifier, memory content, type identifier fields, importance score, and metadata fields associated with the interaction event.

[0125] Among them, the user identifier is used for multi-user isolation and retrieval constraints; the importance score can be directly taken from the comprehensive importance score formed in the importance determination stage or the quantitative mapping value of the rule determination; the metadata field retains source information and context information, so that the structured memory data can still maintain its association with the original session scenario after being written across storage areas. To further support audit traceability, the asynchronous processing module can also attach the extraction strategy identifier, type labeling strategy identifier, and threshold version information used in this structure transformation to the metadata field, so that the processing basis for "why this memory content was generated" and "why it was labeled as this type" can be explained later.

[0126] The structured transformation process will be further explained below with an example. Assume the message content of the interaction event is "I prefer Chinese replies, and I need a reminder for a meeting every Monday at 10 AM," the session identifier is S20260109, the timestamp is 2026-01-09T10:15:30, and the overall importance score output during the importance determination phase is 0.62, indicating a successful determination. The asynchronous processing module first extracts key information from the message content, refining "prefers Chinese replies" and "reminds me for a meeting every Monday at 10 AM" into concise, memorable content, and eliminating any possible duplicate statements.

[0127] Subsequently, a memory identifier Mem202601090001 was generated, and the memory time information was determined to be 2026-01-09T10:15:30 based on the interaction event timestamp. Then, based on a comprehensive judgment using preset rules and a classification model, the memory simultaneously meets the two characteristics of "preference expression" and "reminder rule". Therefore, the type identifier field was labeled with two type identifiers: semantic memory and procedural memory.

[0128] Finally, the asynchronous processing module constructs structured memory data, populates memory identifier, event identifier, user identifier, memory content, type identifier fields, importance score, and metadata fields, and uses this structured memory data as input for the subsequent classification and storage stage, so that it can be routed and written to the corresponding second storage area according to the type identifier field and support subsequent query aggregation.

[0129] Through the above embodiment, after the importance determination is passed, the asynchronous processing module extracts and structures key information of the interactive event, forming structured memory data containing identifier association, time anchoring, type labeling and importance quantification information. This enables the memory data to be written to multiple types of second storage areas by type and efficiently retrieved and aggregated by conditions during querying, while maintaining the traceable association between memory identifiers and event identifiers, providing basic data support for subsequent auditing and governance.

[0130] In some embodiments, determining a second storage area based on a type identifier field of the structured memory data, and writing the structured memory data into at least one second storage area, includes:

[0131] Read the type identifier field from the structured memory data and determine at least one second storage area based on the pre-configured mapping relationship between the type identifier field and the second storage area;

[0132] When the type identifier field contains multiple type identifiers, the corresponding multiple second storage areas are determined according to each type identifier;

[0133] For each second storage area, a write task associated with the structured memory data is generated, and a write operation corresponding to each second storage area is executed to write the structured memory data into the corresponding second storage area.

[0134] When multiple second storage areas exist, multiple write tasks are performed in parallel, wherein the write operations of each second storage area are independent of each other;

[0135] When a write operation fails in any of the second storage areas, the write status information corresponding to the write failure is recorded, and a preset retry strategy is executed for the second storage area where the write operation failed.

[0136] Specifically, the second storage area is a set of storage areas used to store structured memory data. The system is configured with at least two second storage areas, and different second storage areas correspond to different storage mechanisms and retrieval methods. The mapping relationship between the type identifier field and the second storage areas is a pre-configured set of routing rules used to establish the correspondence between "type identifier and target storage area" to guide the classification storage module in determining the target write location.

[0137] A write task is an executable write unit generated for a specific secondary storage area. It includes at least the target secondary storage area identifier, memory identifier, event identifier, and memory content and index metadata used for writing. Write status information is used to record information such as write execution result, failure reason, number of retries, and the last write time to support failure retries and subsequent management.

[0138] In its implementation, the classification storage module first reads the type identifier field from the structured memory data and determines at least one second storage area based on the pre-configured mapping relationship between the type identifier field and the second storage area. This mapping relationship can be implemented using a configuration table or a set of rules, and it includes at least the following typical mappings: when the type identifier is semantic memory, it routes to the semantic memory storage area; when the type identifier is episodic memory, it routes to the temporal storage area; when the type identifier is procedural memory, it routes to the relational storage area or the knowledge graph storage area; and when the type identifier is emotional memory, it routes to the structured storage area or the configuration file storage area. To ensure consistency, the classification storage module can configure a default target storage area and alternative target storage areas for each type identifier in the mapping relationship, and configure a version identifier for the mapping relationship, making routing strategy changes auditable and traceable.

[0139] In some examples, when the type identifier field contains multiple type identifiers, the classification storage module determines multiple corresponding second storage areas based on each type identifier, thereby allowing the same structured memory data to be written to multiple second storage areas. This multiplexing write mechanism is used to meet the reuse requirements of the same memory under different retrieval paradigms. For example, a memory such as "remind me of a meeting every Monday at 10 AM" has both semantic memory and procedural memory attributes. It can be routed to the semantic memory storage area to support semantic retrieval, or to the structured storage area or relational storage area to support retrieval and retrieval based on time rules or relational queries. When multiple type identifiers cause multiple second storage areas to repeatedly point to the same storage area, the classification storage module can perform deduplication and merging, retaining only one write task for that storage area to avoid duplicate writes.

[0140] After determining the target second storage area, the classification storage module generates write tasks associated with the structured memory data for each second storage area and executes the write operations corresponding to each second storage area to write the structured memory data into the corresponding second storage area. When generating write tasks, the classification storage module can perform storage adaptation and encapsulation of the structured memory data according to the storage characteristics of the target second storage area.

[0141] For example, for the semantic memory storage area, the classification storage module can convert the memory content into a vector representation and carry importance scores, type identifier fields, and user identifiers as index metadata; for the time-series storage area, the classification storage module can use the memory time information as the time index key and retain the event identifier to support traceability; for the structured storage area, the classification storage module can write structured fields such as user identifiers, preferences, and constraints into the corresponding records and retain the memory identifier as the primary index; for the relational storage area, the classification storage module can write the entities and relations extracted from the message content into node and edge update operations and use the event identifier or memory identifier as the external reference key.

[0142] It should be noted that the above adaptation and encapsulation does not change the core field set of structured memory data, but rather maps it to write payloads and index metadata acceptable to different storage regions, so as to adapt to the retrieval mechanisms of each storage region.

[0143] Furthermore, when multiple secondary storage areas exist, the categorized storage module performs parallel writes on multiple write tasks, where the write operations of each secondary storage area are independent of each other. Parallel writes can be triggered using multi-threading, multi-processing, or asynchronous calls, allowing each write task to execute concurrently in time, thereby reducing the total write latency caused by multi-way writes.

[0144] Write operations are independent, meaning that a write failure in any second storage area does not block the completion of writes in other second storage areas. The categorized storage modules maintain the write status information of each write task and associate the write results with memory identifiers and event identifiers for subsequent query aggregation and audit traceability.

[0145] To avoid inconsistencies caused by duplicate or out-of-order writes introduced by parallel writing, the classified storage module can establish idempotent write control based on memory identifiers: when it is detected that a write completion record already exists for the same memory identifier for the same second storage area, the repeated execution is skipped or the write task is marked as completed, thereby suppressing the risk of duplicate writing during the retry process.

[0146] In some examples, when a write operation to any second storage region fails, the categorized storage module records the write status information corresponding to the write failure and executes a preset retry strategy for the failed second storage region. The write status information includes at least the identifier of the failed target second storage region, a summary of the failure reason, the current number of retries, and the time of the next retry.

[0147] Preset retry strategies can include a maximum number of retry attempts, a retry interval, and backoff rules. For example, exponential backoff can be used to avoid frequent retries caused by short-term failures. If the maximum number of retry attempts is reached and the failure still occurs, the write task can be transferred to an abnormal write queue and an alarm message can be recorded for subsequent manual intervention or offline compensation. It is important to emphasize that even if writes to a certain second storage area continue to fail, structured memory data can still be successfully written to other second storage areas, thereby achieving fault isolation across storage areas. At the same time, the first storage area retains the original interaction events, which facilitates the regeneration of structured memory data based on event identifiers and its rewriting to the failed second storage area after write recovery.

[0148] The following example further illustrates the categorized storage process. Assume the asynchronous processing module generates a piece of structured memory data with the memory identifier Mem202601090001, the event identifier E202601090001, the user identifier 10086, and the memory content "Prefers Chinese replies; Reminds me of meetings every Monday at 10 AM". The type identifier field contains two type identifiers: semantic memory and procedural memory, with an importance score of 0.62. After reading the type identifier field, the categorized storage module determines, based on the mapping relationship, which of the two secondary storage areas—the semantic memory storage area and the structured storage area—needs to be written.

[0149] Two write tasks are then generated: the first write task targets the semantic memory storage area, generating a vector representation of the memory content and carrying user identifier, importance score, and type identifier fields as index metadata; the second write task targets the structured storage area, mapping "prefer Chinese reply" and "reminder rule" as structured field records and retaining memory identifier and event identifier as reference keys.

[0150] The classification storage module triggers two write tasks in parallel: if the semantic memory storage area is successfully written but the structured storage area fails to write due to a short-term connection exception, the classification storage module records the status information of the failed write and retryes the writing of the structured storage area according to the preset retry strategy; during the retry, the data already written in the semantic memory storage area can be used for semantic queries, and the record of the memory on the structured storage side is replenished after the writing of the structured storage area is restored.

[0151] In this embodiment, the classification storage module routes structured memory data to at least one second storage area based on the type identifier field, and generates multiple write tasks to write in parallel under multiple type identifier scenarios, realizing the classification and carrying of different types of memory data under different storage mechanisms. At the same time, through write status recording and preset retry strategy, write failures are handled in a recoverable manner, and single area failures are isolated from writes in other areas, thereby improving the stability and scalability of the classification storage link, and supporting the selection of storage areas according to query type and parallel retrieval and aggregation in the subsequent query stage.

[0152] In some embodiments, upon receiving a query request, parsing the query request to obtain query conditions, and determining at least one target second storage region based on the query conditions, includes:

[0153] Obtain the user identifier, query content, and query intent information carried in the query request, and perform semantic parsing on the query content to extract at least one query element. The query element includes at least one of key entities, time range, and memory type indication, thereby generating query conditions.

[0154] The query type is determined based on the query conditions. The query type includes one or more of the following: semantic retrieval type, time-series retrieval type, structured retrieval type, and relational retrieval type.

[0155] Read the pre-configured storage area selection rules. The storage area selection rules are used to establish the correspondence between the query type and the second storage area, and to establish the correspondence between the memory type indicator and the second storage area.

[0156] Based on the query type and memory type indication, at least one target second storage region is determined from the second storage region, wherein multiple target second storage regions are determined when the query conditions simultaneously satisfy multiple query types or contain multiple memory type indications.

[0157] Specifically, the query service module first obtains the user identifier, query content, and query intent information carried in the query request, and performs semantic parsing on the query content to extract at least one query element, thereby generating query conditions. Semantic parsing can be implemented by combining rule parsing and model parsing. The rule parsing side can identify time expression patterns, entity name patterns, and type prompts, such as identifying time range expressions like "last week," "yesterday," and "January 2026," and type prompts like "preference," "reminder," "process," and "experience." The model parsing side can semantically normalize the query content, mapping free expressions to a structured set of elements, and output key entities, time ranges, and memory type indicators.

[0158] To maintain consistency with the aforementioned structured memory data, the memory type indicator can be normalized to a set of types consistent with the type identifier field, avoiding the lack of a reference basis due to inconsistent terminology in subsequent routing. When generating query conditions, the query service module adds the user identifier as a strong constraint to the query conditions, and combines the extracted key entities, time range, and memory type indicator as optional or mandatory constraints, so that the query conditions can cover multiple expressions while keeping the retrieval scope controllable.

[0159] Furthermore, in determining the query type, the query service module judges the retrieval paradigm based on the query conditions. For example, when the query conditions mainly contain semantic similarity-oriented query content and do not provide explicit structured field constraints, it is judged as a semantic retrieval type; when the query conditions contain explicit time range or intent information that traces back by time, it is judged as a time-series retrieval type; when the query conditions contain explicit structured field constraints or structured fields that can be mapped to user attributes, preferences, configuration items, etc., it is judged as a structured retrieval type; when the query conditions contain indications of inter-entity associations, relationship tracking, or cross-entity relationship reasoning, it is judged as a relational retrieval type.

[0160] It should be noted that a single query request can satisfy multiple query types at the same time. For example, "query my meeting reminder rules from last month" includes both time range and rule-based structured elements. The query service module can determine that it belongs to both time-series retrieval type and structured retrieval type.

[0161] Furthermore, regarding reading the storage region selection rules, the query service module reads the pre-configured storage region selection rules and uses these rules to establish a correspondence between the query type and the second storage region, while also establishing a correspondence between the memory type indicator and the second storage region. These rules may contain at least two types of mappings.

[0162] The first category is query type mapping. For example, semantic retrieval type corresponds to semantic memory storage area, time-series retrieval type corresponds to time-series storage area, structured retrieval type corresponds to structured storage area, and relational retrieval type corresponds to relational storage area.

[0163] The second category is memory type mapping. For example, when the memory type indicator is semantic memory, the semantic memory storage area is selected first; when the memory type indicator is episodic memory, the temporal storage area is selected first; when the memory type indicator is procedural memory, the relational storage area or the structured storage area is selected first; and when the memory type indicator is emotional memory, the structured storage area is selected first.

[0164] To improve selection stability, storage region selection rules can configure priorities and alternative regions for each mapping, enabling alternative routes when a second storage region is unavailable or performance-limited. To support auditing and traceability, the query service module can also record the version identifier of the storage region selection rule used and the selection result in the query log.

[0165] Furthermore, in determining the target second storage region, the query service module identifies at least one target second storage region from the second storage regions based on the query type and memory type indication. When the query conditions simultaneously satisfy multiple query types or contain multiple memory type indications, the query service module determines multiple target second storage regions so that in subsequent steps, retrieval can be initiated in parallel for multiple target second storage regions and the results can be aggregated.

[0166] When multiple target second storage areas are identified, the query service module can perform region deduplication and region merging: if the target areas obtained by the query type mapping and the memory type mapping overlap, they are merged into the same target area; if there are multiple target areas, they are sorted by priority to form a target area list, so that subsequent aggregation stages can perform fusion sorting and result truncation according to priority.

[0167] The following example further illustrates the process of parsing query requests and determining the target second storage area.

[0168] Example 1: A user's query request is "What language do I prefer to reply?" The query service module parses the query content and obtains the key entity "reply language". The memory type is indicated as semantic memory or structured preference type, and the time range is not specified. Based on this, it is determined that the query type should at least include the structured retrieval type, and may also include the semantic retrieval type as a supplement. According to the storage area selection rules, the structured storage area is determined as the target second storage area, and the semantic memory storage area can also be determined as a candidate target area.

[0169] Example 2: A user's query request is "What meeting did I ask you to remind me of last week?" The query service module parses the query and finds the time range to be "last week," the key entity to be "meeting reminder," and the memory type to be either episodic or procedural memory. Based on this, the query type is determined to include time-series retrieval and may also include structured retrieval. According to the storage area selection rules, the time-series storage area is determined as the target second storage area, and the structured storage area can be further determined as a supplementary target second storage area to improve recall.

[0170] Example 3: The user's query request is "link me to things related to Project A". The query service module parses the query and finds the key entity to be "Project A". The query intent information indicates the linking of relationships. Based on this, it is determined that the query type includes the relationship retrieval type. According to the rules, the relationship storage area is determined as the target second storage area. At the same time, the semantic memory storage area can be selected to supplement the recall and semantic matching.

[0171] In this embodiment, after receiving a query request, the query service module first performs semantic parsing on the query content to extract key entities, time ranges, and memory type indicators to form query conditions. Then, it determines the query type based on these conditions and, in conjunction with pre-configured storage area selection rules, identifies at least one target second storage area among multiple second storage areas. When the query conditions involve multiple retrieval paradigms or multiple memory types, it can identify multiple target second storage areas, providing a clear routing basis and retrieval scope control for subsequent parallel retrieval and aggregation sorting under different storage mechanisms.

[0172] In some embodiments, structured memory data related to the query request is read from a target second storage area and aggregated, and the aggregated memory data is output to the agent for generating a response result, including:

[0173] For multiple target second storage areas, retrieval instructions matching the query type are generated respectively, and query operations on multiple target second storage areas are triggered in parallel based on the retrieval instructions to obtain a candidate memory set;

[0174] Specifically, when the target second storage area is a semantic memory storage area, a query vector is generated based on the query content, and vector similarity retrieval is performed to obtain semantic candidate memory;

[0175] When the target second storage area is a time-series storage area, a time-range retrieval is performed based on the time range to obtain time-series candidate memories;

[0176] When the target second storage area is a structured storage area, perform structured condition retrieval based on the query elements to obtain structured candidate memories;

[0177] When the target second storage area is a relation storage area, perform relation traversal retrieval based on the query elements to obtain relation candidate memories;

[0178] The candidate memory set is normalized and deduplicated, and then merged and sorted based on relevance score, importance score and memory time information to obtain the sorted memory set.

[0179] Select a target memory subset that meets the preset quantity constraint from the sorted memory set, and encapsulate the target memory subset into memory context data;

[0180] The memory context data is output to the agent so that the agent can combine the query request to generate a response result.

[0181] Specifically, the query service module first generates retrieval instructions matching the query type for multiple target secondary storage areas, and then triggers query operations on multiple target secondary storage areas in parallel based on the retrieval instructions to obtain candidate memory sets. Parallel triggering can be achieved through multi-threading, asynchronous calls, or task concurrent scheduling, enabling retrieval requests from semantic memory storage areas, temporal storage areas, structured storage areas, and relational storage areas to be executed concurrently in time.

[0182] To maintain multi-user isolation and audit consistency, each search command carries a user identifier and may also carry a memory type indicator for performing user-level and type-level filtering within each target secondary storage area. Simultaneously, the query service module can configure a unified timeout threshold and degradation strategy for parallel searches. For example, if a target secondary storage area does not return results within the timeout period, only the returned results are used to enter the aggregation process, and the query failure status of that storage area is recorded for subsequent optimization and alerting.

[0183] Furthermore, when the target second storage area is a semantic memory storage area, the query service module generates a query vector based on the query content and performs vector similarity retrieval to obtain semantic candidate memories. Generating the query vector can be achieved by the query service module calling a vectorization component, whose input is the query content and necessary query elements, and whose output is a vector representation used for semantic similarity calculation. Vector similarity retrieval can be performed on the vector index of the semantic memory storage area, returning candidate memory records with high similarity and carrying a relevance score corresponding to the similarity. To ensure the traceability of semantic candidate memories, the returned results must at least include memory identifiers, event identifiers, or reference information that can be used to locate structured memory data, as well as metadata such as importance scores and type identifier fields.

[0184] Furthermore, when the target second storage area is a time-series storage area, the query service module performs a time-range retrieval based on the time range to obtain time-series candidate memories. The time range is parsed from the query conditions, and the query service module encodes the time range into the retrieval instruction to perform time-indexed range filtering in the time-series storage area. When the time-series candidate memories are returned, they can carry memory time information, memory identifier, and event identifier, and can be output first according to time proximity or time sorting. To meet the needs of tracing scenarios, this embodiment allows the time-series storage area to retain valid time information and transaction time information. The query service module can choose to use valid time information or transaction time information as the filtering and sorting basis according to the query intent.

[0185] Furthermore, when the target second storage area is a structured storage area, the query service module performs structured conditional retrieval based on the query elements to obtain structured candidate memories. Structured conditional retrieval maps query elements to structured field constraints, such as mapping key entities to preference names, configuration key values, or alert rule fields, mapping memory type indicators to type field filtering, and mapping user identifiers to user partition keys. When structured candidate memories are returned, they typically include fielded results, such as preference values, rule expressions, and the most recent update time, and retain the memory identifier to align with results returned from other storage areas.

[0186] Furthermore, when the target second storage area is a relation storage area, the query service module performs relation traversal retrieval based on the query elements to obtain relation candidate memories. Relationship traversal retrieval is performed on entities and relation structures, for example, starting with a key entity as the starting node, traversing according to preset relation types, hop counts, or path constraints, and returning entity nodes, relation edges, and corresponding memory references related to the query intent. After the relation candidate memories are returned, the query service module can convert them into a readable summary of the structured memory data, for example, mapping the "entity-relationship-entity" path to an understandable set of related facts or events, and retaining memory identifiers or event identifiers for tracing original interaction events or structured memory data.

[0187] Furthermore, after obtaining candidate memory sets from different target second storage regions, the query service module performs result normalization and deduplication processing on the candidate memory sets. In the result normalization process, the query service module maps the fields returned by different storage regions to a common set of fields for structured memory data, including at least memory identifier, event identifier, user identifier, memory content, type identifier, importance score, and memory time information, and supplements or unifies a relevance score for each candidate memory.

[0188] For time-series candidate memories, if no semantic relevance score is provided, a relevance score can be generated based on the degree of matching of query elements or time proximity; for structured candidate memories, a relevance score can be generated based on the degree of field hit; for relational candidate memories, a relevance score can be generated based on path length, relation type weight, or entity matching degree.

[0189] The deduplication process uses memory identifiers or event identifiers as the primary deduplication key: when the same memory identifier appears in multiple candidate sets, the query service module merges it into a single candidate memory and retains its source storage area list and multi-source scoring information for subsequent weighted calculations in the fusion sorting.

[0190] Furthermore, regarding the fusion and ranking, the query service module fuses and ranks the candidate memory sets based on relevance scores, importance scores, and memory time information to obtain a ranked memory set. The fusion strategy can be weighted fusion or rule-based fusion. In the weighted fusion method, the query service module combines the relevance scores and importance scores according to preset weights, and incorporates memory time information into the ranking score calculation using a time decay factor or a time priority strategy, thus prioritizing memories that are both relevant and important and whose time is closer to the query requirements.

[0191] In the rule fusion approach, the query service module can first set the main sorting field according to the query type. For example, for semantic retrieval, it can prioritize sorting by relevance score; for time-series backtracking, it can prioritize sorting by memory time information; and then, in the case of a tie, it can sort by importance score. To maintain audit consistency with the aforementioned importance determination and structured transformation steps, the query service module can record the fusion strategy identifier and weight version identifier used in this sorting.

[0192] Furthermore, after obtaining the sorted memory set, the query service module selects a target memory subset from the sorted memory set that meets a preset quantity constraint, and encapsulates the target memory subset into memory context data. The preset quantity constraint can be a fixed number of entries or a context size constraint. For example, in an agent dialogue scenario, the return of the first few memories can be limited; in a long text generation scenario, the total length of the memory content can be limited simultaneously. When encapsulating the memory context data, the query service module can retain the memory content, key field summary, type identifier field, and importance score of each memory, and can attach event identifiers when needed so that the agent can refer to them when generating a response.

[0193] Finally, the query service module outputs the memory context data to the agent, which then combines the query request to generate a response. It can also synchronously record access logs, including the query request, the target second storage area set, the returned target memory subset identifier set, and access time information, for subsequent query optimization and memory management.

[0194] The retrieval and aggregation process of this embodiment will be further explained below with examples. Assume a user initiates a query request "What language do I prefer to reply in?" In the previous embodiment, the query service module determined that the target second storage area includes a structured storage area and a semantic memory storage area. The query service module generates two types of retrieval instructions in parallel: a structured conditional retrieval instruction for the structured storage area with "preference item = reply language" as the condition; and a vector similarity retrieval instruction for the semantic memory storage area with the query content vector as the core.

[0195] The structured storage area returns a candidate memory indicating "prefers Chinese replies"; the semantic memory storage area returns several candidate memories, one of which has the highest semantic similarity to "prefers Chinese replies" and carries a high relevance score. The query service module, after normalization, uses the memory identifier to deduplicate and merge these duplicate candidate memories. In the fusion sorting, it prioritizes candidate memories with high relevance and importance scores, selecting them as the target memory subset and encapsulating them as memory context data for output to the agent. This allows the agent to directly generate the response "You prefer to reply in Chinese" based on this context.

[0196] Through the above embodiment, the query service module can generate retrieval instructions for multiple target second storage areas and trigger queries in parallel. It performs vector similarity retrieval in the semantic memory storage area, time range retrieval in the temporal storage area, structured condition retrieval in the structured storage area, and relational traversal retrieval in the relational storage area. It also performs normalization and deduplication processing on multi-source candidate memories, and then performs fusion sorting and quantity constraint truncation based on relevance score, importance score and memory time information. Finally, it outputs memory context data to the agent, providing a unified, controllable and traceable memory input for the agent to generate response results.

[0197] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0198] Figure 2 This is a schematic diagram of the structure of the intelligent agent memory management device based on asynchronous processing provided in an embodiment of this application. Figure 2 As shown, the asynchronous processing-based intelligent agent memory management device includes:

[0199] The receiving module 201 is used to receive interaction events between the user and the intelligent agent, generate event identifiers to identify the interaction events, and append the interaction events to the first storage area in the form of raw data, wherein the first storage area is an immutable storage area.

[0200] The publishing module 202 is used to publish the processing event associated with the event identifier to the event queue after the interactive event is written to the first storage area, so that the asynchronous processing module can obtain the processing event based on the event queue and read the corresponding interactive event from the first storage area according to the event identifier.

[0201] The determination module 203 is used to perform importance determination on the interactive event by the asynchronous processing module. The importance determination includes determination based on preset rules or determination based on the comparison between the model output score and the threshold.

[0202] The conversion module 204 is used to convert interactive events into structured memory data when the interactive event passes the importance determination.

[0203] The determination module 205 is used to determine the second storage area based on the type identifier field of the structured memory data, and write the structured memory data into at least one second storage area respectively. The system is configured with at least two second storage areas, and different second storage areas are used to store different types of structured memory data.

[0204] The output module 206 is used to parse the query request to obtain the query conditions when a query request is received, determine at least one target second storage area based on the query conditions, read the structured memory data related to the query request from the target second storage area and perform aggregation processing, and output the aggregated memory data to the agent for generating response results.

[0205] Figure 3 This is a schematic diagram of the electronic device 3 provided in an embodiment of this application. Figure 3 As shown, the electronic device 3 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program 303, it implements the steps in the various method embodiments described above. Alternatively, when the processor 301 executes the computer program 303, it implements the functions of each module / unit in the various device embodiments described above.

[0206] Electronic device 3 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 3 may include, but is not limited to, processor 301 and memory 302. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or different components.

[0207] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0208] The memory 302 can be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 302 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 3. The memory 302 can also include both internal and external storage units of the electronic device 3. The memory 302 is used to store computer programs and other programs and data required by the electronic device.

[0209] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0210] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which may be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0211] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for intelligent agent memory management based on asynchronous processing, characterized in that, include: The system receives interaction events between a user and an intelligent agent, generates an event identifier to identify the interaction events, and appends the interaction events to a first storage area in the form of raw data, wherein the first storage area is an immutable storage area. After the interactive event is written to the first storage area, the processing event associated with the event identifier is published to the event queue, so that the asynchronous processing module can obtain the processing event based on the event queue and read the corresponding interactive event from the first storage area according to the event identifier; The asynchronous processing module performs an importance determination on the interactive event, which includes a determination based on preset rules or a determination based on a comparison between the model output score and a threshold. When the interaction event passes the importance determination, the interaction event is converted into structured memory data; The second storage area is determined based on the type identifier field of the structured memory data, and the structured memory data is written into at least one second storage area respectively. The system is configured with at least two second storage areas, and different second storage areas are used to store different types of structured memory data. Upon receiving a query request, the query request is parsed to obtain query conditions. Based on the query conditions, at least one target second storage area is determined. Structured memory data related to the query request is read from the target second storage area and aggregated. The aggregated memory data is then output to the agent for generating a response result.

2. The method according to claim 1, characterized in that, The process of receiving interaction events between the user and the intelligent agent, generating an event identifier to identify the interaction event, and appending the interaction event to the first storage area in the form of raw data includes: Obtain user input messages and intelligent agent output messages corresponding to the user input messages; construct the interaction event based on the user input messages and the intelligent agent output messages; the interaction event includes user identifier, session identifier, message identifier, role identifier, message content, timestamp, and metadata fields. The event identifier is generated based on some fields in the interaction event, and the association between the event identifier and the interaction event is established. The interactive events are encapsulated according to the original data structure and written to the first storage area using an append-only method. The first storage area does not perform in-situ modification or deletion operations on the written interactive events.

3. The method according to claim 1, characterized in that, The step of publishing the processing event associated with the event identifier to the event queue, enabling the asynchronous processing module to obtain the processing event based on the event queue, and reading the corresponding interaction event from the first storage area according to the event identifier, includes: After the interaction event is appended to the first storage area, a processing event associated with the event identifier is generated. The processing event includes the event identifier and storage reference information indicating the interaction event in the first storage area. The processing event is written to the event queue, wherein the event queue is carried by a message queue middleware and configured to persistently store the processing event; The asynchronous processing module establishes a subscription or pull relationship with the event queue to obtain the processing event from the event queue and parses the processing event to obtain the event identifier; The asynchronous processing module reads the corresponding interactive event from the first storage area based on the event identifier or the storage reference information. If reading the interaction event fails or the processing event fails, the processing event is rewritten into the event queue or the processing event is retrieved again according to a preset retry strategy.

4. The method according to claim 1, characterized in that, The asynchronous processing module performs an importance determination on the interaction event. This importance determination includes either a determination based on preset rules or a determination based on a comparison of the model's output score with a threshold, including: The message content and metadata fields of the interaction event are obtained, and the rule engine is called to perform preset rule matching on the interaction event. The preset rules include filtering rules for identifying preset low-information content and outputting filtering tags, and retention rules for identifying content containing preset key information and outputting retention tags. A rule determination result is generated based on the filtering tags and the retention tags. When performing a judgment based on comparing the model output score with a threshold, at least some fields in the interaction event are input into the model service to obtain model output scores for multiple scoring dimensions, and a comprehensive importance score is calculated based on the model output scores and corresponding weights for the multiple scoring dimensions. The comprehensive importance score is compared with a preset threshold to generate a model judgment result; Based on the rule-based judgment result or the model-based judgment result, determine whether the interaction event passes the importance determination.

5. The method according to claim 1, characterized in that, When the interaction event passes the importance determination, converting the interaction event into structured memory data includes: Based on the message content, metadata fields, and session identifier of the interaction event, key information extraction and redundant information removal are performed on the interaction event to generate memory content; Generate a memory identifier to identify the structured memory data, and determine the memory time information of the structured memory data based on the timestamp of the interaction event; Based on the message content, metadata fields, and importance determination results of the interaction event, a classification model or preset rules are used to determine the type identifier field of the structured memory data. The type identifier field is used to characterize the memory type to which the structured memory data belongs, and multiple type identifiers are allowed to be determined for the same structured memory data. Construct the structured memory data, which includes the memory identifier, event identifier, user identifier, memory content, type identifier field, importance score, and metadata field associated with the interaction event.

6. The method according to claim 1, characterized in that, The step of determining the second storage area based on the type identifier field of the structured memory data, and writing the structured memory data into at least one second storage area, includes: Read the type identifier field from the structured memory data, and determine at least one second storage area based on the pre-configured mapping relationship between the type identifier field and the second storage area; When the type identifier field contains multiple type identifiers, multiple corresponding second storage areas are determined according to each type identifier. For each second storage area, a write task associated with the structured memory data is generated, and a write operation corresponding to each second storage area is executed to write the structured memory data into the corresponding second storage area. When multiple second storage areas exist, multiple write tasks are performed in parallel, wherein the write operations of each second storage area are independent of each other; When a write operation fails in any of the second storage areas, the write status information corresponding to the write failure is recorded, and a preset retry strategy is executed for the second storage area where the write operation failed.

7. The method according to claim 1, characterized in that, Upon receiving a query request, parsing the query request to obtain query conditions, and determining at least one target second storage region based on the query conditions, includes: Obtain the user identifier, query content, and query intent information carried in the query request, and perform semantic parsing on the query content to extract at least one query element, the query element including at least one of key entity, time range, and memory type indicator, thereby generating the query conditions; The query type is determined based on the query conditions, and the query type includes one or more of the following: semantic retrieval type, time-series retrieval type, structured retrieval type, and relational retrieval type. Read the pre-configured storage area selection rules, which are used to establish the correspondence between the query type and the second storage area, and to establish the correspondence between the memory type indication and the second storage area; Based on the query type and the memory type indication, at least one target second storage region is determined from the second storage region, wherein multiple target second storage regions are determined when the query conditions simultaneously satisfy multiple query types or contain multiple memory type indications.

8. The method according to claim 7, characterized in that, The step of reading structured memory data related to the query request from the target second storage area, performing aggregation processing, and outputting the aggregated memory data to the agent for generating a response result includes: For each of the multiple target second storage regions, a retrieval instruction matching the query type is generated, and a query operation on the multiple target second storage regions is triggered in parallel based on the retrieval instruction to obtain a candidate memory set; Specifically, when the target second storage area is a semantic memory storage area, a query vector is generated based on the query content, and vector similarity retrieval is performed to obtain semantic candidate memory; When the target second storage area is a time-series storage area, a time-series retrieval is performed based on the time range to obtain time-series candidate memories; When the target second storage area is a structured storage area, a structured conditional retrieval is performed based on the query elements to obtain structured candidate memories; When the target second storage area is a relation storage area, a relation traversal retrieval is performed based on the query elements to obtain relation candidate memories; The candidate memory set is normalized and deduplicated, and then merged and sorted based on relevance score, importance score and memory time information to obtain the sorted memory set. Select a target memory subset that meets a preset quantity constraint from the sorted memory set, and encapsulate the target memory subset into memory context data; The memory context data is output to the agent so that the agent can generate a response result in conjunction with the query request.

9. A smart agent memory management device based on asynchronous processing, characterized in that, include: The receiving module is used to receive interaction events between the user and the intelligent agent, generate an event identifier to identify the interaction event, and append the interaction event to the first storage area in the form of raw data, wherein the first storage area is an immutable storage area; The publishing module is used to publish the processing event associated with the event identifier to the event queue after the interactive event is written to the first storage area, so that the asynchronous processing module can obtain the processing event based on the event queue and read the corresponding interactive event from the first storage area according to the event identifier. The determination module is used to perform importance determination on the interactive event by the asynchronous processing module. The importance determination includes determination based on preset rules or determination based on a comparison between the model output score and a threshold. A conversion module is used to convert the interaction event into structured memory data when the interaction event passes the importance determination. The determination module is used to determine a second storage area based on the type identifier field of the structured memory data, and write the structured memory data into at least one second storage area respectively. The system is configured with at least two second storage areas, and different second storage areas are used to store different types of structured memory data. The output module is used to, upon receiving a query request, parse the query request to obtain query conditions, determine at least one target second storage area based on the query conditions, read structured memory data related to the query request from the target second storage area and perform aggregation processing, and output the aggregated memory data to the agent for generating response results.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Intelligent agent long-term memory modeling method based on memory network

    CN120688545A

  • Memory processing method and system of generative model, information interaction method and system, medium and equipment

    CN120892511A