Memory recall method, task processing method, electronic equipment and storage medium
By determining the timeliness and importance values of memory fragments and combining them with similarity for comprehensive evaluation, the problem of inaccurate memory recall in existing technologies is solved, achieving more efficient memory recall and task processing.
Patent Information
- Application Number
- CN202511488640.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, memory retrieval methods mainly rely on the similarity between text and memory fragments for screening, which leads to inaccurate memory retrieval results, affects the accuracy of task processing, and lacks accurate assessment of the timeliness and importance of memories.
By acquiring multiple memory fragments related to the user, the memory type is determined, and memory fragments are screened based on the time decay function and importance assessment information. This includes fusing the target timeliness value and the target importance value, and determining the comprehensive assessment value by combining similarity, thereby optimizing the memory recall process.
It improves the accuracy of memory retrieval, enhances task processing effectiveness, reduces storage resource waste, and optimizes long-term memory management.
Smart Images

Figure CN121501987A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, more particularly, to a memory recall method, a task processing method, an electronic device and a storage medium. BACKGROUND
[0002] In the related art, in the tasks such as dialogue, knowledge question answering and intelligent decision making, memory recall can be combined to assist task processing. The memory recall can be to screen part of the memory fragments from the memory fragments of the user (such as the text content input by the user), so as to assist the task processing by using the memory fragments of the user.
[0003] However, in the related art, the screening of the memory fragments is mainly performed by the similarity between the text input by the user and the memory fragments. However, through long-term research of the inventor, it is found that the result of the memory recall is not accurate, which further affects the accuracy of the task processing. SUMMARY
[0004] The embodiments of the present application provide a memory recall method, a task processing method, an electronic device and a storage medium, which can improve the accuracy of memory recall and improve the accuracy of task processing.
[0005] In a first aspect, the embodiments of the present application provide a memory recall method, comprising: obtaining a plurality of memory fragments related to a user stored in advance, the memory fragments comprising content in historical text input by the user; for any memory fragment in the plurality of memory fragments, determining a memory type to which the memory fragment belongs, and determining first recall evaluation information corresponding to the memory fragment based on the memory type corresponding to the memory fragment, the first recall evaluation information comprising at least one of a target timeliness value and a target importance value, wherein the target timeliness value is determined based on a timeliness decay function corresponding to the memory category to which the memory fragment belongs and a time stamp corresponding to the memory fragment, and the target importance value is obtained according to the memory type corresponding to the memory fragment; recalling a target memory fragment from the plurality of memory fragments based on the first recall evaluation information corresponding to each of the plurality of memory fragments.
[0006] In the embodiment, the plurality of memory fragments related to the user are obtained in advance, the memory fragments include content in the historical text input by the user; for any memory fragment in the plurality of memory fragments, a memory type to which the memory fragment belongs is determined, and first recall evaluation information corresponding to the memory fragment is determined based on the memory type corresponding to the memory fragment, the first recall evaluation information including at least one of a target timeliness value and a target importance value, wherein the target timeliness value is determined based on a timeliness decay function corresponding to the memory category to which the memory fragment belongs and a timestamp corresponding to the memory fragment, and the target importance value is obtained according to the memory type corresponding to the memory fragment; and the target memory fragment is recalled from the plurality of memory fragments based on the first recall evaluation information corresponding to each of the plurality of memory fragments, so that at least one of the target timeliness value and the target importance value can be determined according to the memory type of the memory fragment, and the memory recall is performed by using timeliness and importance, thereby improving the accuracy of the memory fragment recall.
[0007] In a possible implementation, the first recall evaluation information includes the target timeliness value, and the first recall evaluation information corresponding to the memory fragment is determined based on the memory type corresponding to the memory fragment, including: The current time is obtained, the current time being the time when the plurality of memory fragments related to the user are obtained in advance; a difference value between the current time and a timestamp corresponding to the memory fragment is determined to obtain a target time difference value; and the time difference value is substituted into a timeliness decay function corresponding to the memory category to which the memory fragment belongs to determine the target timeliness value corresponding to the memory fragment.
[0008] In the embodiment, the current time is obtained, the current time being the time when the plurality of memory fragments related to the user are obtained in advance; a difference value between the current time and a timestamp corresponding to the memory fragment is determined to obtain a target time difference value; and the time difference value is substituted into a timeliness decay function corresponding to the memory category to which the memory fragment belongs to determine the target timeliness value corresponding to the memory fragment, and since the time when the plurality of memory fragments related to the user are obtained in advance is also considered, the accuracy of the determined target timeliness value is improved, and the accuracy of the memory recall is further improved.
[0009] In a possible implementation, the method further includes: if the target timeliness value corresponding to the memory fragment is lower than a timeliness value threshold, the memory fragment is added to a buffer pool; and if the memory fragment added to the buffer pool is not recalled after a preset time, the memory fragment is deleted, the preset time being counted from the time when the memory fragment is added to the buffer pool.
[0010] In the embodiment, if the target timeliness value corresponding to the memory fragment is lower than the timeliness value threshold, the memory fragment is added to the buffer pool; if the memory fragment added to the buffer pool is not recalled after a preset time, the memory fragment is deleted, the preset time is counted from the time when the memory fragment is added to the buffer pool, so that the memory fragment with a low probability of being recalled subsequently can be deleted, thereby reducing the waste of storage resources.
[0011] In a possible implementation, the timeliness decay function includes a decay parameter used to determine the target timeliness value corresponding to the memory fragment, and the method further includes: if the memory fragment added to the buffer pool is recalled within a preset time, updating the decay parameter in the timeliness decay function corresponding to the memory category to which the memory fragment belongs.
[0012] The embodiment can improve the accuracy of determining the target timeliness value by updating the decay parameter in the timeliness decay function corresponding to the memory category to which the memory fragment belongs if the memory fragment added to the buffer pool is recalled within a preset time, thereby facilitating the improvement of the accuracy of memory recall.
[0013] In a possible implementation, the first recall evaluation information includes a target importance value, and the target importance value corresponding to the memory fragment is determined based on the memory type corresponding to the memory fragment, the calling frequency of the memory fragment, the feedback label of the memory fragment by the user, and the initial importance value of the memory fragment.
[0014] In the embodiment, the target importance value corresponding to the memory fragment is determined based on the memory type corresponding to the memory fragment, the calling frequency of the memory fragment, the feedback label of the memory fragment by the user, and the initial importance value of the memory fragment, so that the importance value can be comprehensively measured from multiple aspects, thereby improving the accuracy of the obtained importance value and facilitating the improvement of the accuracy of memory recall.
[0015] In a possible implementation, the first recall evaluation information includes a target timeliness value and a target importance value, and the target memory fragment is recalled from the plurality of memory fragments based on the first recall evaluation information corresponding to each of the plurality of memory fragments, including: for any memory fragment in the plurality of memory fragments, fusing the target timeliness value and the target importance value corresponding to the memory fragment to obtain a comprehensive evaluation value corresponding to the memory fragment; and recalling the target memory fragment from the plurality of memory fragments based on the comprehensive evaluation value corresponding to each of the plurality of memory fragments.
[0016] The embodiment fuses the target timeliness value and the target importance value corresponding to the memory fragment to obtain a comprehensive evaluation value corresponding to the memory fragment for any memory fragment in the plurality of memory fragments, recalls the target memory fragment from the plurality of memory fragments based on the comprehensive evaluation value corresponding to each of the plurality of memory fragments, and thus the memory can be recalled in combination with timeliness and importance, thereby improving the accuracy of memory recall.
[0017] In a possible implementation, the plurality of memory fragments related to the user and stored in advance are obtained by receiving the input text of the user and obtaining the plurality of memory fragments related to the user and stored in advance based on the input text. The target timeliness value and the target importance value corresponding to the memory fragment are fused to obtain a comprehensive evaluation value corresponding to the memory fragment, including determining the similarity between the memory fragment and the input text, and fusing the similarity, the target timeliness value and the target importance value corresponding to the memory fragment to obtain the comprehensive evaluation value corresponding to the memory fragment.
[0018] In the embodiment, the similarity between the memory fragment and the input text is determined, and the similarity, the target timeliness value and the target importance value corresponding to the memory fragment are fused to obtain the comprehensive evaluation value corresponding to the memory fragment. Since the similarity is also combined to determine the comprehensive evaluation value, the accuracy of the obtained comprehensive evaluation value can be further improved, and the accuracy of memory recall can be improved.
[0019] In a second aspect, the embodiment of the present application provides a task processing method, including: in response to a task processing instruction, obtaining a plurality of memory fragments related to a user and stored in advance, the memory fragments including content in historical text input by the user; for any memory fragment in the plurality of memory fragments, determining a memory type to which the memory fragment belongs, and determining first recall evaluation information corresponding to the memory fragment based on the memory type corresponding to the memory fragment, the first recall evaluation information including at least one of a target timeliness value and a target importance value, wherein the target timeliness value is determined based on a timeliness decay function corresponding to a memory category to which the memory fragment belongs and a timestamp corresponding to the memory fragment, and the target importance value is obtained according to the memory type corresponding to the memory fragment; recalling a target memory fragment from the plurality of memory fragments based on the first recall evaluation information corresponding to each of the plurality of memory fragments; and processing a task based on the input text and the target memory fragment.
[0020] In this embodiment, in response to a task processing instruction, multiple pre-stored user-related memory fragments are obtained. For any memory fragment among the multiple memory fragments, the memory type to which the memory fragment belongs is determined, and a first recall evaluation information corresponding to the memory fragment is determined based on the memory type corresponding to the memory fragment. The first recall evaluation information includes at least one of a target timeliness value and a target importance value. The target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory fragment belongs and the timestamp corresponding to the memory fragment, and the target importance value is obtained according to the memory type corresponding to the memory fragment. Based on the first recall evaluation information corresponding to each of the multiple memory fragments, the target memory fragment is recalled from the multiple memory fragments. The task is processed based on the input text and the target memory fragment, which can improve the efficiency of task processing.
[0021] Thirdly, embodiments of this application propose an apparatus including functional modules for implementing the method as described in the first aspect or the method as described in the second aspect.
[0022] Fourthly, embodiments of this application provide an electronic device, including a processor and a memory, wherein: the memory is used to store computer programs; and the processor is used to execute the programs stored in the memory to implement the above-described method.
[0023] Fifthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described method. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating a memory recall method provided in an embodiment of this application.
[0025] Figure 2 This is a schematic diagram illustrating a memory preprocessing and storage method according to an embodiment of this application.
[0026] Figure 3 This is a schematic diagram illustrating large model memory recall in an embodiment of this application.
[0027] Figure 4 This is a schematic diagram illustrating memory dynamic optimization in an embodiment of this application.
[0028] Figure 5 This is a flowchart illustrating a task processing method according to an embodiment of this application.
[0029] Figure 6 This is a schematic diagram of the structure of a memory recall device provided in an embodiment of this application.
[0030] Figure 7This is a schematic diagram of the structure of a task processing device provided in an embodiment of this application.
[0031] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0032] To make the technical problems, technical solutions, and beneficial effects solved by this application clearer, the following detailed description is provided in conjunction with embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0033] In related technologies, natural language processing and deep learning-related tasks, such as dialogue, knowledge question answering, and intelligent decision-making, can be combined with memory retrieval to assist task processing. Memory retrieval can be used to select some memory fragments from the user's memory fragments (such as text content that the user has previously entered) to assist task processing.
[0034] However, in related technologies, memory fragments are mainly filtered based on the similarity between the text input by the user and the memory fragments. But after long-term research by the inventors, it was found that the memory recall results are not accurate, which in turn affects the accuracy of task processing.
[0035] Specifically, memory retrieval techniques primarily rely on vector database retrieval and knowledge graph retrieval. Vector database retrieval, for example, utilizes the Retrieval-Augmented Generation (RAG) framework. Vector database retrieval converts various types of information into vector form for storage, and by calculating the similarity between vectors, it quickly retrieves semantically similar memory fragments, achieving efficient information retrieval. Knowledge graph retrieval uses structured "entity-relationship-attribute" triples to store knowledge, providing the model with rich semantic associations and logical reasoning capabilities, helping the model understand complex knowledge systems and achieve multi-hop retrieval. However, both methods have the following limitations: 1. Insufficient consideration of memory timeliness: Traditional methods lack management of the time dimension of memory fragments. When memories are updated (such as changes in user personal information or shifts in interests), the model is prone to recalling outdated memories, leading to "memory illusions." In addition, the value and relevance of some memories will change over time. If the timeliness of memories is ignored, the recall of outdated memories will affect the output of the large model.
[0036] 2. Lack of an Importance Assessment System: There is a lack of a precise and comprehensive assessment system for the importance of information remembered by users, making it impossible to distinguish the degree of criticality of memories. In complex multi-turn dialogue scenarios, key needs and core issues repeatedly mentioned by users should be considered important memories and prioritized for recall. Existing recall methods cannot distinguish importance, causing large models to fail to fully utilize important memories when generating answers, thus reducing the quality and relevance of the responses.
[0037] 3. Limited Dimensions in Memory Retrieval: Traditional methods rely on semantic similarity for memory retrieval, resulting in a single evaluation dimension. This ignores the differences in the timeliness and importance of memories, failing to establish a unified mechanism that simultaneously considers memory similarity, timeliness, and importance. Consequently, in practical applications, it is impossible to consider timeliness and importance during the memory retrieval process, making it difficult to meet the refined requirements of complex tasks for memory retrieval.
[0038] In view of this, embodiments of this application propose a memory retrieval method, a task processing method, an electronic device, and a storage medium, which can improve the accuracy of memory retrieval and thus improve the accuracy of task processing.
[0039] The memory retrieval method will be explained below.
[0040] Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating a memory recall method provided in one embodiment of this application. Figure 1 The method shown can be applied to electronic devices. Electronic devices can include servers behind terminals. Terminals can be smartphones, tablets, laptops, desktop computers, smart TVs, smart home devices, in-vehicle terminals (e.g., vehicle infotainment systems), etc., without specific limitations. Servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Figure 1 The methods shown may include: S110. Obtain multiple pre-stored memory fragments related to the user, including content from the user's input history text.
[0041] In this embodiment, the memory fragment can be a long-term memory fragment or a short-term memory fragment. Historical text can be text already entered in the dialogue, such as a dialogue between a user and a model deployed on an electronic device. Long-term memory fragments can be memory fragments from historical dialogues, while short-term memory fragments can be memory fragments from text already entered in the current dialogue. The dialogue in this embodiment can be a dialogue with a large model.
[0042] S120. For any memory segment among multiple memory segments, determine the memory type to which the memory segment belongs, and determine the first recall evaluation information corresponding to the memory segment based on the memory type corresponding to the memory segment. The first recall evaluation information includes at least one of a target timeliness value and a target importance value. The target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory segment belongs and the timestamp corresponding to the memory segment. The target importance value is obtained according to the memory type corresponding to the memory segment.
[0043] The memory type can be pre-defined, such as personal information, personal preferences, emotional memories, procedural memories, etc., without limitation. Optionally, the memory type of the memory fragment can be identified through a model that interacts with the user, or the memory type can be identified through another trained model, without limitation. The first recall evaluation information can be evaluation information used to assess whether to recall the memory fragment. In this embodiment, the first recall evaluation information includes at least one of a target timeliness value and a target importance value. The target timeliness value can represent the timeliness of the memory fragment, and the target importance value can represent the importance of the memory fragment. In this embodiment, both the target importance value and the target timeliness value are related to the memory type. Specifically, the target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory fragment belongs and the timestamp corresponding to the memory fragment. The timestamp corresponding to the memory fragment can be the time when the user inputs the memory fragment, the time involved in the memory fragment, or the time when the memory fragment is recalled, etc., without limitation. In this embodiment, the time decay function corresponding to different memory types can be different. This is beneficial for screening different types of memories in different ways, thereby distinguishing the importance of different memory types and improving the accuracy of memory recall.
[0044] S130. Based on the first recall evaluation information corresponding to each of the multiple memory segments, recall the target memory segment from the multiple memory segments.
[0045] The target memory fragment can be some or all of multiple memory fragments. The memory retrieval in this embodiment can filter out the target memory fragment from the existing memory fragments.
[0046] In this embodiment, multiple pre-stored user-related memory fragments are acquired, including content from historical text input by the user. For any memory fragment among the multiple memory fragments, the memory type to which the memory fragment belongs is determined, and first recall evaluation information corresponding to the memory fragment is determined based on the memory type. The first recall evaluation information includes at least one of a target timeliness value and a target importance value. The target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory fragment belongs and the timestamp corresponding to the memory fragment. Different memory types correspond to different timeliness decay functions. The target importance value is obtained according to the memory type corresponding to the memory fragment. Based on the first recall evaluation information corresponding to each of the multiple memory fragments, the target memory fragment is recalled from the multiple memory fragments. This allows at least one of the target timeliness value and target importance value to be determined according to the memory type of the memory fragment, thereby utilizing timeliness and importance for memory recall, which can improve the accuracy of memory fragment recall.
[0047] The following explains how to determine the timeliness value of the target.
[0048] In one possible implementation, the first recall assessment information includes a target timeliness value. The first recall assessment information corresponding to a memory fragment is determined based on the memory type corresponding to that fragment, including: Obtain the current time, which is the time when multiple pre-stored user-related memory fragments are retrieved; determine the difference between the current time and the timestamp corresponding to the memory fragment to obtain the target time difference; substitute the time difference into the time decay function corresponding to the memory category to which the memory fragment belongs to determine the target timeliness value corresponding to the memory fragment.
[0049] In this embodiment, the time-sensitivity decay function defines a mapping relationship between the time difference and the timeliness value. This mapping relationship can be, for example, a decay parameter, and the product of the decay parameter and the target time difference can be used as the target timeliness value. Optionally, the larger the target time difference, the smaller the target timeliness value.
[0050] In this embodiment, the current time is obtained, which is the time when multiple pre-stored user-related memory fragments are acquired; the difference between the current time and the timestamp corresponding to the memory fragment is determined to obtain the target time difference; the time difference is substituted into the time decay function corresponding to the memory category to which the memory fragment belongs to determine the target timeliness value corresponding to the memory fragment. Since the time of acquiring multiple pre-stored user-related memory fragments is also taken into account, the accuracy of the determined target timeliness value can be improved, thereby improving the accuracy of memory recall.
[0051] In another possible implementation, the memory fragments can be sorted according to their respective timestamps, with earlier timestamps having lower timeliness values.
[0052] In one possible implementation, the method also includes: If the target timeliness value corresponding to the memory fragment is lower than the timeliness value threshold, the memory fragment is added to the buffer pool; if the memory fragments added to the buffer pool are not recalled after a preset time, the memory fragments are deleted. The preset time is calculated from the time the memory fragment is added to the buffer pool.
[0053] The buffer pool can be understood as a storage space for temporarily storing memory fragments. In this embodiment, if the target timeliness value corresponding to a memory fragment is lower than the timeliness threshold, the timeliness of the memory fragment is poor, and the memory fragment can be added to the buffer pool. If memory fragments added to the buffer pool are not recalled after a preset time, it indicates that the possibility of subsequent recall is also low. The preset time can be set as needed, for example, 30 days, and is not limited here.
[0054] In this embodiment, if the target timeliness value corresponding to the memory segment is lower than the timeliness value threshold, the memory segment is added to the buffer pool; if the memory segments added to the buffer pool are not recalled after a preset time, the memory segments are deleted. The preset time is calculated from the time the memory segment is added to the buffer pool. In this way, memory segments with a low probability of being recalled can be deleted, thereby reducing the waste of storage resources.
[0055] In another possible implementation, all memory segments could be preserved.
[0056] In one possible implementation, the time-degradation function includes a degradation parameter for determining the target time-degradation value corresponding to the memory segment, and the method further includes: If a memory fragment added to the buffer pool is recalled within a preset time, the decay parameter in the time decay function corresponding to the memory category to which the memory fragment belongs is updated.
[0057] In this embodiment, if a memory segment added to the buffer pool is recalled within a preset time, it indicates that the decay parameter in the function corresponding to the memory category to which the memory segment belongs is not set appropriately. Therefore, the decay parameter in the time decay function corresponding to the memory category to which the memory segment belongs can be updated.
[0058] This embodiment improves the accuracy of determining the timeliness value of the target by updating the decay parameter in the timeliness decay function corresponding to the memory category to which the memory fragment belongs if the memory fragment added to the buffer pool is recalled within a preset time. This is beneficial to improving the accuracy of memory recall.
[0059] In another possible implementation, if the memory fragment added to the buffer pool is recalled within a preset time, the memory fragment can also be retrieved from the buffer pool.
[0060] The following explains how to determine the importance value of a target.
[0061] In one possible implementation, the first recall evaluation information includes a target importance value. The first recall evaluation information corresponding to a memory fragment is determined based on the memory type corresponding to that fragment, including: Based on the memory type corresponding to the memory fragment, the frequency of memory fragment retrieval, the user's feedback tags on the memory fragment, and the initial importance value of the memory fragment, the target importance value corresponding to the memory fragment is determined.
[0062] The "number of calls" can be understood as the number of recalls, or the number of times the memory fragment appears in the user's input dialogue; no restrictions are placed here. Feedback tags can indicate the importance of the memory fragment as reflected by the user. User feedback (such as phrases like "This is very important" or "You must remember this").
[0063] In this embodiment, optionally, a coefficient can be assigned to each memory type, a coefficient to each call frequency, and a coefficient to each feedback tag. Then, the initial importance value is multiplied by the coefficients corresponding to the memory type, call frequency, and feedback tag to obtain the target importance value. Specifically, the mapping relationships between memory type and coefficients, call frequency and coefficients, and feedback tag and coefficients are all pre-configured. Therefore, the corresponding coefficients can be determined based on the memory type corresponding to the memory fragment, the call frequency of the memory fragment, the user's feedback tag for the memory fragment, and the mapping relationships, thereby determining the target importance value.
[0064] In this embodiment, the target importance value of a memory segment is determined based on the memory type corresponding to the memory segment, the recall frequency of the memory segment, the user's feedback label on the memory segment, and the initial importance value of the memory segment. This allows for a comprehensive measurement of the importance value from multiple perspectives, thereby improving the accuracy of the obtained importance value and enhancing the accuracy of memory recall.
[0065] The following explains how to recall a target memory segment from multiple memory segments.
[0066] In one possible implementation, the first recall evaluation information includes a target timeliness value and a target importance value. Based on the first recall evaluation information corresponding to each of the multiple memory segments, the target memory segment is recalled from the multiple memory segments, including: For any memory segment among multiple memory segments, the target timeliness value and target importance value corresponding to the memory segment are fused to obtain the comprehensive evaluation value corresponding to the memory segment; based on the comprehensive evaluation values corresponding to each of the multiple memory segments, the target memory segment is recalled from the multiple memory segments.
[0067] The fusion method can be either averaging or weighted averaging, and there is no limitation on this. In this embodiment, memory fragments with a comprehensive evaluation value greater than the evaluation value threshold can be used as target memory fragments, or the K highest comprehensive evaluation values can be selected as target memory fragments in descending order, and there is no limitation on this.
[0068] This embodiment combines the target timeliness value and target importance value of any memory segment from multiple memory segments to obtain a comprehensive evaluation value for the memory segment. Based on the comprehensive evaluation values of each memory segment, the target memory segment is recalled from multiple memory segments. This combines timeliness and importance to recall memories, thereby improving the accuracy of memory recall.
[0069] Another possible approach is to recall memories based on their timeliness or importance, which can improve the efficiency of memory retrieval.
[0070] In one possible implementation, multiple pre-stored user-related memory fragments are retrieved, including: Receive text input from the user and retrieve multiple pre-stored memory fragments related to the user based on the input text; The target timeliness value and target importance value corresponding to the memory fragment are combined to obtain the comprehensive evaluation value corresponding to the memory fragment, including: Determine the similarity between the memory fragment and the input text; The similarity, timeliness, and importance of the memory fragments are combined to obtain a comprehensive evaluation value for each memory fragment.
[0071] The similarity between the memory fragment and the input text can be determined by extracting vectors from both the memory fragment and the input text separately, and then performing vector similarity matching. In this embodiment, the similarity, target timeliness value, and target importance value corresponding to the memory fragment are fused. This can be achieved by averaging or weighted averaging these values to obtain a comprehensive evaluation value. In this embodiment, the text input by the user can be understood as a task processing instruction. It should be noted that the input text can be text directly entered by the user or indirectly entered, such as text converted from the user's speech.
[0072] In this embodiment, the similarity between the memory fragment and the input text is determined; the similarity, target timeliness value, and target importance value corresponding to the memory fragment are fused to obtain the comprehensive evaluation value corresponding to the memory fragment. Since the determination of the comprehensive evaluation value is also combined with the similarity, the accuracy of the obtained comprehensive evaluation value can be further improved, which is conducive to improving the accuracy of memory recall.
[0073] In summary, this embodiment can be divided into memory preprocessing and storage, large model memory retrieval, and memory dynamic optimization, which will be described in detail below.
[0074] Please see Figure 2 , Figure 2 This diagram illustrates a memory preprocessing and storage method according to an embodiment of this application. The memory preprocessing and storage steps involve constructing a user's personal long-term memory knowledge base, adding timestamps, configuring a time-lapse function, and assigning an initial importance score. Specifically, it includes the following steps: like Figure 2 The diagram may include: S210, Memory content filtering.
[0075] In this embodiment, a large model is used to remove information from historical conversations that is irrelevant to personal memory, such as deleting objective facts like "Why is the sky blue?" or "What's the weather like today?" Only the parts related to personal memory are retained, such as user information and preferences, to avoid redundancy in memory information that could affect the speed and effectiveness of memory retrieval.
[0076] S220, memory-based word segmentation and vectorized encoding.
[0077] In this embodiment, the selected memory fragments are segmented and vectorized. A suitable segmenter is used to convert the memory text into tokens, a pre-trained model is used to convert the tokens into vectors, and dimensionality reduction techniques such as PCA are employed to reduce the vector dimensions. Finally, an index is created in the memory vector database. This facilitates subsequent recalls.
[0078] S230, Memory fragment with timestamp.
[0079] It's important to note that the timestamp here can be absolute time. Absolute time refers to a specific date and time. For example, if a user says, "I booked a flight to Beijing for 10:00 AM on June 19, 2025," the absolute time obtained is 10:00 AM on June 19, 2025. Relative time refers to the relative position or order of times and needs to be converted to absolute time for storage. For example, if a user then says, "Because I also went there on that day ten years ago," we can obtain that the user also went to Beijing on June 19, 2015. In another possible implementation, the input time of "I booked a flight to Beijing for 10:00 AM on June 19, 2025" can also be used as the timestamp; there are no restrictions on this.
[0080] S240, aging decay function and parameter configuration.
[0081] The large model categorizes memory content into different types based on its semantic meaning. Different memory categories can be assigned different time-decrease functions (such as linear, exponential, or power-law functions). and attenuation parameters This results in different types of memories having different retention periods.
[0082] S250, Initial Importance Score.
[0083] In this embodiment, expert rules and historical interaction frequency can be used to score the initial importance of memory fragments. Based on the Named Entity Recognition (NER) results, key entities such as user identity, task objectives, and key instructions are assigned higher importance. For example, entities such as the user's name, account information, and explicit task requirements (such as "booking a flight") will have higher importance weights than ordinary descriptive content. In addition, the number of times the memory content is called in historical dialogues or tasks is counted. The more times it is called, the more important the memory content is in past interactions, and the higher the initial importance score is accordingly.
[0084] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating large-scale model memory retrieval in an embodiment of this application. Large-scale model memory retrieval refers to the process where, based on a user's query, the large model generates a memory query statement, calls the user's long-term memory database, calculates similarity, timeliness, and importance scores, performs a comprehensive weighted calculation, and, combined with a set threshold, returns the TOP-K memory fragments, which are then output to the large model. The large model then generates an answer based on the recalled memories. For example... Figure 3 The diagram may include: S310, Generate a memorized query statement.
[0085] In this embodiment, based on the user's query (e.g., a text query entered by the user), the large model analyzes and generates relevant statements for the memory query, and calls the user's long-term memory.
[0086] S320, Similarity score calculation.
[0087] In this embodiment, the content retrieved from memory is vectorized and encoded. and through vector database Perform semantic similarity retrieval to obtain matching memories and their similarity scores. The similarity score can be referred to the similarity description in the above embodiment.
[0088] S330, Calculation of Timeliness Score.
[0089] In this embodiment, the timeliness score of the memory segment is calculated in real time. Taking the exponential decay type as an example, its timeliness score... .in, This is the timeliness score of the memory. It is the decay parameter, depending on the memory type. Configure according to different requirements. It is the difference between the current time and the timestamp in memory. The timeliness score is also known as the timeliness value.
[0090] S340, Importance score calculation.
[0091] In this embodiment, importance assessment is based on multiple dimensions. Combining the semantic content of the memory itself (e.g., memory type), initial importance score, recall frequency (number of recalls in the past 30 days), and user feedback (phrases such as "This is very important" or "You must remember this"), a large-scale model is used to assess the importance of the memory, and its importance score is determined. The calculation formula is: Importance score is also known as importance value.
[0092] S350, a multi-dimensional recall strategy based on similarity, timeliness, and importance.
[0093] In this embodiment, the final score is based on three dimensions: similarity, timeliness, and importance. .in , , The weights for similarity, timeliness, and importance are respectively used, and the PPO algorithm is used to iteratively update the results based on the task performance.
[0094] S360, Output the memory recall results.
[0095] In this embodiment, the overall score (overall evaluation value) is... Higher than the set threshold The recall is triggered when the memory is retrieved. The retrieved memories are returned to the Top-K memory fragments in descending order, and then input into the large model to generate a response, thus completing the recall of the large model's memories. The large model generates a response based on the retrieved memory fragments.
[0096] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating dynamic memory optimization as shown in an embodiment of this application. Dynamic memory optimization can iteratively optimize the parameters in this invention by incorporating user feedback on the effectiveness of the large model's generated answers, including decay parameters, importance assessment parameters, and weight parameters (weight parameters that are fused to obtain a comprehensive evaluation value). Figure 4 The diagram may include: S410, attenuation parameter adaptive tuning.
[0097] In this embodiment, memories with a (comprehensive evaluation value) below a set forgetting threshold are placed in a buffer pool and marked as pending forgetting. If not recalled within 30 days, the memory is deleted (30-day cache). If a memory is recalled during the pending forgetting period, it indicates that the memory type decays too quickly; the time interval is dynamically updated, and the decay parameters are adjusted. Adjustments will be made.
[0098] S420, Importance Assessment Module Optimization.
[0099] In this embodiment, a reinforcement learning feedback mechanism is introduced to fine-tune the importance assessment model based on the response performance of the large model after memory retrieval (such as dialogue coherence and response correctness), thereby dynamically optimizing the importance assessment module and improving the accuracy of memory retrieval of the large model under complex performance conditions.
[0100] S430, weight parameter update and optimization.
[0101] In this embodiment, after each round of interaction, a reward function is designed based on memory recall accuracy, task completion rate, efficiency penalty, and redundancy penalty. The PPO algorithm is used to weight similarity, timeliness, and importance. , , Update and optimize.
[0102] In summary, when a user inputs a query, the large model generates a memory-based recall query based on the context. The query vector is generated by the vector encoder. Semantic similarity is calculated for all memory fragments in the memory vector database. Simultaneously calculate the timeliness score for each segment. Importance weight Overall score Based on a set threshold, the Top-K segments are sorted and selected; the search results and the query are concatenated and input into the large model to generate answers; user feedback is fed into the memory dynamic optimization module to update the parameters and weights of the corresponding memories.
[0103] The technical effects of this embodiment may include, but are not limited to, the following: 1. Improve memory recall accuracy: Compared to traditional memory retrieval methods based solely on semantic similarity, this invention prioritizes recent and important memories, avoiding interference from distant and unimportant memories.
[0104] 2. Enhance memory recall adaptability: By configuring different time decay functions and importance for different categories of memory, it is possible to adapt to the decay characteristics and importance features of different categories of memory.
[0105] 3. Optimize long-term memory management: Setting the memory decay function and the historical memory cache period can extend the retrieval cycle of important memories, while forgetting low-frequency, unimportant, redundant memories, reducing memory storage overhead, and improving memory recall rate.
[0106] 4. Reduce manual parameter tuning costs By simply setting importance rules and decay function categories, this embodiment can adaptively optimize and adjust parameters based on user feedback, reducing manual parameter tuning costs and improving the quality of memory recall.
[0107] Please see Figure 5 , Figure 5 This is a flowchart illustrating a task processing method according to an embodiment of this application. Figure 5 The methods shown may include: S510, in response to a task processing instruction, retrieves multiple pre-stored user-related memory fragments, including content from the user's input history text.
[0108] The task processing instructions can be text entered by the user.
[0109] S520. For any memory segment among multiple memory segments, determine the memory type to which the memory segment belongs, and determine the first recall evaluation information corresponding to the memory segment based on the memory type corresponding to the memory segment. The first recall evaluation information includes at least one of a target timeliness value and a target importance value. The target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory segment belongs and the timestamp corresponding to the memory segment. The target importance value is obtained according to the memory type corresponding to the memory segment.
[0110] S530: Based on the first recall evaluation information corresponding to each of the multiple memory segments, recall the target memory segment from the multiple memory segments.
[0111] The descriptions of S510-S530 can be found in S110-S120, and will not be repeated here.
[0112] S540, Input-based text and target memory fragment processing task.
[0113] In this embodiment, the tasks to be processed may include, but are not limited to, dialogue, knowledge-based question answering, and intelligent decision-making.
[0114] In one possible implementation, the timestamp is task-related, and different tasks may use different timestamps. For example, the timestamp for a dialogue is the timestamp of the input text, while the timestamp for intelligent decision-making can be the timestamp carried by the input text; there are no restrictions on this.
[0115] In this embodiment, in response to a task processing instruction, multiple pre-stored user-related memory fragments are obtained. For any memory fragment among the multiple memory fragments, the memory type to which the memory fragment belongs is determined, and a first recall evaluation information corresponding to the memory fragment is determined based on the memory type corresponding to the memory fragment. The first recall evaluation information includes at least one of a target timeliness value and a target importance value. The target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory fragment belongs and the timestamp corresponding to the memory fragment, and the target importance value is obtained according to the memory type corresponding to the memory fragment. Based on the first recall evaluation information corresponding to each of the multiple memory fragments, the target memory fragment is recalled from the multiple memory fragments. The task is processed based on the input text and the target memory fragment, which can improve the efficiency of task processing.
[0116] The method embodiments have been described above; the product embodiments are described below.
[0117] Please see Figure 6 , Figure 6 This is a schematic diagram of a memory recall device provided in one embodiment of this application. Figure 6 The illustrated device can be applied to electronic devices, and the device may include an acquisition module 610, a recall evaluation module 620, and a recall module 630, wherein: The acquisition module 610 is used to acquire multiple pre-stored memory fragments related to the user, including content from historical text input by the user; the recall evaluation module 620 is used to determine the memory type to which any memory fragment belongs for any memory fragment among the multiple memory fragments, and to determine the first recall evaluation information corresponding to the memory fragment based on the memory type corresponding to the memory fragment. The first recall evaluation information includes at least one of a target timeliness value and a target importance value, wherein the target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory fragment belongs and the timestamp corresponding to the memory fragment, and the target importance value is obtained according to the memory type corresponding to the memory fragment; the recall module 630 is used to recall the target memory fragment from the multiple memory fragments based on the first recall evaluation information corresponding to each of the multiple memory fragments.
[0118] In one possible implementation, the first recall evaluation information includes a target timeliness value. When the recall evaluation module 620 determines the first recall evaluation information corresponding to the memory fragment based on the memory type corresponding to the memory fragment, it is used to: obtain the current time, which is the time when multiple pre-stored user-related memory fragments are obtained; determine the difference between the current time and the timestamp corresponding to the memory fragment to obtain the target time difference; and substitute the time difference into the timeliness decay function corresponding to the memory category to which the memory fragment belongs to determine the target timeliness value corresponding to the memory fragment.
[0119] In one possible implementation, the recall module 630 is further configured to: add the memory fragment to the buffer pool if the target timeliness value corresponding to the memory fragment is lower than the timeliness value threshold; and delete the memory fragment if none of the memory fragments added to the buffer pool have been recalled after a preset time, wherein the preset time is calculated from the time the memory fragment was added to the buffer pool.
[0120] In one possible implementation, the time-depletion function includes a decay parameter for determining the target time-depletion value corresponding to the memory segment. The recall module 630 is also used to update the decay parameter in the time-depletion function corresponding to the memory category to which the memory segment belongs if the memory segment added to the buffer pool is recalled within a preset time.
[0121] In one possible implementation, the first recall evaluation information includes a target importance value. When the recall evaluation module 620 determines the first recall evaluation information corresponding to the memory fragment based on the memory type corresponding to the memory fragment, it is used to: determine the target importance value corresponding to the memory fragment based on the memory type corresponding to the memory fragment, the recall frequency of the memory fragment, the user's feedback label on the memory fragment, and the initial importance value of the memory fragment.
[0122] In one possible implementation, the first recall evaluation information includes a target timeliness value and a target importance value. When recalling a target memory segment from multiple memory segments based on the first recall evaluation information corresponding to each of the multiple memory segments, the recall module 630 is used to: for any memory segment among the multiple memory segments, fuse the target timeliness value and the target importance value corresponding to the memory segment to obtain a comprehensive evaluation value corresponding to the memory segment; and recall the target memory segment from the multiple memory segments based on the comprehensive evaluation value corresponding to each of the multiple memory segments.
[0123] In one possible implementation, when the acquisition module 610 acquires multiple pre-stored user-related memory fragments, it is used to: receive text input by the user and acquire multiple pre-stored user-related memory fragments based on the input text; when the recall module 630 fuses the target timeliness value and target importance value corresponding to the memory fragment to obtain a comprehensive evaluation value corresponding to the memory fragment, it is used to: determine the similarity between the memory fragment and the input text; fuse the similarity value, target timeliness value and target importance value corresponding to the memory fragment to obtain a comprehensive evaluation value corresponding to the memory fragment.
[0124] Please see Figure 7 , Figure 7 This is a schematic diagram of a task processing device provided in one embodiment of this application. Figure 7 The illustrated device can be applied to an electronic device, and the device may include an acquisition module 610, a recall evaluation module 620, a recall module 630, and a task processing module 640, wherein: The acquisition module 610 is used to acquire multiple pre-stored user-related memory fragments in response to a task processing instruction. The memory fragments include content from historical text input by the user. The recall evaluation module 620 is used to determine the memory type to which any memory fragment belongs for any memory fragment among the multiple memory fragments, and to determine the first recall evaluation information corresponding to the memory fragment based on the memory type corresponding to the memory fragment. The first recall evaluation information includes at least one of a target timeliness value and a target importance value. The target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory fragment belongs and the timestamp corresponding to the memory fragment. The target importance value is obtained according to the memory type corresponding to the memory fragment. The recall module 630 is used to recall the target memory fragment from the multiple memory fragments based on the first recall evaluation information corresponding to each of the multiple memory fragments. The task processing module 640 is used to process the task based on the input text and the target memory fragment.
[0125] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this application, the coupling between modules can be electrical. Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0126] This application also provides an electronic device 80, please refer to... Figure 8 The device includes a processor 810 and a memory 820. The memory 810 stores computer programs, and the processor 820 executes the programs stored in the memory 810 to implement the memory retrieval method described in any embodiment of this application. The electronic device 80 may be, for example, a vehicle, an in-vehicle terminal, or a server.
[0127] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the memory retrieval method described in any embodiment of this application.
[0128] In this application, unless otherwise expressly defined, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0129] The terms “first,” “second,” “third,” “fourth,” etc., in this application (if any) are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. “Multiple” means no fewer than two.
[0130] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this application generally indicates that the preceding and following related objects have an "or" relationship. "Multiple" refers to no fewer than two.
[0131] Unless otherwise specified, all steps in this application may be performed sequentially or randomly. For example, if a method includes steps A and B, it means that the method may include steps A and B performed sequentially, or it may include steps B and A performed sequentially. For example, if a method may also include step C, it means that step C may be added to the method in any order. For example, the method may include steps A, B, and C, or it may include steps A, C, and B, or it may include steps C, A, and B, etc.
[0132] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A memory retrieval method, characterized in that, include: Retrieve multiple pre-stored user-related memory fragments, the memory fragments including content from the user's input history text; For any memory segment among the plurality of memory segments, the memory type to which the memory segment belongs is determined, and the first recall evaluation information corresponding to the memory segment is determined based on the memory type corresponding to the memory segment. The first recall evaluation information includes at least one of a target timeliness value and a target importance value, wherein the target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory segment belongs and the timestamp corresponding to the memory segment, and the target importance value is obtained according to the memory type corresponding to the memory segment. Based on the first recall evaluation information corresponding to each of the plurality of memory segments, the target memory segment is recalled from the plurality of memory segments.
2. The method according to claim 1, characterized in that, The first recall assessment information includes the target timeliness value, and the step of determining the first recall assessment information corresponding to the memory fragment based on the memory type corresponding to the memory fragment includes: Obtain the current time, which is the time when multiple pre-stored user-related memory fragments are retrieved; Determine the difference between the current time and the timestamp corresponding to the memory segment to obtain the target time difference; Substitute the time difference into the time decay function corresponding to the memory category to which the memory segment belongs to determine the target timeliness value corresponding to the memory segment.
3. The method according to claim 1, characterized in that, The method further includes: If the target timeliness value corresponding to the memory segment is lower than the timeliness value threshold, then the memory segment is added to the buffer pool; If the memory fragment added to the buffer pool is not recalled after a preset time, the memory fragment is deleted. The preset time is calculated from the time the memory fragment was added to the buffer pool.
4. The method according to claim 3, characterized in that, The time-depreciation function includes a decay parameter for determining the target time-depreciation value corresponding to the memory segment, and the method further includes: If the memory fragment added to the buffer pool is recalled within the preset time, the decay parameter in the time decay function corresponding to the memory category to which the memory fragment belongs is updated.
5. The method according to claim 1, characterized in that, The first recall assessment information includes the target importance value, and the step of determining the first recall assessment information corresponding to the memory fragment based on the memory type corresponding to the memory fragment includes: Based on the memory type corresponding to the memory fragment, the recall frequency of the memory fragment, the user's feedback tags on the memory fragment, and the initial importance value of the memory fragment, the target importance value corresponding to the memory fragment is determined.
6. The method according to any one of claims 1-5, characterized in that, The first recall assessment information includes a target timeliness value and a target importance value. The step of recalling the target memory segment from the plurality of memory segments based on the first recall assessment information corresponding to each of the plurality of memory segments includes: For any memory segment among the plurality of memory segments, the target timeliness value and target importance value corresponding to the memory segment are fused to obtain the comprehensive evaluation value corresponding to the memory segment; Based on the comprehensive evaluation value corresponding to each of the multiple memory segments, the target memory segment is recalled from the multiple memory segments.
7. The method according to claim 6, characterized in that, The process of acquiring multiple pre-stored user-related memory fragments includes: Receive text input from the user, and obtain multiple pre-stored memory fragments related to the user based on the input text; The step of fusing the target timeliness value and target importance value corresponding to the memory segment to obtain the comprehensive evaluation value corresponding to the memory segment includes: Determine the similarity between the memory fragment and the input text; The similarity, timeliness, and importance values of the memory fragments are combined to obtain a comprehensive evaluation value for the memory fragments.
8. A task processing method, characterized in that, include: In response to a task processing instruction, multiple pre-stored user-related memory fragments are retrieved, the memory fragments including content from the user's input history text; For any memory segment among the plurality of memory segments, the memory type to which the memory segment belongs is determined, and the first recall evaluation information corresponding to the memory segment is determined based on the memory type corresponding to the memory segment. The first recall evaluation information includes at least one of a target timeliness value and a target importance value, wherein the target timeliness value is determined based on the timeliness decay function corresponding to the memory category to which the memory segment belongs and the timestamp corresponding to the memory segment, and the target importance value is obtained according to the memory type corresponding to the memory segment. Based on the first recall evaluation information corresponding to each of the plurality of memory segments, the target memory segment is recalled from the plurality of memory segments; The task is to process the input text and the target memory fragment.
9. An electronic device, characterized in that, Includes processor and memory, of which: Memory, used to store computer programs; A processor for executing a program stored in memory to implement the method as described in any one of claims 1-7 or the method as described in claim 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-7 or the method as described in claim 8.
Citation Information
Patent Citations
Question and answer matching method and device, electronic equipment and storage medium
CN116955559A
Recalled content determination method, recalled content determination device and electronic equipment
CN117708283A
Information recall method and device, electronic equipment and storage medium
CN117851662A