Memory processing method, device, apparatus, storage medium, and program product
By identifying query intent types and configuring memory type weights, and combining semantic similarity and co-activation associations, the agent's memory recall is optimized, solving the problems of mixed memory types and static weights, and improving the accuracy and consistency of memory recall.
Patent Information
- Application Number
- CN202610163031.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-05
- Publication Date
- 2026-05-01
- Estimated Expiration
- 2046-02-05
AI Technical Summary
Existing intelligent agent memory retrieval schemes suffer from mixed memory types, static weights, and missing associations, resulting in low accuracy of retrieval results, contextual pollution, and limited reasoning ability.
By identifying query intent types, configuring target weights for various memory types, and combining semantic similarity and semantic strength scores, co-activation associations are established to optimize the recall process of memory data.
It improves the accuracy of memory retrieval, avoids retrieval noise and context pollution, enhances the reasoning ability and response consistency of the agent, and improves the quality of personalized services.
Smart Images

Figure CN121658621B_ABST
Abstract
Description
Memory processing methods, devices, equipment, storage media and program products Technical Field
[0001] This application relates to the field of memory retrieval technology, and more specifically, to a memory processing method, apparatus, device, storage medium, and program product. Background Technology
[0002] With the rapid development of large language model technology, intelligent agent systems are widely used in fields such as financial advisory, medical consultation, and educational tutoring. They need to have memory recall capabilities to accurately retrieve relevant information from historical interactions in order to provide personalized and coherent services. This is the core requirement for efficient intelligent agent services.
[0003] Existing agent memory retrieval schemes mainly include vector similarity-based, keyword matching, and hybrid retrieval architectures. However, these schemes have significant drawbacks: First, mixed storage of memory types leads to low accuracy of retrieval results, contextual pollution, and high noise. Second, static weighting mechanisms cause outdated information to interfere with decision-making. Third, ignoring the relationships between memories limits reasoning ability and makes it difficult to meet the agent's needs for accurate, dynamic, and comprehensive memory retrieval. Summary of the Invention
[0004] The main purpose of this application is to provide a memory processing method, device, equipment, storage medium and program product to solve the problems of mixed memory types, static weights and missing associations in intelligent agents, thereby improving the accuracy and coherence of memory retrieval and optimizing the service experience of intelligent agents.
[0005] To achieve the above objectives, a first aspect of this application proposes a memory processing method, comprising: receiving a user's query request and identifying the query intent type of the query request, wherein the query intent type is one of factual query, personal query, operational query, and emotional query; determining a target weight configuration for multiple memory types based on the query intent type, wherein the multiple memory types include episodic memory, semantic memory, procedural memory, and emotional memory; determining a semantic similarity score for candidate memory data based on semantic similarity and the target weight configuration, and determining a comprehensive score for the candidate memory data based on the semantic similarity score and the semantic intensity score; determining an initial target memory from the candidate memory data according to the comprehensive score, and determining associated memory data of the initial target memory based on the co-activation association between memory data, and using the initial target memory and the associated memory data as target memory data; wherein the semantic intensity score refers to the storage intensity value of the memory, the storage intensity value is determined by the current memory intensity, basic importance, number of accesses, recent access time, and time decay rate, and the co-activation association is established based on the co-occurrence frequency of the memory data.
[0006] This application also provides a memory processing device, comprising: an acquisition module and a processing module; the acquisition module is configured to receive a user's query request and identify the query intent type of the query request, wherein the query intent type is one of factual query, personal query, operational query, and emotional query; the processing module is configured to determine target weight configurations for multiple memory types based on the query intent type, wherein the multiple memory types include episodic memory, semantic memory, procedural memory, and emotional memory; determine a semantic similarity score for candidate memory data based on semantic similarity and the target weight configuration, and determine a comprehensive score for candidate memory data based on the semantic similarity score and semantic intensity score; determine an initial target memory from the candidate memory data according to the comprehensive score, and determine associated memory data of the initial target memory based on the co-activation association between memory data, and use the initial target memory and the associated memory data as target memory data; wherein the semantic intensity score refers to the storage intensity value of the memory, the storage intensity value is determined by the current memory intensity, basic importance, number of accesses, recent access time, and time decay rate, and the co-activation association is established based on the co-occurrence frequency of memory data.
[0007] This application also provides an electronic device, including 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 memory processing method described above.
[0008] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the memory processing method described above.
[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the memory processing method described above.
[0010] The technical solutions provided by the embodiments of this application may include the following beneficial effects:
[0011] In this application, by determining the target weight configuration for multiple memory types based on the query intent type, and by covering episodic, semantic, procedural, and emotional memories, precise matching retrieval of memory types can be achieved. This avoids the problems of high retrieval noise and contextual pollution caused by the mixing of different types of memories, thereby improving the accuracy of retrieval results. Since the semantic strength score is dynamically calculated based on memory importance, access frequency, and time decay rate, it can highlight fresh, high-frequency, and important memory data, effectively avoiding the interference of outdated information on decision-making, making memory retrieval more aligned with actual needs. Furthermore, by establishing co-activation associations based on the co-occurrence frequency of memory data and expanding associated memory data through these relationships, it can break down memory silos, supplement associated contextual information, and improve the agent's reasoning ability and response coherence. Through the synergistic optimization of three dimensions—precise type matching, dynamic weight ranking, and supplementary associated information—precise, dynamic, and comprehensive memory retrieval can be achieved, thereby significantly improving the quality of personalized services and user experience. Attached Figure Description
[0012] The accompanying drawings, which form part of this application, are used to provide a further understanding of the application and to make other features, objects, and advantages of the application more apparent. The illustrative embodiments and descriptions of this application are used to explain the application and do not constitute an undue limitation of the application. In the drawings:
[0013] Figure 1 is one of the flowcharts of the memory processing method provided in this application;
[0014] Figure 2 is a second schematic flowchart of the memory processing method provided in this application;
[0015] Figure 3 is a schematic diagram of the memory type storage method provided in this application;
[0016] Figure 4 is a schematic diagram of the memory processing device provided by the present invention;
[0017] Figure 5 is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application.
[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0020] In this application, the terms "upper," "lower," "left," "right," "front," "rear," "top," "bottom," "inner," "outer," "middle," "vertical," "horizontal," "lateral," and "longitudinal" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are primarily for the purpose of better describing this application and its embodiments, and are not intended to limit the indicated device, element, or component to having a specific orientation, or to be constructed and operated in a specific orientation.
[0021] Furthermore, in addition to indicating location or positional relationship, some of the aforementioned terms may also have other meanings. For example, the term "above" may also be used in some cases to indicate a certain dependency or connection relationship. Those skilled in the art can understand the specific meaning of these terms in this application based on the specific circumstances.
[0022] Furthermore, the terms "installation," "setup," "equipped with," "connection," "linked," and "socketing" should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral structure; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or an internal connection between two devices, components, or parts. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0023] This application describes some exemplary embodiments for illustrative purposes. It should be understood that this application may be implemented in other ways not specifically shown in the accompanying drawings.
[0024] As shown in Figure 1, this application provides a memory processing method, which can be applied to a memory processing device. The memory processing method may include steps S101-S104:
[0025] S101. The memory processing device receives the user's query request and identifies the query intent type of the query request.
[0026] The aforementioned query intent types can be one of the following: factual query, personal query, operational query, and sentiment query. Factual queries refer to queries by users seeking objective information such as facts, knowledge, and preferences; personal queries refer to queries by users seeking information related to their personal experiences and historical interactions; operational queries refer to queries by users seeking operational guidance such as processes, methods, and steps; and sentiment queries refer to queries involving users' emotional states and expressions of feelings.
[0027] Specifically, after receiving a user's query request, the memory processing device can first perform word segmentation, keyword extraction, and semantic parsing on the query request, and then identify the query intent type of the query request through an intent classifier to determine the query intent type. The identification process can be implemented through one or more combinations of regular expression pattern matching, keyword detection, or preset intent classification rules.
[0028] For example, if a user enters "What stable financial products should I choose to save for my child's education?", the memory processing device will extract core keywords such as "stable financial products", "child" and "education funds", and combine them with preset intent classification rules to determine that the query request belongs to a personal query.
[0029] If a user enters "the relevant definitions and financial management principles of education funds", it will be considered a factual inquiry.
[0030] If a user enters "How to apply for education savings insurance on the APP", it is considered an operational query.
[0031] If a user enters "I'm worried that the side benefits of investing in education funds won't be enough, what stable investment products should I choose to save for my child's education?", it is judged as an emotional query.
[0032] The above scheme provides a clear basis for subsequent memory type weight configuration, making the retrieval direction more targeted, effectively reducing the participation of irrelevant memory data, and improving the accuracy and efficiency of memory retrieval from the source.
[0033] Optionally, the query request may include a user identifier, query content, session identifier, query intent, and constraints. The user identifier, as a unique identifier of the user, can be used to associate all of the user's historical interaction memory data, ensuring consistent and personalized services for a specific user. The query content, i.e., the question or request text entered by the user, is the core semantic basis for subsequent memory retrieval. The memory processing device will extract semantic vectors based on this text to match and recall relevant memory data. The session identifier is used to identify the context of the current session. By distinguishing different session scenarios, interference between memory data across sessions can be avoided, thus ensuring the consistency of context within a single session. The query intent is an optional field that can be used to represent the type of query intent, such as factual, personal, operational, or sentimental queries. This field can directly provide a clear basis for the subsequent weight configuration of memory types, improving the accuracy and efficiency of memory retrieval. Constraints are optional fields that include token budget, time range, and other constraint information, which can be used to limit the scope and resource consumption of memory retrieval, making the retrieval process more controllable.
[0034] Optionally, after receiving a user's query request, the memory processing device can also use a text embedding model to convert the query content in the query request into a vector representation, which can be used for subsequent semantic similarity calculation.
[0035] S102, The memory processing device determines the target weight configuration of multiple memory types based on the query intent type.
[0036] The various memory types mentioned include episodic memory, semantic memory, procedural memory, and emotional memory.
[0037] Specifically, the memory processing device pre-stores a mapping table of query intent and memory weights. This mapping table is trained based on a large amount of historical interaction data and scenario requirements. After the memory processing device completes the identification of the query intent type, it directly retrieves this mapping table and assigns corresponding target weight coefficients to the four memory types—episodic memory, semantic memory, procedural memory, and emotional memory—according to the mapping relationship. The weight coefficients range from 0 to 1, and the sum of the weight coefficients for all memory types is 1. A higher weight coefficient indicates a higher priority for that type of memory in the current retrieval. This weight configuration method makes the subsequent memory retrieval process more targeted, fundamentally improving the accuracy of memory recall.
[0038] For example, when the query intent type is identified as factual query, it means that the user's core need is to obtain objective information. At this time, the highest weight coefficient (0.5) will be configured for semantic memory, the weight coefficient of procedural memory will be configured for 0.3, and the weight coefficients of episodic memory and emotional memory will be configured for 0.1 respectively, to ensure that semantic memory data related to facts is retrieved first.
[0039] When the query intent type is identified as a personal query, it means that the user's core need is to obtain information related to their own experience. At this time, the highest weight coefficient (0.4) will be assigned to episodic memory, the weight coefficient of emotional memory will be assigned to 0.3, and the weight coefficients of semantic memory and procedural memory will be assigned to 0.2 and 0.1 respectively, to ensure that memory content related to the user's personal experience is recalled first.
[0040] When the query intent type is identified as an operational query, it means that the user's core need is to obtain the operation steps and process. At this time, the highest weight coefficient (0.5) will be configured for procedural memory, the weight coefficient of semantic memory will be configured for 0.3, and the weight coefficients of episodic memory and emotional memory will be configured for 0.1 respectively, to ensure that memory data related to the operation process is retrieved first.
[0041] When the query intent type is identified as an emotional query, it means that the user's core need is to express emotions or seek emotional responses. At this time, the highest weight coefficient (0.5) will be assigned to emotional memory, the weight coefficient of plot memory will be assigned to 0.3, and the weight coefficients of semantic memory and procedural memory will be assigned to 0.1 respectively, so as to ensure that the memory content related to the user's emotions is recalled first.
[0042] When the specific query intent is not clearly identified, the default query weight configuration can be used, with semantic memory weighting at 0.35, episodic memory weighting at 0.25, procedural memory weighting at 0.2, and emotional memory weighting at 0.2, in order to balance the retrieval priority of various types of memory and adapt to the memory retrieval needs in general scenarios.
[0043] S103. The memory processing device determines the semantic similarity score of the candidate memory data based on the semantic similarity and the target weight configuration, and determines the comprehensive score of the candidate memory data based on the semantic similarity score and the semantic strength score.
[0044] The semantic strength score refers to the storage strength value of the memory, which is determined by the current memory strength, basic importance, number of accesses, recent access time, and time decay rate.
[0045] Optionally, the memory processing device determines the semantic similarity score of the candidate memory data based on the semantic similarity and the target weight configuration, including: retrieving the N candidate memory data with the highest similarity from the storage area of each memory type based on the semantic similarity, with one storage area corresponding to N candidate memory data; and multiplying all the retrieved candidate memory data by the weight of the corresponding memory type according to the target weight configuration to obtain the semantic similarity score.
[0046] Specifically, the memory processing device can hierarchically search the query vector of the query content across four storage areas: episodic memory, semantic memory, procedural memory, and emotional memory, and perform semantic similarity searches to obtain the Top-N candidate memory data most similar to the query vector under each memory type. Next, the memory processing device can multiply the original semantic similarity score of each candidate memory data by the target weight configuration for the corresponding memory type to obtain a hierarchically weighted semantic similarity score.
[0047] For example, in a factual query, the weight of semantic memory is 0.5, the original similarity score of a certain semantic memory is 0.8, and the weighted semantic similarity score is 0.8 × 0.5 = 0.4; while in the same query, the weight of plot memory is 0.1, the original similarity score of a certain plot memory is 0.7, and the weighted semantic similarity score is 0.7 × 0.1 = 0.07.
[0048] After completing the weighted calculation, the memory processing device can further combine the semantic strength score of each candidate memory data to calculate a comprehensive score. The comprehensive score is calculated as follows:
[0049] Overall score = α × semantic similarity score + β × semantic strength score
[0050] Here, α and β are preset weighting coefficients used to balance the contribution of semantic similarity and memory strength in the overall score. For example, α=0.6 and β=0.4 can be set.
[0051] After the calculation is completed, the memory processing device can sort all candidate memory data in descending order according to the comprehensive score. The higher the score, the higher the priority of the memory to be selected, thereby ensuring that it not only meets the semantic requirements of the current query, but also takes into account the dynamic importance of the memory itself, and ultimately improves the accuracy and effectiveness of memory retrieval.
[0052] This calculation method ensures that memories with high semantic similarity are prioritized, while also taking into account the dynamic importance of the memories themselves. It avoids recall bias caused by relying solely on static similarity, allowing the comprehensive score to more fully reflect the matching value between the memory and the current query.
[0053] Optionally, the semantic strength score refers to the storage strength value of the memory, and the formula for calculating the storage strength value is:
[0054] After decay, memory strength = current memory strength × (1 - time decay rate)^number of days since the last access;
[0055] Storage strength value = max(base importance, memory strength after decay);
[0056] The basic importance is a preset fixed value. This basic importance ensures that memories are not completely forgotten.
[0057] S104. The memory processing device determines an initial target memory from the candidate memory data according to the comprehensive score, determines the associated memory data of the initial target memory based on the co-activation association between memory data, and uses the initial target memory and the associated memory data as target memory data.
[0058] The co-activation association is established based on the co-occurrence frequency of memory data.
[0059] Specifically, after sorting all candidate memory data according to the comprehensive score, the memory processing device first selects the top-ranked memory as the initial target memory, and then queries the associated memory data of these initial target memories based on the co-activation association between memory data to obtain associated memory data with high association strength.
[0060] For example, when a user queries "how to adjust the amount of education fund fixed investment", the initial target memory is "APP fixed investment adjustment steps". The memory processing device will find the associated memory data with high co-occurrence frequency through co-activation association relationship, such as "the rules for the arrival of funds after the fixed investment amount is modified" and "risk warning of education fund products".
[0061] Optionally, the step of using the initial target memory and the associated memory data as target memory data includes: enhancing the score of the associated memory data, with the enhancement magnitude being proportional to the strength of the co-activation relationship; incorporating the score-enhanced associated memory data into the candidate set, merging it with the initial target memory, and then re-sorting the overall score to obtain the target memory data.
[0062] Specifically, the memory processing device can first enhance the scores of these co-activated associated memory data. The enhancement magnitude is proportional to the strength of the co-activation relationship. For example, a memory with an association strength of 0.8 will have its overall score increased by 0.2, while a memory with an association strength of 0.4 will only have its score increased by 0.1, thus highlighting the priority of strongly associated memories. Afterward, the memory processing device will include the score-enhanced associated memory data into a candidate set, merge it with the initial target memory, and re-rank the overall scores to obtain the final target memory data.
[0063] By using the above approach, both the initial target memory and associated memory data are returned as query response data, which not only ensures the accuracy of the answer but also completes the context through association expansion, thereby improving the coherence and comprehensiveness of the service.
[0064] Optionally, the memory processing device can combine token budget constraints to select the K target memory data with the highest overall scores from the final sorting results, ensuring that these target memory data can fully cover the context information required by the query request.
[0065] For example, continuing the example above, the final selected target memory data not only includes "APP fixed investment adjustment steps", but also includes associated memory data "account arrival rules" and "risk warnings".
[0066] Optionally, after determining K target memory data, the memory processing device can first perform context assembly, uniformly encapsulating the selected target memory data into context blocks. Each context block contains memory content, memory type, relevance score, and source information. This structured encapsulation makes the memory information clearer, thereby improving the efficiency of subsequent model processing.
[0067] After assembly, the memory processing device can provide these context blocks to the large language model. The agent combines the user's original query request with the memory information in the context blocks to generate a coherent response that is both tailored to the user's current needs and supported by personalized memory, thereby achieving accurate and humanized intelligent interaction.
[0068] Optionally, after using the initial target memory and the associated memory data as target memory data, the method further includes: updating the memory strength and co-activation association of the target memory data.
[0069] Specifically, after using the initial target memory and associated memory data as target memory data, the memory processing device can also trigger a memory update process. First, the memory processing device can record the access information of all retrieved target memory data, update its last access time, and increment the access count by 1. Simultaneously, it enhances the current memory strength according to the memory strength update rules, thereby ensuring that frequently accessed and recently accessed memories have higher priority in subsequent searches. Second, for memory pairs returned simultaneously in this search, the memory processing device can increase the association strength according to the co-activation association update rules and increase the corresponding co-activation count, allowing the association between memories to dynamically evolve with actual interactions, thus making subsequent association expansion and retrieval more aligned with the user's actual usage habits.
[0070] Optionally, the formula for calculating the updated memory strength is:
[0071] Updated memory strength = min(current memory strength + first preset increment, 1);
[0072] The formula for calculating the co-activation association is as follows:
[0073] Co-activated association strength = min(current association strength + second preset increment, 1).
[0074] In this embodiment, because the target weight configuration for multiple memory types is determined based on the query intent type, and the memory types cover plot, semantic, procedural, and emotional memories, accurate matching retrieval of memory types can be achieved. This avoids the problems of high retrieval noise and contextual pollution caused by the mixing of different types of memories, thereby improving the accuracy of retrieval results. Since the semantic strength score is dynamically calculated based on memory importance, access frequency, and time decay rate, it can highlight fresh, high-frequency, and important memory data, effectively avoiding the interference of outdated information on decision-making, making memory retrieval more in line with actual needs. Furthermore, because co-activation associations are established based on the co-occurrence frequency of memory data, and associated memory data is expanded through this relationship, memory silos can be broken down, associated contextual information can be supplemented, and the reasoning ability and response coherence of the agent can be improved. Through the synergistic optimization of three dimensions—accurate type matching, dynamic weight ranking, and associated information supplementation—accurate, dynamic, and comprehensive memory retrieval can be achieved, thereby significantly improving the quality of personalized services and user experience.
[0075] Optionally, as shown in FIG2, the memory processing method provided in the embodiments of this application may further include S201-S203:
[0076] S201, The memory processing device acquires the memory data to be stored.
[0077] Specifically, the memory processing device can obtain the memory data to be stored from the interaction logs between the agent and the user, the information actively input by the user, or the data synchronized from the external system. This data can include the user's dialogue content, operation records, emotional expressions, etc.
[0078] For example, phrases such as "I went to the bank last Tuesday to apply for a large-denomination certificate of deposit," "Stocks are riskier in volatile markets," "The first step in rebalancing an investment portfolio is to assess the allocation," and "I am worried about retirement" are all entered into the system as raw memory data to be stored.
[0079] S202. The memory processing device determines the memory type of the memory data to be stored according to the memory classification rules, and adds a corresponding memory type identifier to the memory data to be stored.
[0080] Specifically, memory processing devices can classify memories into four main categories based on the memory classification theory of cognitive science: episodic memory, semantic memory, procedural memory, and emotional memory. Each category can be further subdivided into subtypes. For example, as shown in Figure 3, episodic memory includes life events and work experiences, semantic memory includes preferred knowledge and factual knowledge, procedural memory includes operating procedures and methods, and emotional memory includes positive emotions and negative emotions.
[0081] Optionally, the memory processing device can classify new memory when it writes new memory. This can be done by using rules such as keyword matching and regular expressions, or by calling a large language model or classification model for intelligent recognition.
[0082] For example, for "I went to the bank last Tuesday to open a large deposit account", the memory processing device will identify it as a life event under episodic memory and add the type label "episodic-life event"; for "stocks are riskier in volatile markets", it will be identified as factual knowledge under semantic memory and add the type label "semantic-factual knowledge"; for "the steps to rebalance an investment portfolio are to first assess the allocation", it will be identified as an operational procedure under procedural memory and add the type label "procedural-operational procedure"; for "I am worried about retirement", it will be identified as a negative emotion under emotional memory and add the type label "emotional-negative emotion".
[0083] Each memory record is assigned a unique sector field, and some memories can also have subsectors added to achieve more granular classification management.
[0084] S203. The memory processing device stores the memory data to be stored in the corresponding storage area according to the memory type identifier, with one memory type corresponding to one level of storage area.
[0085] Specifically, the memory processing device can allocate an independent hierarchical storage area for each memory type. After the type identifier is added, the memory data to be stored is stored in the hierarchical area corresponding to its type.
[0086] For example, memories marked with "episodic" will be stored in the episodic memory level storage area, memories marked with "semantic" will be stored in the semantic memory level storage area, and so on.
[0087] The type identifier field is stored together with the memory data, so that when performing hierarchical retrieval later, the memory processing device can directly locate the corresponding storage area based on the type identifier, avoiding the efficiency loss caused by cross-type retrieval.
[0088] For example, when a personal query is received later, the system can directly retrieve the relevant memory from the plot memory hierarchy storage area without having to traverse all storage areas, greatly improving retrieval efficiency.
[0089] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0090] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0091] The memory processing method provided in this application can be executed by a memory processing device or a control module for memory processing within that device. This application uses the execution of the memory processing method by a memory processing device as an example to illustrate the memory processing device provided in this application.
[0092] It should be noted that the embodiments of this application can divide the memory processing device into functional modules according to the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. Optionally, the module division in the embodiments of this application is illustrative and is only a logical functional division; other division methods may be used in actual implementation.
[0093] As shown in Figure 4, this application embodiment provides a memory processing device 400. The memory processing device 400 includes an acquisition module 401 and a processing module 402.
[0094] The acquisition module 401 can be used to receive a user's query request and identify the query intent type of the query request, wherein the query intent type is one of factual query, personal query, operational query, and sentiment query.
[0095] The processing module 402 can be used to determine target weight configurations for multiple memory types based on the query intent type, the multiple memory types including episodic memory, semantic memory, procedural memory, and emotional memory; determine semantic similarity scores for candidate memory data based on semantic similarity and the target weight configurations; determine a comprehensive score for candidate memory data based on the semantic similarity score and the semantic intensity score; determine an initial target memory from the candidate memory data according to the comprehensive score; determine associated memory data of the initial target memory based on the co-activation association between memory data; and use the initial target memory and the associated memory data as target memory data.
[0096] The semantic strength score refers to the storage strength value of memory, which is determined by the current memory strength, basic importance, number of accesses, recent access time, and time decay rate. The co-activation association is established based on the co-occurrence frequency of memory data.
[0097] Optionally, determining the semantic similarity score of the candidate memory data based on semantic similarity and the target weight configuration includes: retrieving the N candidate memory data with the highest similarity from the storage area of each memory type based on semantic similarity, with one storage area corresponding to N candidate memory data; and multiplying all the retrieved candidate memory data by the weight of the corresponding memory type according to the target weight configuration to obtain the semantic similarity score.
[0098] Optionally, the step of using the initial target memory and the associated memory data as target memory data includes: enhancing the score of the associated memory data, with the enhancement magnitude being proportional to the strength of the co-activation relationship; incorporating the score-enhanced associated memory data into the candidate set, merging it with the initial target memory, and then re-sorting the overall score to obtain the target memory data.
[0099] Optionally, the processing module 402 can also be used to update the memory strength and co-activation association of the target memory data;
[0100] The formula for calculating the updated memory strength is as follows:
[0101] Updated memory strength = min(current memory strength + first preset increment, 1);
[0102] The formula for calculating the co-activation association is as follows:
[0103] Co-activated association strength = min(current association strength + second preset increment, 1).
[0104] Optionally, the formula for calculating the storage strength value is:
[0105] After decay, memory strength = current memory strength × (1 - time decay rate)^number of days since the last access;
[0106] Storage strength value = max(base importance, memory strength after decay);
[0107] The basic importance is a preset fixed value.
[0108] Optionally, the acquisition module 401 can also be used to acquire memory data to be stored;
[0109] The processing module 402 can also be used to determine the memory type of the memory data to be stored according to the memory classification rules, and add a corresponding memory type identifier to the memory data to be stored; and store the memory data to be stored in the corresponding storage area according to the memory type identifier, with one memory type corresponding to one level of storage area.
[0110] In this embodiment, because the target weight configuration for multiple memory types is determined based on the query intent type, and the memory types cover plot, semantic, procedural, and emotional memories, accurate matching retrieval of memory types can be achieved. This avoids the problems of high retrieval noise and contextual pollution caused by the mixing of different types of memories, thereby improving the accuracy of retrieval results. Since the semantic strength score is dynamically calculated based on memory importance, access frequency, and time decay rate, it can highlight fresh, high-frequency, and important memory data, effectively avoiding the interference of outdated information on decision-making, making memory retrieval more in line with actual needs. Furthermore, because co-activation associations are established based on the co-occurrence frequency of memory data, and associated memory data is expanded through this relationship, memory silos can be broken down, associated contextual information can be supplemented, and the reasoning ability and response coherence of the agent can be improved. Through the synergistic optimization of three dimensions—accurate type matching, dynamic weight ranking, and associated information supplementation—accurate, dynamic, and comprehensive memory retrieval can be achieved, thereby significantly improving the quality of personalized services and user experience.
[0111] Figure 5 illustrates a schematic diagram of the physical structure of an electronic device. As shown in Figure 5, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can invoke logical instructions in the memory 530 to execute a memory processing method, the method comprising: receiving a user's query request and identifying the query intent type of the query request, the query intent type being one of factual query, personal query, operational query, and emotional query; determining a target weight configuration for multiple memory types based on the query intent type, the multiple memory types including episodic memory, semantic memory, procedural memory, and emotional memory; determining a semantic similarity score for candidate memory data based on semantic similarity and the target weight configuration, and determining a comprehensive score for the candidate memory data based on the semantic similarity score and the semantic strength score; determining an initial target memory from the candidate memory data according to the comprehensive score, and determining associated memory data of the initial target memory based on the co-activation association between memory data, and using the initial target memory and the associated memory data as target memory data; wherein, the semantic strength score refers to the storage strength value of the memory, the storage strength value being determined by the current memory strength, basic importance, number of accesses, recent access time, and time decay rate, and the co-activation association is established based on the co-occurrence frequency of the memory data.
[0112] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0113] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the memory processing method provided by the above methods. The method includes: receiving a user's query request and identifying the query intent type of the query request, wherein the query intent type is one of factual query, personal query, operational query, and emotional query; determining target weight configurations for multiple memory types based on the query intent type, wherein the multiple memory types include episodic memory, semantic memory, procedural memory, and emotional memory; and determining target weight configurations based on semantic similarity. The semantic similarity score of candidate memory data is determined by the target weight configuration, and a comprehensive score of candidate memory data is determined based on the semantic similarity score and the semantic strength score. An initial target memory is determined from the candidate memory data according to the comprehensive score, and the associated memory data of the initial target memory is determined based on the co-activation association between memory data. The initial target memory and the associated memory data are used as target memory data. The semantic strength score refers to the storage strength value of the memory, which is determined by the current memory strength, basic importance, number of accesses, recent access time, and time decay rate. The co-activation association is established based on the co-occurrence frequency of memory data.
[0114] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the memory processing methods provided by the methods described above. The method includes: receiving a user's query request and identifying the query intent type of the query request, wherein the query intent type is one of factual query, personal query, operational query, and emotional query; determining target weight configurations for multiple memory types based on the query intent type, wherein the multiple memory types include episodic memory, semantic memory, procedural memory, and emotional memory; and determining candidate memories based on semantic similarity and the target weight configuration. The semantic similarity score of the memory data is used to determine the comprehensive score of the candidate memory data based on the semantic similarity score and the semantic intensity score. An initial target memory is determined from the candidate memory data according to the comprehensive score, and associated memory data of the initial target memory is determined based on the co-activation association between memory data. The initial target memory and the associated memory data are then used as the target memory data. The semantic intensity score refers to the storage strength value of the memory, which is determined by the current memory strength, basic importance, number of accesses, recent access time, and time decay rate. The co-activation association is established based on the co-occurrence frequency of the memory data.
[0115] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, 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. Those skilled in the art can understand and implement this without any creative effort.
[0116] Obviously, those skilled in the art should understand that the various units or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0117] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A memory processing method, characterized in that, include: The system receives user query requests and identifies the query intent type, which is one of factual, personal, operational, and emotional queries. Based on the query intent type, it determines target weight configurations for multiple memory types, including episodic memory, semantic memory, procedural memory, and emotional memory. It then determines a semantic similarity score for candidate memory data based on semantic similarity and the target weight configuration, and finally determines a comprehensive score for the candidate memory data based on the semantic similarity score and semantic intensity score. An initial target memory is determined from the candidate memory data according to the comprehensive score, and associated memory data of the initial target memory is determined based on the co-activation association between memory data. The initial target memory and the associated memory data are then used as target memory data. The semantic strength score refers to the storage strength value of a memory, which is determined by the current memory strength, basic importance, number of accesses, last access time, and time decay rate. The co-activation association is established based on the co-occurrence frequency of memory data. After using the initial target memory and the associated memory data as target memory data, the... The method further includes: updating the memory strength and co-activation association of the target memory data; the updated memory strength is calculated as follows: updated memory strength = min(current memory strength + first preset increment, 1); the co-activation association is calculated as follows: co-activation association strength = min(current association strength + second preset increment, 1); the storage strength value is calculated as follows: decayed memory strength = current memory strength × (1 - time decay rate)^number of days since the last access time; storage strength value = max(basic importance, decayed memory strength); wherein, the basic importance is a preset fixed value.
2. The memory processing method according to claim 1, characterized in that, The step of determining the semantic similarity score of candidate memory data based on semantic similarity and the target weight configuration includes: retrieving the N candidate memory data with the highest similarity from the storage area of each memory type based on semantic similarity, with one storage area corresponding to N candidate memory data; and multiplying all the retrieved candidate memory data by the weight of the corresponding memory type according to the target weight configuration to obtain the semantic similarity score.
3. The memory processing method according to claim 1, characterized in that, The step of using the initial target memory and the associated memory data as target memory data includes: enhancing the score of the associated memory data, with the enhancement magnitude being proportional to the strength of the co-activation relationship; incorporating the enhanced associated memory data into the candidate set, merging it with the initial target memory, and then re-sorting the overall scores to obtain the target memory data.
4. The memory processing method according to any one of claims 1-3, characterized in that, The method further includes: acquiring memory data to be stored; determining the memory type of the memory data to be stored according to memory classification rules, and adding a corresponding memory type identifier to the memory data to be stored; storing the memory data to be stored in a corresponding storage area according to the memory type identifier, with one memory type corresponding to one level of storage area.
5. A memory processing device, characterized in that, include: Acquisition module and processing module; The acquisition module is used to receive user query requests and identify the query intent type of the query request, which is one of factual query, personal query, operational query, and emotional query; the processing module is used to determine target weight configurations for multiple memory types based on the query intent type, which include episodic memory, semantic memory, procedural memory, and emotional memory; determine the semantic similarity score of candidate memory data based on semantic similarity and the target weight configuration; and determine the comprehensive score of candidate memory data based on the semantic similarity score and the semantic strength score. An initial target memory is determined from the candidate memory data according to the comprehensive score, and associated memory data of the initial target memory is determined based on the co-activation association between memory data. The initial target memory and the associated memory data are then used as target memory data. The semantic strength score refers to the storage strength value of a memory, which is determined by the current memory strength, basic importance, number of accesses, last access time, and time decay rate. The co-activation association is established based on the co-occurrence frequency of memory data. After using the initial target memory and the associated memory data as target memory data, the processing... The processing module is used to: update the memory strength and co-activation association of the target memory data; the updated memory strength is calculated as follows: updated memory strength = min(current memory strength + first preset increment, 1); the co-activation association is calculated as follows: co-activation association strength = min(current association strength + second preset increment, 1); the storage strength value is calculated as follows: decayed memory strength = current memory strength × (1 - time decay rate)^number of days since the last access time; storage strength value = max(basic importance, decayed memory strength); where the basic importance is a preset fixed value.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the memory processing method as described in any one of claims 1 to 4.
7. A non-transitory 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 memory processing method as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the memory processing method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Full-text retrieval method and system fusing various types of documents
CN121434393A
Attention-based machine learning techniques using temporal sequence data and dynamic co-occurrence graph data objects
US20240062052A1
