Historical memory positioning method and apparatus, electronic device, and storage medium
By extracting the temporal features and user identification of interactive commands from a large language model and matching data from a hierarchical memory database, the problems of low efficiency and insufficient accuracy in historical memory location are solved, and efficient and accurate historical memory retrieval is achieved.
Patent Information
- Application Number
- CN202611158936.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-11-17
AI Technical Summary
Existing historical memory localization methods are inefficient and inaccurate in large language models, especially when retrieving information from a long time ago, they consume a lot of resources and lack the ability to accurately parse natural language time expressions.
By extracting time features and user identification from interactive commands, the target memory time period is analyzed, and user feature data and historical summary data are matched from the hierarchical memory database to generate target memory data. The hierarchical memory system is then used for targeted filtering to reduce the involvement of irrelevant historical data.
It improves the efficiency of historical memory retrieval, reduces resource consumption, ensures the accuracy of positioning and response efficiency, and provides refined contextual information.
Smart Images

Figure CN123115374A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data location technology, and in particular to a historical memory location method, device, electronic device, and storage medium. Background Technology
[0002] Existing historical memory localization methods are primarily applied to intelligent interaction systems based on large language models, such as intelligent assistants, intelligent customer service, personal knowledge management systems, and intelligent terminals with long-term companionship capabilities. In these applications, users typically continuously input large amounts of text, voice, or multimodal interaction information into the intelligent system. The system needs to combine the user's past communication content, personal attribute information, and historical behavioral habits to understand the context of the current request and provide a personalized response. Therefore, intelligent systems need the ability to access historical interaction information across time periods, enabling users to quickly retrieve past interaction records using natural language commands such as "What did we talk about the day before yesterday?" or "What did I learn last month?", thus maintaining a continuous interactive experience.
[0003] Existing methods for retrieving historical memory typically retrieve a large amount of original dialogue records from a historical database when a user makes a new interaction request. The retrieval results are then loaded into the context of a large language model, which handles the filtering and correlation analysis of historical information. However, as user activity increases, the scale of historical interaction data continues to grow. When users query information from a long time ago, the amount of data that needs to be loaded increases significantly. This not only consumes a large amount of context space and generates high resource consumption, but also introduces a large amount of historical content irrelevant to the current request, leading to reduced model processing efficiency. Furthermore, existing methods often lack the ability to accurately parse natural language time expressions, making it difficult to quickly map time descriptions such as "the day before yesterday" or "three months ago" to the corresponding historical data range, thus limiting the efficiency and accuracy of historical memory location. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus, electronic device, and storage medium for locating historical memories, in order to solve the problems of low efficiency and accuracy in locating historical memories.
[0005] The first aspect of this application provides a method for locating historical memories, the method comprising: Extract the time features and user identity identifier from the received interactive instructions, and parse the time features according to the current reference time to obtain the target memory time period; Based on the user identity identifier and the target memory time period, data matching is performed from a preset hierarchical memory database to obtain user feature data and historical summary data corresponding to the interaction command; The target memory data corresponding to the interaction command is generated by combining the historical summary data and the user feature data.
[0006] In an optional implementation, the step of extracting the time features and user identity identifier from the received interaction instructions, and parsing the time features based on the read current reference time to obtain the target memory time period includes: Read the user identity identifier corresponding to the received interaction command, and extract the time feature from the interaction command; The current reference time is read from a preset timer, and the time features are semantically parsed based on the current reference time to obtain candidate memory dates; Centered on the candidate memory date, a preset hierarchical memory database is traversed within a preset time window to obtain a data storage timestamp set; When the candidate memory date belongs to the data storage timestamp set, the candidate memory date is used as the target memory time period; When the candidate memory date does not belong to the data storage timestamp set, the candidate memory date is corrected according to the time window to obtain the target memory time period.
[0007] In an optional implementation, the step of matching data from a preset hierarchical memory database based on the user identity identifier and the target memory time period to obtain user feature data and historical summary data corresponding to the interaction instruction includes: Based on the user identity identifier, the user feature data corresponding to the interaction instruction is read from the preset hard memory module; Based on the target memory time period, read the historical summary data corresponding to the interactive command from the preset soft memory module; The preset hierarchical memory database includes the hard memory module and the soft memory module.
[0008] In an optional implementation, after obtaining the historical summary data, the method further includes: Extract target data features from the interaction command, and perform matching analysis on the historical summary data based on the target data features to calculate the matching value between the historical summary data and the interaction command; When the matching value reaches the preset matching threshold, the target memory data corresponding to the interaction instruction is generated by combining the historical summary data and the user feature data. When the matching value is lower than the preset matching threshold, the corresponding original interaction record is extracted from the preset historical data sub-database according to the target memory time period, and the original interaction record and the user feature data are combined to generate the target memory data corresponding to the interaction instruction.
[0009] In an optional implementation, after obtaining the interaction command, the method further includes: When no time feature is extracted from the interaction command, the current interaction record is retrieved from the preset short memory module according to the preset interaction round; Based on the target data characteristics, the current interaction record is analyzed for instruction association to filter out the current summary data; The target memory data corresponding to the interaction command is generated by combining the current summary data and the user feature data.
[0010] In an optional implementation, the method further includes: User behavior analysis is performed based on the event summary data in the soft memory module using a preset large language model, and incremental patches of user features are generated. Based on the user identity identifier, the user feature incremental patch is compared with the current user feature data in the hard memory module to obtain the difference information between the user feature incremental patch and the user feature data, and the number of times the difference information appears is recorded; When the number of occurrences reaches a preset threshold, the user feature data is updated based on the distinguishing information.
[0011] In an optional implementation, the user feature data includes habit entries, trigger rules, and habit weight values, and the method further includes: When the current reference time meets the triggering rule, a pre-reminder message is generated according to the habitual entries corresponding to the triggering rule through a preset reminder method; Obtain user feedback signals regarding the pre-reminder information, and adjust the habit weight value corresponding to the trigger rule according to a preset feedback adjustment method; When the habit weight value is lower than a preset weight threshold, the habit entry is deleted from the user feature data.
[0012] A second aspect of this application provides a historical memory locating device, the device comprising: The time parsing module is used to extract the time features and user identity identifier from the received interactive instructions, and parse the time features according to the current reference time to obtain the target memory time period; The data matching module is used to perform data matching from a preset hierarchical memory database based on the user identity identifier and the target memory time period to obtain user feature data and historical summary data corresponding to the interaction command; The data combination module is used to combine the historical summary data and the user feature data to generate the target memory data corresponding to the interaction command.
[0013] A third aspect of this application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the historical memory location method as described above.
[0014] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the historical memory location method described above.
[0015] In summary, this application includes at least the following beneficial technical effects: By parsing the temporal information in the interaction command before model invocation, and prioritizing the location of corresponding historical summary data and user feature data from the hierarchical memory system based on the parsing results, and further matching more complete historical memory data when summary information is insufficient, the final memory input data corresponding to the current interaction requirement is formed. Compared with the method of directly loading a large amount of raw historical interaction data, this solution can selectively filter historical memory based on temporal semantics, organizing only memory content related to the current request, reducing the participation of irrelevant historical data from the source. While ensuring the accuracy of historical information location, it significantly reduces the scale of input data and memory retrieval overhead, improves the efficiency of historical memory retrieval, and provides more refined and targeted contextual information for subsequent model processing, thereby effectively reducing resource consumption and improving the overall interaction response efficiency. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, 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.
[0017] Figure 1 This is a flowchart of a historical memory location method provided in an embodiment of this application; Figure 2 This is a functional block diagram of a historical memory positioning device provided in an embodiment of this application; Figure 3This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] Existing models typically require data processing resources to parse interaction requests and locate historical records when retrieving them during user interaction. However, the retrieved historical records are raw interaction logs, which are quite large, necessitating resource consumption for input data analysis during subsequent model data processing. This application aims to improve the efficiency and accuracy of historical memory location by avoiding excessive resource consumption. Upon receiving a user-input interaction request, a memory engine is designed to perform historical memory retrieval on behalf of the model. The historical memory location method provided in this application is described below from the perspective of the memory engine.
[0020] like Figure 1 The diagram shown is a flowchart of a historical memory localization method provided in an embodiment of this application. The historical memory localization method provided in this embodiment includes the following steps.
[0021] Step S1: Extract the time features and user identity identifier from the received interactive instructions, and parse the time features according to the current reference time to obtain the target memory time period.
[0022] Interaction commands are the information carriers of the user's current input received by the memory engine. These commands can take the form of plain text directly entered by the user, text obtained from speech signals after speech-to-text processing, or composite information containing audio and image modalities. The acquisition of interaction commands follows a standard path of information collection and formatting: when a user initiates interaction through the input interface of a terminal device (such as a keyboard, microphone, or camera), the input signal is converted into a digital signal and transmitted to the receiving module of the memory engine. This module calls the corresponding parsing submodule based on the signal type—for plain text signals, it directly extracts the character sequence; for audio signals, it calls the speech recognition engine to transcribe them into text; and for multimodal signals containing images, it encodes the image while transcribing it to extract identifiable visual features. Interaction commands carry the user's current intent to query or process, providing raw semantic material for all subsequent processing. The memory engine extracts temporal features and identifies the user by performing time feature extraction and user identification on the command to determine which specific moment's data and which specific user's data need to be retrieved from the hierarchical memory database.
[0023] Upon receiving an interaction command, the memory engine performs two information extraction operations in parallel. The first operation is to extract the user's identity identifier carried in the interaction command. This identifier can be the user's actively submitted account ID, the device fingerprint reported by the terminal device, or a unique user number generated by the fusion of voiceprint recognition and facial recognition. When the interaction command is plain text and does not carry any identity information, the memory engine uses the default user identifier bound to the current session as the user's identity identifier corresponding to the interaction command. The second operation is to extract the time features in the interaction command. The memory engine internally maintains a regular expression pattern library covering year, month, day, week, solar term, festival, relative time words (such as "yesterday", "last week", "next year", etc.), and duration units (such as "day", "week", "month"). This pattern library is stored in the engine's configuration file directory as a collection of compiled regular expressions. The engine sends the text content of the interactive command to the time feature extraction module. This module traverses the entire text string and locates all possible consecutive character substrings that represent time according to each regular expression rule in the pattern library—such as "the day before yesterday", "last Wednesday", "three months ago", "the 18th day of the twelfth lunar month", "July 19, 2026", etc. At the same time, it filters out interference items that do not have time meaning through bracket preprocessing rules (such as the bracket description in "Wednesday (rest day)"). The extraction result is one or more candidate time segments and their offset positions in the original text. If there are no time segments in the interactive command that match the pattern library, the time feature extraction result is empty.
[0024] After the second operation is executed in parallel with the first, the memory engine reads the current reference time from a preset system timer. This timer is synchronized with the operating system's system clock and calibrated to Coordinated Universal Time (UTC). The current reference time returned by the read operation is accurate to the day and formatted as a standard calendar day representation of "YYYY-MM-DD". This date serves as the reference zero point for all subsequent calculations of relative time terms. The memory engine then sends the time features extracted in the previous step (i.e., the set of candidate time segments) along with this current reference time to the semantic parser for normalization processing. The semantic parser first classifies and identifies each candidate time segment: if the segment is in absolute date format (e.g., "July 19, 2026"), it is directly mapped to a standard date in "YYYY-MM-DD" format; if the segment is in relative offset expression (e.g., "three days later" or "two weeks ago"), the specific calendar day is calculated forward or backward based on the current base time, taking into account the difference in the number of days in different months and leap year rules; if the segment is in periodic expression (e.g., "every Wednesday"), it is parsed as the most recent date that meets the periodic condition; if the segment is a lunar date (e.g., "the 18th day of the twelfth lunar month"), it is converted to the corresponding Gregorian date using the built-in lunar-Gregorian conversion table (covering 1900 to 2100); if the segment is in time interval expression (e.g., "the day before yesterday"), it is parsed as the complete natural day corresponding to that interval. The semantic parser performs the above classification and normalization calculations on all time segments extracted from the same interactive command one by one, and finally outputs one or more candidate memory dates. Each candidate memory date is represented in the format "YYYY-MM-DD". If multiple dates are parsed (such as the user inputting "last Monday to Wednesday"), a date list is output.
[0025] After obtaining candidate memory dates, the memory engine performs data availability verification and fault tolerance correction centered on these candidate memory dates. The engine reads a preset time window parameter from the configuration file or environment variables. This parameter defines how many calendar days are allowed to float forward and backward from the candidate memory date during retrieval; the default value is 3 calendar days forward and backward. The engine then traverses the hierarchical memory database, which contains a hard memory module and a soft memory module. The soft memory module stores event summary data divided by day. Each event summary corresponds to a specific calendar day and is stored in the events / subdirectory of the data directory, with the file name format "YYYY-MM-DD.json". The engine traverses the hierarchical memory database as follows: it reads the filenames of all JSON files in the events / subdirectory, extracts the date string corresponding to each filename, parses these date strings into standard calendar day objects, and aggregates them into a data storage timestamp set. This timestamp set is the collection of dates for all existing and usable historical summary data in the hierarchical memory database, reflecting all historical time points that the engine can currently retrieve. The engine compares candidate memory dates with the data storage timestamp set: if the candidate memory date belongs to the set, it means that there is available historical summary data for that day, and the engine directly outputs the candidate memory date as the target memory time period. If the candidate memory date does not belong to the set, it means that there is no available summary for that day, and the engine initiates a fault-tolerant correction process: starting from the candidate memory date, it searches forward and backward in the data storage timestamp set day by day within a preset time window to see if there are any available dates adjacent to the candidate memory date. The search order is to first search backward (candidate memory date + 1 day, + 2 days, + 3 days), and then search forward (candidate memory date - 1 day, - 2 days, - 3 days), prioritizing the available date closest to the candidate memory date. If an available date is found within the time window, the engine uses that available date as the corrected target memory time period and records the offset between the candidate memory date and the actual retrieval date (this offset is used to subsequently explain to the user the actual date to which the returned memory data belongs). If no available date is found within 3 days before or after the preset time window, the candidate memory date is marked as having no available summary. The engine outputs this mark along with the candidate memory date, and subsequent processes will trigger a rollback strategy based on this mark.
[0026] By transforming natural language time expressions into target memory time periods that can be directly addressed by hierarchical memory databases, and by using a fault-tolerant correction mechanism to address the problem of missing summaries for a particular day, the historical memory location method ensures a high retrieval hit rate even under conditions of incomplete data.
[0027] Step S2: Based on the user identity identifier and the target memory time period, perform data matching from a preset hierarchical memory database to obtain user feature data and historical summary data corresponding to the interaction command.
[0028] During step S2, the memory engine has extracted the user's identity from the interaction command and obtained the target memory time period that can be directly addressed by the hierarchical memory database through the time feature parsing and fault tolerance correction process in step S1. At this time, the memory engine needs to read two kinds of historical data with different properties in parallel from the hierarchical memory database based on these two key index information. One kind reflects the user's long-term stable characteristics, and the other reflects the specific historical interaction content corresponding to the target date. The two kinds of data are stored in the hard memory module and soft memory module of the hierarchical memory database, respectively.
[0029] The system reads user feature data corresponding to the interaction command from the hard memory module based on the user's identity identifier. The hard memory module is a persistent storage component in the hierarchical memory database, used to store long-term user attributes and periodic habits. This information does not change frequently with each interaction and has high time stability. At the physical storage level, the hard memory module is an independent data directory in the file system, maintaining a profile file for each registered user in JSON format. The profile file is named "user_id.json", where user_id corresponds one-to-one with the user identity identifier carried in the interaction command. After receiving the user identity identifier, the memory engine directly constructs the complete path to the profile file based on the identifier, in the format "profile directory / user identity identifier.json", and then initiates a read operation on the file at that path. If the file exists, the engine reads it completely into memory and performs JSON deserialization to obtain a structured object containing all the user's profile information; this object is the user feature data. The user feature data is internally divided into two components. The first component is a set of long-term user attributes, which stores static demographic information in key-value pairs. This includes, but is not limited to, fields such as user ID, nickname, age, gender, occupation, place of residence, and hobbies. Each field is stored as a string or a list of strings; for example, the "hobbies" field could have values such as "basketball," "programming," and "photography." The second component is a list of habits describing recurring habits. This list is an ordered set of habit entries, each corresponding to a regularly performed activity. Each habit entry contains at least three fields: an activity description field (using natural language text to record the specific content of the habit, e.g., "attending basketball class every Wednesday afternoon"), a trigger condition field (using a structured time expression to describe the triggering rules for the habit's effective time, e.g., "every Wednesday from 2:00 PM to 4:00 PM"), and a habit weight value field (using a floating-point number between 0 and 1 to represent the importance of the habit in the current user behavior pattern). After completing the hard memory module's read, the memory engine encapsulates all user attribute fields and all habit entries into a user feature data object. This object will serve as an important input for describing user background information in subsequent processes. For example, when the user identity corresponding to the interaction command is "user_123", the memory engine reads the profile / user_123.json file to obtain complete structured data of the user's age as 25, hobbies as basketball and programming, and habit list containing the item "attend basketball interest class every Wednesday afternoon". This data will be retained as is for subsequent combination and use.It is important to note that when the interaction command contains multimodal information including audio and images, the memory engine performs an identity fusion verification operation before reading from the hard memory module. The engine calls the voiceprint recognition model to vectorize and extract the speaker's voiceprint features from the audio signal, and simultaneously calls the face recognition model to detect and encode facial features from the image signal. The two sets of biometric vectors are compared with the user biometric templates pre-stored in the local registration library. When the comparison score exceeds a preset threshold, the matched registered user ID is used as the user identity identifier corresponding to the final interaction command, and then the corresponding profile file is read based on this identifier. If the interaction command does not contain multimodal information or cannot successfully identify the identity, the user identity identifier bound to the current session is used by default. This mechanism ensures that when multiple users alternate using the same terminal device, the user feature data can accurately match the actual operator of the current interaction, avoiding the problem of profile data mismatch caused by identity confusion.
[0030] Simultaneously, based on the target memory time period, historical summary data corresponding to the interaction commands is read from the preset soft memory module. This operation is performed in parallel with the aforementioned hard memory reading operation and is independent of each other. The soft memory module is a temporary storage component in the hierarchical memory database, used to store event summary data divided by day. Each event summary data corresponds to a high-level summary of all historical interaction content for a specific calendar day. At the physical storage level, the soft memory module is also represented as an independent data directory in the file system, namely the events / subdirectory, which stores the event summary file for each day in JSON format. The file naming rule is "YYYY-MM-DD.json", where YYYY-MM-DD is the standard calendar day corresponding to the summary. The memory engine uses the target memory time period corrected in step S1 as the retrieval key value, constructs the complete path of the summary file corresponding to the date, with the path format "events directory / target memory time period.json", and then initiates a read operation on the file under that path. If the file exists and its content is complete, the engine reads it into memory and performs JSON deserialization to obtain a structured summary object for that day. This object contains at least the following fields: a date field recording the standard calendar day corresponding to the summary, an archive timestamp field recording the generation time of the summary, a dialogue turn field recording the total number of message exchanges between the user and the AI that day, a total number of messages field recording the total number of messages that day, and the core summary text field. This field stores a natural language description text generated by the large language model during the offline batch processing stage. This text summarizes the main topics discussed that day, the important questions raised by the user, and any key information worth recording in the long term in coherent sentences. The memory engine extracts the value of the summary text field from this structured summary object; this value is the historical summary data. If the target memory time period output in step S1 is a list of dates rather than a single date (e.g., the user's input interaction command includes a time period expression like "last Monday to Wednesday"), the memory engine iterates through each date in the list, performs the file reading operation described above for each date, and concatenates all the read summary texts into a continuous summary sequence in chronological order. This sequence is output as historical summary data. During concatenation, a corresponding date label is added before each summary text to distinguish the content of different dates. For example, when the target memory time period output in step S1 is "2026-07-19", the memory engine reads structured data from the events / 2026-07-19.json file, which shows that the dialogue rounds on that day were 50 and the summary text was "The user asked about the usage of Python asynchronous programming and discussed the overfitting problem in machine learning". The engine extracts this summary text as historical summary data.For example, if the target memory time period output in step S1 is "2026-07-19" but a file named 2026-07-19.json does not exist in the events / directory, the engine marks this result as having empty historical summary data, and the rollback strategy in subsequent processes will take over the handling of this situation. The event summary data in the soft memory module is fundamentally different from the user feature data in the hard memory module: the former continuously accumulates new files as the calendar progresses and is cleaned or compressed over time, reflecting the interaction content on a specific date and exhibiting temporal locality; the latter continuously accumulates, updates, and is retained long-term, reflecting the user's stable characteristics across time. These two types of data characterize the historical context of the interaction from the "user dimension" and the "time dimension," respectively. In subsequent steps, the memory engine will combine them according to a preset template to form the final context data input to the large language model, thereby achieving the technical effect of allowing the large language model to obtain sufficient user background and historical event information without loading the original dialogue records.
[0031] It should be understood that the hierarchical memory database includes both hard memory and soft memory modules, serving as the data infrastructure for both types of read operations. Physically deployed, the hierarchical memory database resides on storage nodes independent of the large language model inference service. It employs a two-tiered data organization structure comprised of file system directories: the first tier is the `profile / ` subdirectory corresponding to the hard memory module, and the second tier is the `events / ` subdirectory corresponding to the soft memory module. Both subdirectories are located under the same root directory, sharing the same storage medium and access interface. The hierarchical memory database is designed according to the principle of read-write separation: during online interaction, the memory engine performs only read-only operations on the hierarchical memory database (i.e., reading user feature data from the hard memory module and historical summary data from the soft memory module), without any write or modification operations. All write operations to the hierarchical memory database (including the creation of new event summary files in the soft memory module and incremental updates to user profile files in the hard memory module) are executed uniformly by independent offline batch processing tasks every night. This design ensures that the response time of the online retrieval chain is unaffected by I / O blocking and file lock contention caused by write operations.
[0032] By reading in parallel from the hard memory module and the soft memory module, the memory engine can simultaneously obtain structured profile data describing the user's long-term attributes and summary text data describing the interaction content on the target date without accessing any original dialogue log files. In terms of data form, these two types of data have departed from the original, lengthy dialogue log format and exist in a highly condensed structured or semi-structured form. Their data volume is much smaller than the original dialogue log, thereby reducing the computing resources consumed by the model when processing input data.
[0033] Step S3: Combine the historical summary data and the user feature data to generate the target memory data corresponding to the interaction command.
[0034] When performing step S3, the memory engine has obtained the target memory time period from step S1, and has obtained the user feature data returned by the hard memory module and the historical summary data returned by the soft memory module in parallel from step S2. At this time, the engine needs to perform quality assessment and dynamic combination of these data to generate the final target memory data that can be directly consumed by the large language model.
[0035] The memory engine extracts target data features from interactive commands. The purpose of this operation is to identify semantic focus related to historical memory retrieval from the user's natural language input, so as to subsequently measure the relevance of historical summary data. Target data features refer to the core information elements in the interaction command, excluding time features. Specifically, they are semantic units such as the action object, topic, entity name, or query target carried in the interaction command. The engine maintains a feature extraction pipeline, which consists of a word segmenter, a part-of-speech tagger, and a dependency parser connected in series. The engine feeds the full text of the interaction command into this pipeline in sequence. The pipeline first performs word segmentation on the text to divide the continuous character sequence into independent lexical unit sequences. Then, it tags the part of speech of each lexical unit (such as noun, verb, adjective, proper noun, etc.). Next, it determines the grammatical modification relationship between each lexical unit through dependency parsing. Finally, based on a preset entity type whitelist (covering categories such as person names, place names, organization names, product names, technical terms, etc.), it selects words that match the whitelist types and serve as core arguments of the sentence as the target data feature output. The output is in the form of a feature vector composed of several keywords or key phrases. For example, when a user inputs the interaction command "What did we discuss about Python asynchronous programming the day before yesterday?", after word segmentation and dependency analysis, the engine extracts "Python asynchronous programming" and "discussion" as target data features. "Python asynchronous programming" is the topic, and "discussion" is the action object. "The day before yesterday" has already been extracted and stripped as a time feature in step S1 and will not be included again in the target data feature set. Similarly, when a user inputs the interaction command "What suggestions did I make last week regarding the machine learning overfitting problem?", the engine extracts "machine learning overfitting problem" and "suggestions" as target data features. These features will serve as the baseline vector for subsequent matching calculations with historical summary data.
[0036] After obtaining the target data features, the memory engine performs matching analysis on the historical summary data read in step S2 based on these features to calculate the matching value between the historical summary data and the interaction command. The matching analysis is performed as follows: The engine first converts the historical summary data (i.e., the summary text from the soft memory module) and the target data features into vector representations respectively. For each keyword or key phrase in the target data features, the engine maps it to a d-dimensional semantic vector through an embedding model and performs average pooling on all feature vectors to obtain the target feature vector. For the historical summary text, the engine feeds its entire text into the same embedding model to obtain the full-text semantic vector. Then, the cosine similarity between the target feature vector and the historical summary full-text semantic vector is calculated. The cosine similarity value ranges from [0,1] (where a value of 1 indicates that the two are semantically identical, and a value of 0 indicates that the two are orthogonal in the semantic space, i.e., completely unrelated). The value of this cosine similarity is the matching value between the historical summary data and the interaction command. When the historical summary data returned in step S2 contains multiple summary texts corresponding to multiple dates, the engine calculates the cosine similarity between the target feature vector and the full-text semantic vector of each summary text, and takes the maximum value as the final matching value. The significance of calculating the matching value lies in quantitatively evaluating whether the summary data currently read from the soft memory module can meet the query requirements expressed by the user's current interaction command. Because the summary data is a compressed representation of the original dialogue record, it has high information density but limited information completeness. There may be cases where the summary does not contain the specific details queried by the user. By calculating the matching value, such cases of insufficient information can be identified in advance and the corresponding compensation mechanism can be triggered.
[0037] When the matching value reaches the preset matching threshold, the engine determines that the current historical summary data can meet the information requirements of the interaction command. At this point, it directly combines the historical summary data and user feature data to generate the target memory data corresponding to the interaction command. The preset matching threshold is a floating-point constant read from the configuration file when the engine starts. Its value ranges from 0 to 1, and the default value is set to 0.65. This threshold represents the minimum acceptable semantic similarity between the historical summary and the user's query intent. The specific execution method of data combination is as follows: The memory engine reads a preset template string from the internal storage area. This template string reserves the insertion positions of user feature data, historical summary data, and current user command in the form of formatted placeholders. The engine serializes the user attribute field and habit list field in the user feature data obtained in step S2 into a coherent descriptive text in the form of key-value pairs. The descriptive text is filled into the first placeholder of the template. The historical summary data obtained in step S2 (if there are multiple summaries, they are concatenated in chronological order and the corresponding date is marked before each summary) is filled into the second placeholder of the template. The original interaction command text is filled into the third placeholder of the template. The complete string generated after filling is the target memory data. The target memory data serves as the final context fed into the large language model. It is organized hierarchically, first describing who the user is, then what happened historically, and finally what the user is currently asking. This allows the large language model to directly generate a response based on the pre-located historical memory and structured user features upon receiving the input, without requiring additional retrieval or memory localization operations within the model. This significantly reduces the resource consumption of the large language model when processing the request. For example, if the interaction command is "What did we talk about the day before yesterday?", the historical summary data is "2026-07-19: The user asked about the usage of asynchronous Python programming," and the user feature data includes the user's age (25 years old), interest in programming, and habit of attending basketball class every Wednesday afternoon, the engine generates the combined data as "User attributes: Age 25, Interest: Programming; Habit: Basketball class every Wednesday afternoon. Historical summary of the day before yesterday (2026-07-19): The user asked about the usage of asynchronous Python programming. Current user asks: What did we talk about the day before yesterday?" This combined data is the target memory data.
[0038] When the matching value is lower than the matching threshold, the engine determines that the current summary data is insufficient to meet the information requirements of the interaction command. At this time, it extracts the corresponding original interaction record from the preset historical data sub-database according to the target memory time period, and generates the target memory data by combining the original interaction record and user feature data. The historical data sub-database is a third type of storage component in the hierarchical memory database, independent of the hard memory module and the soft memory module. It is used to persistently store the complete original records of all historical interactions. This sub-database can be located on the same storage node as the soft memory module and the hard memory module, or it can be located on a separate storage node. Its data is stored in an append-only manner. Each record contains a complete interaction timestamp, sender role identifier, and message body content. Once written, it is not modified. The engine constructs query conditions according to the target memory time period (for example, when the target memory time period is a single date "2026-07-19", the query condition is all records whose timestamps belong to the period between 0:00 and 23:59:59 on that day), and then sends a range query request to the historical data sub-database. The sub-database locates the corresponding set of records based on the timestamp index and returns them all to the engine. After receiving the original interaction records, the engine arranges each message in these records chronologically and formats each message into a "role: message content" text format. All formatted messages are then concatenated into a complete original dialogue text block. This original dialogue text block is then used as replacement data to fill the position in the template that originally belonged to the historical summary data. It is then combined with user feature data and original interaction instructions in the same way as described above to generate target memory data. This fallback mechanism ensures that the system can still provide effective historical information based on the complete original records even when summary data is missing or the summary content is irrelevant to the user's query intent. Although this method increases the amount of resources ultimately input to the large language model, the occurrence of matching values below the matching threshold only happens when the summary generation quality of the soft memory module is poor or the user query crosses details not covered in the summary. This occurrence is far less frequent than normal hits, and therefore does not significantly affect the average resource consumption. For example, if the user's input interaction command is "What stage did our discussion on asynchronous Python programming reach the day before yesterday?", and the summary for 2026-07-19 in the soft memory module is only "The user asked a question about Python programming"—when the cosine similarity between this summary and the progress query intent "What stage did our discussion reach?" is less than 0.65, the engine will extract all the original interaction records for 2026-07-19 from the historical data sub-database. The extracted records contain the complete discussion process between the user and the AI regarding asynchronous Python programming. The engine will combine this complete record with the user's feature data and output it as the target memory data.
[0039] After receiving an interaction command, if no time feature is extracted from the command, the engine does not trigger a cross-day search. Instead, it retrieves the current interaction record from the preset short memory module based on the preset interaction rounds. The short memory module is a fourth type of storage component in the hierarchical memory database, independent of the hard memory and soft memory modules. Its function differs from the hard and soft memory modules—it is dedicated to temporarily storing all interaction records generated by a single ongoing session. Physically, this module corresponds to a session-level cache area. Each session (uniquely identified by its session_id) has independent storage space within this cache area, which maintains the most recent message records using a sliding window. When the engine detects that the interaction command does not contain any time expression matching the regular expression pattern library, it means the user is not concerned with specific historical dates but only with the continuation of the current interaction's content. In this case, the engine extracts the session_id of the current interaction and uses it as the key to read all stored records of the current session from the short memory module. Then, it extracts the interaction messages from the most recent preset rounds from these stored records in reverse chronological order. The preset number of interaction rounds is an integer constant read from the configuration file when the engine starts, with a default value of 10 rounds. Each round represents a complete round-trip between a user input and an AI output. The purpose of this operation is to provide the user with the necessary short-term historical context before the current session ends, because in continuous dialogues without mentioning any time words, the user's questions are often based on content that has just occurred in the conversation, and the recent few rounds of interaction records can provide sufficient information to support them.
[0040] After retrieving the current interaction record from the short memory module, the engine performs instruction association analysis on the current interaction record based on the target data features to filter out the current summary data. This filtering process is executed as follows: The engine extracts all keywords from the target data features, calculates the semantic relevance between the text content of each message in the current interaction record and the target data features. The semantic relevance is calculated by converting the message text and the keyword set of the target data features into vectors and calculating the cosine similarity. Then, the cosine similarity of each message is compared with a preset semantic filtering threshold. When the cosine similarity of a message exceeds the threshold, that message is marked as related to the current interaction instruction. After marking all messages, the engine arranges all the marked related messages in chronological order and concatenates the text content of these messages into a coherent text block, which is the current summary data. The significance of this filtering process lies in further refining the parts that are semantically related to the current user command from the most recent rounds of interaction records, avoiding sending all recent interaction records into the large language model indiscriminately, which would cause unnecessary resource consumption. At the same time, by filtering out interaction content that is irrelevant to the current topic, the signal-to-noise ratio of the historical context is improved.
[0041] After obtaining the current summary data, the engine combines the current summary data with the user feature data read in step S2 to generate the target memory data corresponding to the interaction command. The data combination execution method is exactly the same as the combination method when the matching value reaches the threshold: the engine reads the preset template string from the internal storage area, fills the text serialization result of the user feature data into the first placeholder of the template, fills the current summary data into the second placeholder of the template (at this time, the content source in the second placeholder is switched from the soft memory module to the current summary data obtained from the short memory module), and fills the original interaction command into the third placeholder of the template. The complete string generated after filling is the target memory data. For example, when the user inputs the interaction command "I want to think about what to eat" and no time features are extracted from the command, the engine retrieves the most recent 10 rounds of interaction records from the short memory module. It extracts "eat" from the target data features as a keyword to perform semantic filtering on the most recent 10 rounds of interaction records. If the most recent 10 rounds contain messages related to eating, such as "User: I bought beef yesterday" and "Assistant: Beef can be stewed," these messages are filtered out as the current summary data. Finally, the user feature data, the current summary data, and the current interaction command are combined into the target memory data for output.
[0042] Through the complete processing logic of the above three branches—with time features and summary matching, with time features but summary mismatch, and without time features—the memory engine can generate target memory data containing sufficient historical information for use by large language models in any interactive scenario. At the same time, through two quality assurance mechanisms, namely matching value judgment and short memory filtering, a dynamic balance is achieved between data quality and model data processing resource consumption.
[0043] In one alternative implementation, the memory engine updates user profiles to adapt to changes in user characteristics. Specifically, the memory engine starts offline in batches after completing the daily event summary archiving every night. However, in this offline implementation, the memory engine does not process real-time interaction commands, but rather the archived event summary data in the soft memory module. This event summary data is a high-level summary of historical interaction content divided by day stored in the soft memory module. Each event summary corresponds to a specific calendar day, and its content is generated by the large language model during the daily archiving process based on all the original conversation records of the day. It summarizes the main topics discussed that day, the important questions raised by users, and any behavioral patterns worth recording long-term in the form of natural language text. The memory engine uses this event summary data as input material and calls the preset large language model to perform user behavior analysis on this material, thereby generating incremental patches of user characteristics. These patches are structured data objects describing changes in user characteristics.
[0044] The system performs user behavior analysis and generates incremental patches for user features based on event summary data in the soft memory module using a pre-defined large language model. The specific implementation is as follows: In the offline batch processing workflow, the memory engine first reads the event summary data to be analyzed within the current processing cycle from the events / directory of the soft memory module. By default, it processes one or more newly generated event summary files for the current day. After reading, the summary text is concatenated into a continuous input text block according to date order. The memory engine then loads a pre-defined patch generation prompt template from the configuration file. This template specifies the output format requirements in an instruction format that the large language model can understand. The prompt template explicitly instructs the large language model to compare the input summary text with existing user profiles, identify new user attributes, interests, habits, or changes in existing attributes reflected in the summary, and output the incremental patch in a structured format defined by JSON Schema. This JSON Schema is predefined in the engine's configuration file, specifying that the patch object must contain three top-level fields: an "Add" field to store the first occurrence of a user attribute or habit entry in the summary, an "Modify" field to store the updated value of the attribute or habit entry that differs from the existing value in the profile, and a "Delete" field to store the path of the profile entry marked for removal. The prompt template also includes a sample patch object to guide the large language model in outputting in the expected format. The memory engine combines the concatenated summary text, the existing complete user profile file, and the patch generation prompt template into a single model input in the order of "system instruction—profile status—new summary." This input is then sent to the large language model server endpoint via a pre-defined API. Upon receiving the input, the large language model analyzes the changes in user behavior patterns reflected in the summary according to the prompt template's instructions, generates an incremental patch object conforming to the JSON Schema definition, and returns it to the memory engine via the API. For example, if the event summary for a given day in the soft memory module is "The user inquired about the parameter comparison of photography equipment for three consecutive days and shared multiple portrait photographs," the large language model, after analysis, generates a patch object containing an update suggestion for the "interests" field. This patch adds the profile fragment "Photography: Has a sustained interest in portrait photography and equipment parameters" to the "Add" field. The significance of this operation is that it transforms the user behavior information scattered throughout the daily summary text into structured profile change instructions, providing clear data support for subsequent profile updates. Furthermore, by outputting only incremental patches instead of complete profile copies, it significantly reduces the amount of output resources required by the large language model in this task.
[0045] After the memory engine receives the incremental user feature patch returned by the large language model, it compares the incremental user feature patch with the current user feature data in the hard memory module based on the user's identity identifier. This comparison obtains the difference information between the incremental user feature patch and the current user feature data, and records the frequency of the difference information. This comparison operation is executed as a pre-verification process for profile updates in the offline batch processing stage. Its specific implementation is as follows: The memory engine first parses the incremental user feature patch object returned by the large language model and verifies whether the object conforms to the preset JSON Schema. The verification includes checking for illegal field names outside the Schema's specifications, whether the data type of each field's value matches the corresponding field type defined in the Schema, and whether the date format field conforms to the standard "YYYY-MM-DD" format. If the verification fails, the patch is discarded, a verification failure log is recorded, and no subsequent update operations are performed. After successful verification, the memory engine reads the user's current complete user feature data file from the profile / subdirectory of the hard memory module based on the user's identity. It then compares each change entry under the "Add," "Modify," and "Delete" fields in the patch object with the corresponding fields in the current user feature data: For each entry under the "Add" field, the engine checks if an identical entry already exists in the current user feature data; if not, it marks the entry as a new addition requiring confirmation. For each entry under the "Modify" field, the engine locates the corresponding path's field value in the current user feature data and calculates the textual difference between the patch's suggested new value and the current value; if any difference exists, the entry is marked as a modification requiring confirmation. For each entry under the "Delete" field, the engine checks if the entry exists in the current user feature data; if it does, it is marked as a deletion requiring confirmation. All tagged distinction information is aggregated into a distinction information set. Each distinction information entry in this set contains three core attributes: change type (added, modified, or deleted), change target path (indicating the location of the change in the profile JSON structure), and change content (the identifier of the added value, the modified new value, or the entry to be deleted). After obtaining the distinction information set, the memory engine uses the combination key of user identity and change target path as an index to search for the history of that combination key in the patch history storage area allocated in the hard memory module. The patch history storage area is a persistent storage space independent of the user feature data file, used to record the number of times each distinction information appears in the past multiple patch cycles and the time of its first appearance. If the combination key is not yet recorded in the patch history, the engine creates a new record and sets the current date as the first appearance date, initializing the appearance count to 1; if the combination key already exists, the engine increments its appearance count by 1 and updates the most recent appearance date.For example, if the current feature data in a user profile does not include the interest item "photography," but the offline patches for three consecutive days all contain the distinguishing information "New Interest: Photography," then the engine will create a record and count it as 1 when it appears for the first time, 2 for the second time, and 3 for the third time. The significance of this comparison and counting operation is to prevent the large language model from erroneously modifying the user profile due to accidental information in a single summary or illusory output during the generation process—for example, a user might only query photography equipment information on a particular day for a temporary reason. If the large language model generates a patch stating "user interest is photography" based solely on a single day's summary and directly writes it into the profile, the profile will be inaccurate. By accumulating the number of times the same change suggestion appears in multiple patches, the engine can effectively distinguish between occasional and persistent behavior patterns, thereby improving the reliability of profile updates.
[0046] When the frequency of a distinguishing information reaches a preset threshold, the memory engine updates the user feature data based on that information. The preset threshold is an integer constant read from the configuration file when the engine starts, with a default value of 3. This threshold represents how many times a change suggestion needs to be independently proposed by the large language model in consecutive patch sessions to be considered credible. After each accumulation of the frequency of distinguishing information, the engine compares this count with the threshold. If the frequency of a distinguishing information has not yet reached the threshold, the engine does not perform any profile update operation, and the distinguishing information remains in the patch history storage area awaiting further verification in subsequent patch cycles. If the frequency of a distinguishing information reaches or exceeds the threshold, the engine determines that the change suggestion has passed the confidence verification and applies the changes contained in the distinguishing information to the current user feature data. The specific execution method for application changes is a deep merge operation: For "added" type difference information, the engine creates the corresponding path node in the user feature data and writes the value specified by the change content; for "modified" type difference information, the engine locates the corresponding path node in the user feature data and replaces its existing value with the new value specified by the change content; for "deleted" type difference information, the engine locates the corresponding path node in the user feature data and removes it from the profile structure. After the deep merge operation is completed, the engine updates the last update timestamp field at the top of the user feature data file and removes the difference information on which this update is based from the patch history storage area to avoid repeating the same update. For example, when the difference information "Added hobby: Photography" appears in three consecutive patches (i.e., the number of occurrences reaches the threshold of 3), the engine writes the photography interest entry into the hobby list of the user feature data, and the user profile changes from the original "Hobby: Basketball, Programming" to "Hobby: Basketball, Programming, Photography". This operation ensures that user profile updates no longer rely on single patches generated by the large language model, but are based on consistency verification through multiple independent patches. This effectively filters out profile noise caused by single abnormal interactions or errors in the large language model's generation, ensuring the accuracy and robustness of user feature data in the hard-memory module over long-term operation. Furthermore, since the entire comparison, counting, and update operation is performed offline in batch processing, this mechanism does not cause any additional response delays to the online interaction chain. Users are unaware of the background computational burden during the entire profile update process, thus balancing profile quality and user experience.
[0047] In one optional implementation, the memory engine adjusts habit entries in the user feature data during online interaction or offline idle periods. In the active forgetting mechanism employed in this optional implementation, the triggering condition of the memory engine does not depend on user-initiated interactive commands, but is driven by a timer within the engine that periodically matches the current base time with the triggering rules carried by each habit entry in the user feature data. User feature data is structured profile information stored in the hard memory module and bound to a specific user identity. It contains at least three interrelated components: habit entries, triggering rules, and habit weight values. A habit entry is a description of a user's periodic activities recorded in natural language text (e.g., "go to basketball class every Wednesday afternoon"). A triggering rule is a structured time expression corresponding to the habit entry (e.g., "every Wednesday from 2:00 PM to 4:00 PM"). The habit weight value is a floating-point number ranging from 0 to 1, used to characterize the importance or credibility of the habit entry in the current user behavior pattern.
[0048] When the current reference time read by the memory engine from the system timer matches a trigger rule carried by a habit entry in the user's feature data, the engine generates a pre-reminder message based on the habit entry corresponding to that trigger rule using a preset reminder method. The specific execution method of this matching judgment is as follows: The memory engine maintains a timed poller that reads the current reference time (accurate to the minute) from the system timer every minute. Then, it compares this current reference time with the trigger rule for each habit entry in the user's feature data. Trigger rules are stored in the user's feature data in Cron expressions or iCalendar repeat rules (RRule) format. The engine integrates parsers corresponding to these two formats. The parser expands the trigger rule into a series of discrete time points. When the absolute value of the difference between the current reference time and a certain time point in the set is less than a preset time tolerance window (e.g., 5 minutes), the current reference time is determined to match the trigger rule. Once a match is successful, the engine immediately extracts the complete description text of the habit entry associated with the trigger rule from the user's feature data and then generates a pre-reminder message based on this description text. The pre-reminder message is generated by loading a preset reminder template string from the engine's internal storage. This template contains a placeholder for filling in the descriptive text of the habit item. After the engine fills in the placeholder with the descriptive text, it obtains the complete pre-reminder message (e.g., "You have a basketball interest class this afternoon, will you attend as usual?"). The preset reminder method depends on the capability configuration of the terminal device on which the memory engine is deployed—when the terminal device supports audio output, the engine calls the text-to-speech module to convert the pre-reminder message into an audio signal and plays it through the speaker; when the terminal device has a graphical interface, the engine displays the text content of the pre-reminder message through the notification bar or pop-up window; when the terminal device only supports a plain text interactive interface, the engine pushes the pre-reminder message as a proactive message to the user's message queue for the user to view. The significance of this proactive reminder operation is to transform the habit information stored in the hard memory module from passive, static data used only for retrieval and querying into a proactive, dynamic management tool that can interact with the user. By proactively confirming with the user before the actual behavior occurs, the memory engine can continuously obtain information on the consistency or deviation between the user's current actual behavior and the historical behavior patterns recorded in the profile.
[0049] After generating and pushing pre-reminder information to the user, the memory engine obtains the user's feedback signal for the pre-reminder information and adjusts the habit weight value corresponding to the trigger rule according to the preset feedback adjustment method. The path for obtaining the feedback signal corresponds to the path for sending the pre-reminder information—if the pre-reminder information is played in voice form, the engine collects the user's voice response through the microphone and calls the speech recognition and semantic understanding modules to convert it into a structured feedback signal; if the pre-reminder information is displayed in the form of a graphical interface pop-up, the engine directly receives the feedback signal by having the user click on buttons such as "Confirm Participation," "Cancel," or "Do Not Set" in the pop-up; if the pre-reminder information is pushed in the form of a text message, the engine waits for the user to input a text reply and performs keyword matching on the reply content to identify the feedback intent. The engine normalizes the collected feedback signals into a binary form—positive feedback (indicating that the user confirms the habit is still valid) or negative feedback (indicating that the user has canceled, postponed, or that the habit is no longer applicable). For example, mapping rules are predefined in the engine's configuration file. Responses containing keywords such as "cancel," "not needed," "not going," or "reschedule" are mapped as negative feedback, while responses containing keywords such as "okay," "participate," "as usual," or "confirm" are mapped as positive feedback. After obtaining the normalized feedback signals, the engine adjusts the habit weight value corresponding to the trigger rule according to a preset feedback adjustment method. The specific implementation of the feedback adjustment method is as follows: The engine reads the weight update step size constant (default value is 0.1) from the configuration file. When the feedback signal is positive, the original habit weight value is increased by the weight update step size (i.e., the new weight value equals the old weight value plus 0.1), and the new weight value is compared with the upper limit of 1.0. If the new weight value exceeds 1.0, it is truncated to 1.0. When the feedback signal is negative, the original habit weight value is decreased by the weight update step size (i.e., the new weight value equals the old weight value minus 0.1), and the new weight value is compared with the lower limit of 0.0. If the new weight value is lower than 0.0, it is truncated to 0.0. The significance of this weight adjustment operation is to quantify each actual user feedback to the pre-reminder into a calculable numerical change, so that the importance representation of habit items in the user profile can dynamically drift with changes in the user's actual behavior—the weight value of habits that the user continuously confirms will gradually rise and stabilize at a higher level, while the weight value of habits that the user repeatedly cancels or rejects will gradually decrease, thereby realizing the gradual tracking of changes in user behavior by the profile data.For example, the user's feature data stores a habit item "Going to basketball interest class every Wednesday afternoon". Its trigger rule is "every Wednesday at 14:00" and its current weight value is 0.8. When the engine meets the trigger rule at the current base time, it pushes a pre-reminder message "There is a basketball interest class in the afternoon, do you still want to attend?" If the user replies "No, I won't go today", the engine maps the reply as negative feedback and adjusts the weight value from 0.8 to 0.7. If the weight value continues to decrease after multiple reminders, it will enter the deletion judgment process.
[0050] After each adjustment of the habit weight value, the memory engine compares the adjusted habit weight value with a preset weight threshold. When the habit weight value is lower than the preset weight threshold, the habit entry is deleted from the user feature data. The preset weight threshold is a floating-point constant read from the configuration file when the engine starts. Its value ranges from 0 to 1, with a default value of 0.3. This threshold represents the minimum confidence level at which the memory engine considers a habit entry to be still valid. The engine performs a comparison operation immediately after each weight value update calculation: if the adjusted weight value is greater than or equal to the weight threshold, the engine retains the habit entry in the user feature data, only writing the updated weight value to the corresponding weight field and updating the timestamp; if the adjusted weight value is lower than the weight threshold, the engine performs a deletion operation—specifically, the engine locates the habit entry's position in the user feature data list, removes the entry's complete data (including the habit entry description text, trigger rules, and weight value) from the habit list in the user feature data, and simultaneously writes the log of this deletion operation (including the complete content of the deleted habit entry and the deletion time) to a separate historical deletion record file in the hard memory module for subsequent auditing or recovery needs. After the deletion operation is completed, the engine updates the last update timestamp field at the top of the user feature data file. This habit entry will no longer be matched in subsequent trigger rule polling, and no corresponding pre-reminder information will be generated. The significance of this weight threshold comparison and deletion operation is to enable the habit data in the hard memory module to have automatic elimination capabilities. When a user's actual behavior pattern changes, causing a habit entry to be repeatedly rejected and its weight value to continuously decay to an irrecoverable level, this mechanism can proactively remove the outdated habit entry from the profile. This avoids the user feature data from bloating due to the long-term accumulation of outdated information and the reduction in the efficiency of trigger rule polling matching. At the same time, it prevents the engine from continuing to push irrelevant or annoying reminder information to the user based on expired habit entries in future interactions. For example, the aforementioned habit entry "attending basketball interest class every Wednesday afternoon" gradually decreased in weight value from 0.8 to 0.3 after multiple negative feedbacks from the user. When the engine updates the weight value to 0.2 in the next feedback adjustment, 0.2 is lower than the preset weight threshold of 0.3. The engine then deletes all records of this habit entry from the user feature data, and no further proactive reminders will be given for this habit.
[0051] like Figure 2 The diagram shown is a functional block diagram of a historical memory positioning device provided in an embodiment of this application.
[0052] In some embodiments, the historical memory locating device 2 may include multiple functional modules composed of computer program segments. The computer programs for each program segment in the historical memory locating device 2 may be stored in the server's memory and executed by at least one processor to perform (see details). Figure 1 (Description) The function of historical memory location methods.
[0053] In this embodiment, the historical memory positioning device 2 can be divided into multiple functional modules according to its functions. These functional modules may include: a time analysis module 21, a data matching module 22, and a data combination module 23. The term "module" in this invention refers to a series of computer program segments that can be executed by at least one processor and perform a fixed function, and which are stored in memory. In this embodiment, the functions of each module will be detailed in subsequent embodiments.
[0054] The time parsing module 21 is used to extract the time features and user identity identifier from the received interactive instructions, and parse the time features according to the current reference time to obtain the target memory time period; Data matching module 22 is used to perform data matching from a preset hierarchical memory database based on the user identity identifier and the target memory time period to obtain user feature data and historical summary data corresponding to the interaction command; The data combination module 23 is used to combine the historical summary data and the user feature data to generate the target memory data corresponding to the interaction command.
[0055] It should be understood that the various variations and specific embodiments of the methods provided in the above embodiments are also applicable to the historical memory positioning device of this embodiment. Through the foregoing detailed description of the historical memory positioning method, those skilled in the art can clearly understand the implementation method of the historical memory positioning device in this embodiment. For the sake of brevity, it will not be described in detail here.
[0056] like Figure 3 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application.
[0057] In a preferred embodiment of the present invention, the electronic device 3 may include, but is not limited to, a memory 31, at least one processor 32, and at least one communication bus 33.
[0058] Those skilled in the art should understand that Figure 3 The structure of the electronic device 3 shown does not constitute a limitation of the embodiments of the present invention. The electronic device 3 may also include more or fewer other hardware or software than shown, or different component arrangements.
[0059] In some embodiments, the electronic device 3 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices.
[0060] It should be noted that the electronic device 3 is merely an example. Other existing or future electronic products that are suitable for this application should also be included within the scope of protection of this application and are incorporated herein by reference.
[0061] In some embodiments, the memory 31 stores a computer program that, when executed by the at least one processor 32, implements all or part of the steps in the historical memory location method described. The memory 31 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically-erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data. Further, the computer-readable storage medium may primarily include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application program required for a function, etc.
[0062] In some embodiments, the at least one processor 32 is the control unit of the electronic device 3, connecting various components of the electronic device 3 via various interfaces and lines. It executes programs or modules stored in the memory 31 and calls data stored in the memory 31 to perform various functions and process data. For example, when the at least one processor 32 executes a computer program stored in the memory 31, it implements all or part of the steps of the historical memory positioning method described in this application embodiment; or it implements all or part of the functions of the historical memory positioning device. The at least one processor 32 may be composed of integrated circuits, such as a single-packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips.
[0063] In some embodiments, the at least one communication bus 33 is configured to enable communication between the memory 31 and the at least one processor 32, etc. Although not shown, the electronic device 3 may also include a power supply (e.g., a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 32 via a power management device, thereby enabling functions such as charging, discharging, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 3 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0064] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause an electronic device (which may be a personal computer, electronic device, or network device, etc.) or processor to execute portions of the methods described in the various embodiments of this application.
[0065] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0066] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0067] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A method for locating historical memories, characterized in that, The method includes: Extract the time features and user identity identifier from the received interactive instructions, and parse the time features according to the current reference time to obtain the target memory time period; Based on the user identity identifier and the target memory time period, data matching is performed from a preset hierarchical memory database to obtain user feature data and historical summary data corresponding to the interaction command; The target memory data corresponding to the interaction command is generated by combining the historical summary data and the user feature data.
2. The historical memory location method according to claim 1, characterized in that, The process of extracting time features and user identification from received interactive commands, and parsing the time features based on the read current reference time to obtain the target memory time period includes: Read the user identity identifier corresponding to the received interaction command, and extract the time feature from the interaction command; The current reference time is read from a preset timer, and the time features are semantically parsed based on the current reference time to obtain candidate memory dates; Centered on the candidate memory date, a preset hierarchical memory database is traversed within a preset time window to obtain a data storage timestamp set; When the candidate memory date belongs to the data storage timestamp set, the candidate memory date is used as the target memory time period; When the candidate memory date does not belong to the data storage timestamp set, the candidate memory date is corrected according to the time window to obtain the target memory time period.
3. The historical memory location method according to claim 1, characterized in that, The step of matching data from a preset hierarchical memory database based on the user identity and the target memory time period to obtain the user feature data and historical summary data corresponding to the interaction command includes: Based on the user identity identifier, the user feature data corresponding to the interaction instruction is read from the preset hard memory module; Based on the target memory time period, read the historical summary data corresponding to the interactive command from the preset soft memory module; The preset hierarchical memory database includes the hard memory module and the soft memory module.
4. The historical memory location method according to claim 1, characterized in that, After obtaining the historical summary data, the method further includes: Extract target data features from the interaction command, and perform matching analysis on the historical summary data based on the target data features to calculate the matching value between the historical summary data and the interaction command; When the matching value reaches the preset matching threshold, the target memory data corresponding to the interaction instruction is generated by combining the historical summary data and the user feature data. When the matching value is lower than the preset matching threshold, the corresponding original interaction record is extracted from the preset historical data sub-database according to the target memory time period, and the original interaction record and the user feature data are combined to generate the target memory data corresponding to the interaction instruction.
5. The historical memory location method according to claim 2, characterized in that, After obtaining the interaction command, the method further includes: When no time feature is extracted from the interaction command, the current interaction record is retrieved from the preset short memory module according to the preset interaction round; Based on the target data characteristics, the current interaction record is analyzed for instruction association to filter out the current summary data; The target memory data corresponding to the interaction command is generated by combining the current summary data and the user feature data.
6. The historical memory location method according to claim 3, characterized in that, The method further includes: User behavior analysis is performed based on the event summary data in the soft memory module using a preset large language model, and incremental patches of user features are generated. Based on the user identity identifier, the user feature incremental patch is compared with the current user feature data in the hard memory module to obtain the difference information between the user feature incremental patch and the user feature data, and the number of times the difference information appears is recorded; When the number of occurrences reaches a preset threshold, the user feature data is updated based on the distinguishing information.
7. The historical memory location method according to claim 6, characterized in that, The user feature data includes habit entries, trigger rules, and habit weight values; the method further includes: When the current reference time meets the triggering rule, a pre-reminder message is generated according to the habitual entries corresponding to the triggering rule through a preset reminder method; Obtain user feedback signals regarding the pre-reminder information, and adjust the habit weight value corresponding to the trigger rule according to a preset feedback adjustment method; When the habit weight value is lower than a preset weight threshold, the habit entry is deleted from the user feature data.
8. A historical memory positioning device, applied to the historical memory positioning method of claim 1, characterized in that, The device includes: The time parsing module is used to extract the time features and user identity identifier from the received interactive instructions, and parse the time features according to the current reference time to obtain the target memory time period; The data matching module is used to perform data matching from a preset hierarchical memory database based on the user identity identifier and the target memory time period to obtain user feature data and historical summary data corresponding to the interaction command; The data combination module is used to combine the historical summary data and the user feature data to generate the target memory data corresponding to the interaction command.
9. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the historical memory location method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the historical memory location method according to any one of claims 1 to 7.
