Method and system for processing long-term memory for emotional disclosure and related device
Patent Information
- Application Number
- CN202611477247.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-10-30
AI Technical Summary
(1)记忆碎片化,缺乏持续事件的连续状态维护:情感倾诉中的核心往往会跨多个会话持续演化,现有技术通常是将不同会话提取的信息作为独立事件分别存储,难以识别它们是否属于同一个持续事件,这导致事件的发展阶段被割裂,无法有效维护持续事件的统一身份及历史演化脉络
[0018]有益效果:本发明提供了一种面向情感倾诉的长期记忆处理方法、系统及相关设备,方法包括将跨会话持续发展的同一事件,组织为具有统一情节身份的连续情节记忆单元;在当前会话产生新的事件信息时进行同一持续事件认定;若与已有情节记忆单元属于同一持续事件,则保持已有情节身份,并根据事件中新增或变化信息的记忆属性类别进行情节记忆单元的差异化更新;在生成回复时,获取相关的情节记忆单元,并利用当前会话中的最新信息对情节记忆单元的历史信息进行适用性校正;最后提取校正后情节记忆单元中与当前交互相关的信息重构为情境化记忆调用表示,供给回复生成模型。本发明解决了情感交互长期记忆碎片化和新旧状态冲突的问题,并提升了记忆调用的适用性。
Smart Images

Figure CN123013968A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, system, and related equipment for long-term memory processing oriented towards emotional expression. Background Technology
[0002] With the rapid development of large language models in the field of natural language processing, artificial intelligence is gradually extending to long-term interactive scenarios such as emotional expression and psychological companionship. In these cross-conversation scenarios, users often disclose personal life experiences, relationships, and emotional changes in stages and gradually. Due to the limited context window of large language models, directly loading massive amounts of historical dialogues not only consumes a lot of computing resources but also introduces redundant information, causing the model's focus to shift. Therefore, existing technologies usually use memory compression and retrieval mechanisms for long-term memory management.
[0003] However, in scenarios with high complexity and continuous development, such as emotional expression, existing long-term memory management solutions still have the following shortcomings: (1) Fragmented memory and lack of continuous state maintenance of continuous events: The core of emotional expression often evolves continuously across multiple conversations. Existing technologies usually store information extracted from different conversations as independent events, making it difficult to identify whether they belong to the same continuous event. This results in the development stages of the event being fragmented, and it is impossible to effectively maintain the unified identity and historical evolution of continuous events.
[0004] (2) Lack of applicability correction for historical memory can easily lead to conflicts between old and new states: Historical information is related to the current interaction, but it does not mean that the historical state is valid. For example, a user may want to salvage the relationship in a past conversation, but has decided to break up in the latest conversation. If the retrieved historical intentions are directly input into the model, it will cause the spatiotemporal state to become mixed, leading to model misjudgment. If a simple new state is used to cover the old state, important turning points of the event will be lost, weakening the empathy and understanding ability of artificial intelligence.
[0005] (3) Coarse memory retrieval increases context noise interference: In order to meet the need for complete tracing, historical long-term memory usually stores detailed structured information. However, in the current specific round of dialogue, only the information related to the current topic needs to be used. If the complete historical storage object is directly loaded into the current dialogue, it will increase the possibility of invalid information and invalid states entering the context, interfering with the model's focus on the current core intent.
[0006] In summary, existing long-term memory methods cannot adequately address issues such as identity recognition across persistent events, maintenance of differences between old and new states, and applicability during invocation, thus failing to meet the needs of long-term AI-powered emotional companionship. Summary of the Invention
[0007] This invention provides a method, system, and related equipment for long-term memory processing of emotional expression. The main purpose of this invention is to solve the technical problems mentioned in the background art of the prior art.
[0008] The first aspect of this invention provides a long-term memory processing method for emotional expression, comprising: Organize the same event that continues to develop across sessions into consecutive episode memory units with a unified episode identity; When new event information is generated in the current session, it is determined whether the event information belongs to the same continuous event as the previously existing continuous episode memory unit; If it is determined that they belong to the same continuous event, the existing continuous episode identity is maintained, and the continuous episode memory unit is updated differently according to the memory attribute category to which the newly added or changed information in the event information belongs. When generating the current response requires the use of historical memory, the relevant continuous episode memory unit is obtained based on the current user input or the current session state, and the applicability of the historical information in the relevant continuous episode memory unit is corrected using the latest information in the current session. The information related to the current interaction in the corrected continuous episode memory unit is reconstructed into a contextualized memory retrieval representation and provided to the response generation model.
[0009] In an optional embodiment of the first aspect of the present invention, the continuous episode memory unit includes: episode identity information for characterizing the unique identity of a continuous event; current state information for characterizing the current stage of the continuous event in the latest session; state evolution information for characterizing the historical evolution process of the continuous event over time across sessions; and historical set information including state information of associated objects surrounding the continuous event, historical behavior information, and historical interaction negative feedback information.
[0010] In an optional embodiment of the first aspect of the present invention, when new event information is generated in the current session, determining whether the event information belongs to the same continuous event as the previously existing continuous episode memory unit includes: When new event information is generated in the current session, candidate consecutive episodes are extracted from the event information; Based on the main event line, determine whether the candidate continuous plot and the historical continuous plot in the existing continuous plot memory unit meet the consistency condition. Based on satisfying the consistency of the main event line, further combine at least one of the core issues, related objects, or key scenarios to determine whether the candidate continuous plot and the historical continuous plot have a continuous relationship in terms of continuous event identity; If the candidate continuous plot and the historical continuous plot have a continuous relationship in terms of continuous event identity, they are determined to belong to the same continuous event; otherwise, a new continuous plot identity is created for the event information.
[0011] In an optional embodiment of the first aspect of the present invention, the step of maintaining the existing continuous episode identity and performing differentiated updates on the continuous episode memory unit according to the memory attribute category to which the newly added or changed information in the event information belongs if it is determined to belong to the same continuous event includes: If the newly added or changed information belongs to the current state information, then the current state of the original continuous episodes is updated and overwritten according to the newly appearing and clearly expressed information in the current session. If the newly added or changed information belongs to state evolution information, then, while retaining the original state evolution information, the newly emerging stage changes in the current session will be added as a supplement to the historical evolution process. If the newly added or changed information belongs to historical collection information, then the newly added historical behaviors, historical interaction negative feedback and related person information will be merged with the existing historical collection content and deduplicated.
[0012] In an optional embodiment of the first aspect of the invention, the step of performing applicability correction on the historical information in the relevant sequential episode memory unit using the latest information in the current session includes: The current state is determined using the latest and most clearly expressed state information in the current session. Compare the historical information in the relevant sequential memory units that differs from the current state; The historical information, which differs from the current state, serves as a supplement to the historical development process, relationship changes, and historical background of ongoing events.
[0013] In an optional embodiment of the first aspect of the present invention, the step of reconstructing the information related to the current interaction in the corrected sequential episode memory unit into a contextualized memory retrieval representation for provision to the response generation model includes: After completing the applicability correction, the event state, related state evolution information, character relationship state, emotional information, and historical interaction negative feedback information that are directly related to the current response are filtered from the relevant continuous episode memory units. The event state, the related state evolution information, the character relationship state, the emotional information, and the historical interaction negative feedback information are reorganized into a natural language context description with a data volume smaller than the continuous plot memory unit; The natural language context description is provided as a contextualized memory retrieval representation to the response generation model for use.
[0014] In an optional embodiment of the first aspect of the present invention, the long-term memory processing method further includes: When a corresponding continuous episode memory unit cannot be clearly matched based on the current session, but a key related person is identified in the current input; Based on the key related figures, the associated continuous plot memory units are retrieved; The relationship status, historical changes, and negative feedback information of historical interactions related to the key associated person are extracted from the retrieved continuous episode memory units. Combined with the latest information about the key associated person in the current session, a relationship status memory representation for the current interaction is generated and provided to the response generation model.
[0015] A second aspect of the present invention provides a long-term memory processing system for emotional expression, the long-term memory processing system comprising: The plot memory organization module is used to organize the same event that continues to develop across sessions into consecutive plot memory units with a unified plot identity; The continuous event determination module is used to determine whether new event information generated in the current session belongs to the same continuous event as the previously existing continuous episode memory unit when the event information is generated. The memory differentiation update module is used to maintain the existing continuous plot identity if it is determined that they belong to the same continuous event, and to perform differentiation update on the continuous plot memory unit according to the memory attribute category to which the newly added or changed information in the event information belongs; The memory applicability correction module is used to obtain the relevant continuous episode memory unit based on the current user input or the current session state when the generation of the current reply requires the use of historical memory, and to perform applicability correction on the historical information in the relevant continuous episode memory unit using the latest information in the current session; The contextualized memory reconstruction module is used to reconstruct the information related to the current interaction in the corrected continuous episode memory unit into a contextualized memory retrieval representation, which is then provided to the response generation model.
[0016] A third aspect of the present invention provides a long-term memory processing device for emotional expression, the long-term memory processing device for emotional expression comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; The at least one processor invokes the instructions in the memory to cause the long-term memory processing device for emotional expression to perform the long-term memory processing method for emotional expression as described in any one of the first aspects of the present invention.
[0017] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the long-term memory processing method for emotional expression as described in any one of the first aspects of the present invention.
[0018] Beneficial Effects: This invention provides a method, system, and related equipment for long-term memory processing of emotional expression. The method includes organizing the same event that continues to develop across sessions into continuous episode memory units with a unified episode identity; identifying the same continuous event when new event information is generated in the current session; if it belongs to the same continuous event as an existing episode memory unit, maintaining the existing episode identity and updating the episode memory unit differently based on the memory attribute category of newly added or changed information in the event; when generating a response, acquiring relevant episode memory units and using the latest information in the current session to correct the applicability of the historical information of the episode memory units; finally, extracting information related to the current interaction from the corrected episode memory units and reconstructing it into a contextualized memory retrieval representation, which is then supplied to the response generation model. This invention solves the problems of fragmentation and conflict between old and new states in long-term memory of emotional interaction and improves the applicability of memory retrieval. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of an embodiment of the overall technical route of a long-term memory processing method for emotional expression, which is an example of the present invention. Figure 2 This is a schematic diagram of an embodiment of the processing flow of a long-term memory processing method for emotional expression, which is an exemplary embodiment of the present invention. Figure 3 This is a schematic diagram of an embodiment of a continuous plot memory unit of the present invention; Figure 4 This is a schematic diagram of an embodiment of a differentiated update strategy exemplified by the present invention; Figure 5 This is a schematic diagram of an embodiment of the memory retrieval, correction, and reconstruction process of the present invention; Figure 6 This is a schematic diagram illustrating an embodiment of the present invention of a continuous plot development scenario spanning multiple sessions; Figure 7 This is a schematic diagram of an embodiment of the software architecture of a long-term memory processing system for emotional expression, which is an example of the present invention. Figure 8 This is a schematic diagram of an embodiment of a long-term memory processing device for emotional expression, which is an example of the present invention. Detailed Implementation
[0020] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention 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 so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a 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.
[0021] The first aspect of this invention provides a long-term memory processing method for emotional expression, which is mainly used to solve the problems of the same event being split into multiple independent historical records, different types of memory information being updated in a unified way, historical state and current state being mixed together, and memory retrieval being inapplicable during long-term, cross-conversation continuous interaction between users and artificial intelligence. It can be applied to cross-conversation interaction scenarios including artificial intelligence emotional expression, emotional companionship, psychological support, long-term companion-style dialogue, and other scenarios that require artificial intelligence to continuously understand users' personal experiences, relationships, and state changes.
[0022] The overall technical concept of this invention can be summarized as follows: organizing the same event that can continue to develop across multiple sessions into a continuous plot memory unit with a unified plot identity; when new event information appears in subsequent sessions, it is first determined whether the new event information belongs to the same continuous event as the existing continuous plot; for information belonging to the same continuous event, the existing plot identity is maintained, and different update methods are adopted according to the different memory attributes to which the newly added or changed information belongs; when the current response needs to utilize historical memory, the relevant continuous plot is obtained according to the current user input or the current session state, and the historical information is corrected using the latest information in the current session; furthermore, information directly related to the current interaction is selected from the long-term memory storage content to form a contextualized memory retrieval representation that is different from the complete long-term memory storage content, and the contextualized memory retrieval representation is provided to the response generation model.
[0023] like Figure 1As shown, in a complete implementation, the overall technical concept of this invention mainly includes two interconnected processing chains. The first chain is a historical memory retrieval chain during the session, used to obtain and process historical information related to the current round of interaction before the current response is generated. The second chain is a long-term memory consolidation chain after the session is completed, used to construct new candidate continuous plots based on the current complete session and to update existing continuous plots across sessions. The memory information used in this invention may include long-term memory of continuous plots, current session state representation, and stable user characteristics. Long-term memory of continuous plots is the long-term memory object that this invention focuses on processing, used to characterize the development process of a specific continuous event across multiple sessions. The current session state representation is used to characterize the user's latest topics, event progress, character relationships, current emotions, and processing methods already taken in the current session. Stable user characteristics are used to store information such as user background, behavioral tendencies, relationship patterns, sensitive factors, and interaction preferences that change relatively slowly. Stable user characteristics and current session state representation can serve as auxiliary information in the complete system, but do not constitute necessary prerequisites for continuous plot identity judgment and differentiated updates in this invention.
[0024] See Figure 2 The long-term memory processing method for emotional expression provided in the first aspect of the present invention mainly includes the following steps: S100. Organize the same event that continues to develop across sessions into a continuous episode memory unit with a unified episode identity. The continuous episode memory unit includes: episode identity information to represent the unique identity of the continuous event; current state information to represent the current stage of the continuous event in the latest session; state evolution information to represent the historical evolution process of the continuous event over time across sessions; and historical set information including the state information of related objects surrounding the continuous event, historical behavior information, and historical interaction negative feedback information.
[0025] like Figure 3 As shown, in this invention, the continuous plot memory unit is mainly used to represent the plot identity, current state and historical development process of the same continuous event in multiple sessions. The continuous plot memory unit may include at least plot identity information, current state information and state evolution information. In some other embodiments, it may also include associated object state information, historical behavior information and historical interaction negative feedback information.
[0026] Specifically, the plot identity information in this invention is mainly used to characterize which continuous event corresponds to a continuous plot, and serves as the basis for subsequent cross-session judgment of the same continuous event. The plot identity information may include one or more of the following: event theme, event type, core issue, related characters, and key scenes. The current state information is mainly used to characterize the current stage of the continuous event, and may include one or more of the following: current event progress, current core concern, current main emotion, current relationship status, and current valid status. The current valid status may include in progress, paused, ended, and uncertain. The state evolution information is mainly used to save the stage changes and development process of the same continuous event, and may include stage changes, key turning points, new triggering events, and corresponding time information. For example, the same relationship event may form a state evolution process of "continuous conflict → reduced contact → relationship end". In this invention, since the current state information and state evolution information are maintained separately, the continuous plot memory can simultaneously represent the "current state" of the continuous event and the "previous development process" of the continuous event.
[0027] Furthermore, in this invention, the associated object status information is mainly used to store key figures directly related to the ongoing event and the relationship status between the user and these figures in the event. This can include the current relationship status, the user's emotional attitude towards the corresponding figures, relationship change trends, and recurring interactions. The historical behavior information is mainly used to store the processing, response, or communication behaviors that the user has actually taken in response to the current ongoing problem. The historical interaction negative feedback information is mainly used to store the historical processing directions that the user has clearly indicated are invalid, have not achieved the expected results, or have generated negative feedback. For information that can only be judged from the user's behavior as potentially having negative feedback but has not yet been clearly confirmed by the user, it can be stored in a pending confirmation state in this invention. After obtaining clear feedback from the user, it can be updated to confirmed historical interaction negative feedback information.
[0028] It should be noted that the specific field names, data storage structure, and data serialization method of the continuous plot memory unit of the present invention can be set according to the specific system, and the present invention is not limited to a specific field name or a specific data format.
[0029] In an optional embodiment of the first aspect of the present invention, this step further includes generating a current session state representation. Specifically, during the current session, a current session state representation can be formed based on the interaction content generated up to the current moment. The current session state representation may include one or more of the following: current main topic, current event progress, current key figures and relationship status, user's currently expressed emotions, actual actions already taken, and currently appearing invalid feedback information. The current session state representation is updated according to preset update conditions, which can be set by the specific system according to operational needs. The present invention does not limit the fixed number of interaction rounds. In the present invention, the current session state representation is used on the one hand to maintain the continuity of information within the current session, and on the other hand to serve as an important basis for judging the user's current state during subsequent historical memory retrieval.
[0030] In another optional embodiment of the first aspect of the present invention, this step further includes generating and maintaining stable user characteristics that are distinct from continuous episodic memory. Specifically, in the present invention, for users who already have stable user characteristics, after a complete session ends, the existing stable user characteristics and the current complete session can be used as input to identify newly added or changed long-term information and update the existing stable user characteristics. Information that appears only in a single session and is not yet sufficient to be judged as a stable characteristic can be temporarily not written into the stable user characteristics. Stable information that is explicitly expressed by the user or appears repeatedly in multiple interaction scenarios can be recorded after satisfying preset conditions. Thus, stable user characteristics mainly describe the user's relatively stable personal characteristics over a long period of time, continuous episodic memory mainly describes how specific problems develop across sessions, and the current session state representation mainly describes the latest dynamic state in the current session.
[0031] S200. When new event information is generated in the current session, determine whether the event information belongs to the same continuous event as the historically existing continuous event memory unit. In this invention, this step may include: when new event information is generated in the current session, extracting candidate continuous events from the event information; determining whether the candidate continuous events and historical continuous events in the historically existing continuous event memory unit satisfy the consistency condition based on the event main line; further determining whether the candidate continuous events and the historical continuous events have a continuous relationship in terms of continuous event identity based on at least one of the core issues, related objects, or key scenarios, while satisfying the consistency condition of the event main line; if the candidate continuous events and the historical continuous events have a continuous relationship in terms of continuous event identity, then they are determined to belong to the same continuous event; otherwise, a new continuous event identity is created for the event information.
[0032] like Figure 3As shown, in this invention, after a complete session ends, the system first identifies event information with continuous tracking value from the current complete session and constructs one or more candidate continuous episode memory units. Event information with continuous tracking value can at least meet one of the following conditions: the event is still in a state of continuous development at the end of the current session; the same event has been repeated during user interaction; although there is no new objective progress in the event at present, it still continues to affect the user's current emotions, relationship status or behavioral decisions.
[0033] In this invention, information lacking a clear event thread, having no lasting impact, or having no value for subsequent tracking may not be formed into a continuous long-term memory. After forming candidate continuous events, this invention performs a plot identity association determination with existing continuous events in historical long-term memory. In this invention, the purpose of plot identity association determination is not to determine whether two texts are related, but to determine whether the current candidate continuous event and the historical continuous event represent the same ongoing event.
[0034] In this invention, the plot identity association determination first determines whether the event main lines of the candidate continuous plot and the historical continuous plot meet the consistency condition. When the event main lines are inconsistent, it is determined that the two belong to different continuous events, and no merge update is performed on the corresponding historical continuous plot. When the event main lines meet the consistency condition, further judgment is made based on at least one of the core issues, associated objects and key scenarios.
[0035] Specifically, based on the consistency of the main event storyline, this invention can determine whether two episodes belong to the same ongoing event according to at least one of the following conditions: the core issues reflected in the candidate ongoing episode and the historical ongoing episode are consistent; the key figures involved in the candidate ongoing episode and the historical ongoing episode correspond or significantly overlap; in the absence of a clear key figure, the key scenes or main triggering factors in the candidate ongoing episode and the historical ongoing episode have a corresponding relationship. For example, the ongoing conflict between a user and the same mentor regarding the research direction may manifest in different sessions as the research plan being rejected, subsequent communication not achieving the expected results, and the user reconsidering subsequent research arrangements. Although the textual expressions and latest progress in different sessions are not the same, if their main event storyline, related figures, and core issues have a continuous relationship, they can be identified as different development stages of the same ongoing episode. Conversely, if the user experiences similar negative emotions due to the rejection of the mentor and partner respectively, although some textual semantics and emotions are related, their main event storyline and related objects are different, and they are not identified as the same ongoing episode.
[0036] In this invention, when a candidate continuous plot is determined to be a subsequent state of an existing historical continuous plot, the system will continue to maintain the plot identifier of the existing historical continuous plot and enter the state update process of the continuous plot. When there is no historical continuous plot that meets the plot identity association condition, a new plot identifier is established for the candidate continuous plot and added to the long-term memory as a new continuous plot memory unit.
[0037] This invention enables the same persistent event scattered across multiple sessions to be continuously maintained around a unified long-term memory object through the method of "persistent event identity determination → maintaining the original plot identity → continuing to update", instead of forming multiple independent historical events according to different sessions. In specific implementation, the continuous plot construction and plot identity association determination of this invention can be implemented by a large language model running according to preset rules, or by a semantic representation model, classification model, rule program, or a combination of the above processing methods.
[0038] S300. If it is determined that they belong to the same continuous event, the existing continuous plot identity is maintained, and the continuous plot memory unit is updated differentially according to the memory attribute category to which the newly added or changed information in the event information belongs. In this invention, this step may include: if the newly added or changed information belongs to the current state information, the current state of the original continuous plot is updated and overwritten according to the newly appearing and clearly expressed information in the current session; if the newly added or changed information belongs to the state evolution information, the newly appearing stage changes in the current session are added as supplements to the historical evolution process while retaining the original state evolution information; if the newly added or changed information belongs to the historical set information, the newly added historical behaviors, historical interaction negative feedback and related character information are merged with the existing historical set content and deduplicated.
[0039] like Figure 4 As shown, when a candidate continuous episode is determined to be the subsequent state of an existing continuous episode, the system will obtain the new or changed information generated by the current session relative to the existing continuous episode, and determine the corresponding update method according to the memory attribute category corresponding to the new or changed information. In this invention, instead of uniformly overwriting or uniformly appending to the entire continuous episode, differentiated updates are adopted according to the data nature of different information in the continuous event. In one implementation, the new or changed information can be divided into current state information, state evolution information, and historical set information.
[0040] For updating the current state information: The current state information is mainly used to indicate the current state of a continuous event. The current state information may include the current event progress, the current core concern, the current main emotion, the current effective state, and the current relationship state, etc. When new state information with time updates and clear expression appears in the current session, the current state of the corresponding continuous episode is updated using the new state information. In a further implementation, before performing the current state update, the information completeness of the new state information and the existing state information can be compared.
[0041] When new information in the current session is generated later but is significantly more abstract than existing information and does not provide substantial new progress, the present invention can continue to retain the existing more specific state information instead of using more abstract new information to cover the existing specific state. For example, when the historical long-term memory has clearly recorded the progress of a specific relationship, but the current session only shows information such as "the relationship is still quite complicated" which lacks clear changes, the existing specific progress can be retained.
[0042] Regarding the updating of state evolution information: State evolution information is mainly used to represent the stage changes that have occurred in the same continuous event. While updating the current state information, the existing state evolution information is retained. When a new stage change occurs in the current session relative to the existing historical stage, the new stage change is added to the state evolution information of the corresponding continuous event. For example, if the existing state evolution information is "continuous conflict → beginning to reduce contact", when a clear relationship stage change occurs in the current session, it can be supplemented to form "continuous conflict → beginning to reduce contact → relationship ends". It should be noted that this invention does not stipulate that the old current state is automatically converted into a new historical node for each current state change. Instead, it supplements the newly added stage changes that clearly occur in the current session based on the existing state evolution information, so as to maintain the current state of the continuous event and the already formed state evolution process separately.
[0043] Regarding the updating of historical information: For information that needs to be continuously saved across sessions, such as processing methods that have been adopted, processing directions that have been confirmed to generate negative feedback, and related personnel, this invention will merge the new content in the current session with the existing historical information and remove duplicate or semantically equivalent content. For example, for a certain historical processing method, if it can only be determined that negative feedback may be generated based on user behavior at first, it can be saved as information to be confirmed. After obtaining explicit confirmation from the user in a subsequent session, it can be updated to confirmed historical interaction negative feedback information. For information that has been transformed from general historical behavior information into confirmed historical interaction negative feedback, its duplicate recording in different information categories can be reduced.
[0044] Through the above three types of update methods, the same continuous plot can be maintained simultaneously, namely, the state that is still valid at the current moment, the development process of the events that have already been formed, and the historical experience that still has value for future interactions.
[0045] Furthermore, this step of the invention also includes the maintenance of character and relationship information: For key characters involved in a continuous plot, a character index can be established for stable character identification in different sessions and the association between characters and continuous plots. The character index may include one or more of the following: character identifier, character name, nickname, character category, stable character information, and associated plot identifier. Relatively stable information about the character can be stored in the character index. The current relationship status between the character and the user in a specific continuous event, the user's current emotional attitude towards the corresponding character, and the interaction between the two parties in the continuous event can be stored in the associated object status information of the corresponding continuous plot. When a historical character is not mentioned again in the current session, the existing relationship information will not be automatically deleted because the current session lacks the corresponding character information.
[0046] Furthermore, this step of the present invention also includes long-term memory lifecycle maintenance: after the continuous plot is updated, long-term memory lifecycle maintenance can be performed based on the information stored in the continuous plot itself. In one embodiment, the corresponding continuous plot can be determined to continue to be retained in the active long-term memory set based on information such as the current valid status of the continuous plot, the most recent update time, whether the relevant content appears again in the current session, the plot category, and the number of long-term memories. Continuous plots that meet the preset archiving conditions can be transferred from the active long-term memory set to the archived memory set. For the archived continuous plots, only some information used for subsequent event identification or historical interpretation can be retained, such as plot identifier, plot theme, plot type, related characters, core issues, and historical interaction negative feedback information with long-term use value. It should be noted that in the present invention, the specific time threshold, long-term memory quantity threshold, and node quantity upper limit can all be set according to the specific system and are not considered as fixed limitations of the present invention. The archiving and retention judgment of long-term memory is based on the information stored in the long-term memory itself.
[0047] S400. When generating the current response requires utilizing historical memory, the relevant continuous episode memory unit is obtained based on the current user input or the current session state, and the latest information in the current session is used to perform applicability correction on the historical information in the relevant continuous episode memory unit. In this invention, this step may include: determining the current state using the latest and clearly expressed state information in the current session; comparing the historical information in the relevant continuous episode memory unit that differs from the current state; and using the historical information that differs from the current state as supplementary information on the historical development process, relationship changes, and historical background of the ongoing events.
[0048] like Figure 5 As shown, in this invention, when the response generation process needs to utilize historical information, the system will retrieve candidate continuous plots related to the current problem from the historical long-term memory based on the current user input, the current session state, or a combination of both. The historical memory retrieval process of this invention does not end with "retrieval of historical memory", but may further include historical memory acquisition, current state correction, and contextualized memory reconstruction.
[0049] Regarding the acquisition of historical long-term memory: In the initial stage after the start of a new session, when the current session has not yet formed a sufficient representation of the current session state, a relevance retrieval can be performed from the historical long-term memory based on the current user input to quickly obtain one or more candidate historical events that may be related to the current input. In one specific implementation, for example, the current input can be converted into a semantic representation and a vector similarity retrieval can be performed on the historical long-term memory. In addition, keyword matching, semantic retrieval, or other relevance calculation methods can also be used. This invention does not limit the specific retrieval method.
[0050] As the current conversation continues, once a current conversation state representation reflecting the current topic, related figures, current emotions, and event progress has been formed, relevant continuums can be further selected based on the overall state of the current conversation. In one implementation, the selection of candidate historical continuums can consider: the degree of correlation between the current topic and historical continuums; the correspondence between currently mentioned figures and related figures in historical continuums; the degree of correlation between the current emotions and emotional states in historical continuums; whether historical continuums are still active; and the most recent update time of historical continuums.
[0051] When there is little information in the current session, the current input can be used to quickly obtain the necessary historical background. After the current session state has gradually formed, the actual relevance of the historical sequence to the current interaction can be determined based on the overall session state. It should be noted that the above methods of obtaining historical memory are not limited to switching between a fixed number of session rounds.
[0052] Regarding the correction of historical information and current session state: After obtaining one or more candidate continuous episodes, this invention corrects the historical information in the candidate continuous episodes with the current session state. When the historical continuous episodes and the current session state describe the same ongoing event or the same relationship object, and there are differences in their descriptions of the current state, the current state is determined by the information in the current session that is updated in time and clearly expressed. For information in the historical long-term memory that is different from the current state, this invention does not use it to replace the latest state in the current session, but mainly uses it to supplement the previous development process, relationship changes, and historical background of the ongoing event. For example, if the historical long-term memory records that the user previously still wanted to continue a relationship, but the user has clearly stated in the current session that the corresponding relationship has ended, then during the current memory retrieval process, "the relationship has ended" is used as the current state of the corresponding relationship. The information in the history that "the user once wanted to continue the relationship" can be used to explain the previous relationship development process, but it is not used as the current intention to continue the relationship.
[0053] This invention corrects the applicability of historical memory by adjusting the current session state, so that long-term memory mainly serves to supplement the background of event development, while current session information mainly serves to determine the current facts.
[0054] S500. Reconstruct the information related to the current interaction in the corrected continuous episode memory unit into a contextualized memory retrieval representation and provide it to the response generation model. In this invention, this step may include: after completing the applicability correction, selecting event states, related state evolution information, character relationship states, emotional information, and historical interaction negative feedback information directly related to the current response from the relevant continuous episode memory units; reorganizing the event states, related state evolution information, character relationship states, emotional information, and historical interaction negative feedback information into a natural language contextual description with a data volume smaller than that of the continuous episode memory unit; and providing the natural language contextual description as a contextualized memory retrieval representation to the response generation model for use.
[0055] like Figure 5 As shown, in this invention, after correcting historical information and the current session state, the complete continuous plot memory unit is not directly provided to the response generation model. Instead, information directly related to the current interaction is obtained from it to form a contextualized memory retrieval representation. The long-term memory storage representation and the contextualized memory retrieval representation in this invention have different processing purposes. The long-term memory storage representation is used to meet the needs of continuous preservation and subsequent cross-session updates. It can store relatively complete plot identity, current state, state evolution, character relationships, historical behavior, and historical interaction negative feedback, etc. The contextualized memory retrieval representation is used for the current response generation and only selects the information currently needed from the complete long-term memory.
[0056] In one exemplary embodiment, the contextualized memory retrieval representation of the present invention can be formed based on at least two of the following information: the current progress of a continuous episode; relevant state evolution information of the continuous episode; the core issue that currently continues to affect the user; key figures and relationship status directly related to the current issue; user emotions related to the current issue; and historical interaction negative feedback information, wherein the latest information in the current session is used to determine the current state, and historical long-term memory is used to supplement the event development process and relationship background.
[0057] For historical processing directions that have been explicitly confirmed as invalid by users or have generated obvious negative feedback, this invention can incorporate them as historical interaction negative feedback information into the contextualized memory recall representation. This provides the response generation model with the historical feedback background of the previous persistent problem, thereby reducing the possibility of reusing historical processing directions that have already received negative feedback.
[0058] Finally, in this invention, the system reorganizes the information related to the current problem in the structured long-term memory into a continuous natural language contextual description so that the response generation model can understand and use it. It should also be noted that this invention does not limit the contextual memory retrieval representation to a fixed text template, fixed field name, or fixed output format; the specific settings can be made according to actual needs.
[0059] Furthermore, in this invention, when an effective contextualized memory retrieval representation has been formed based on historical continuous events and the current session state, the contextualized memory retrieval representation can be used as dynamic memory information in the current response generation stage. Since the contextualized memory retrieval representation already contains relevant information of the current round after correction of the current state, it is not necessary to repeatedly provide the response generation model with a complete current session state representation containing a large amount of the same state information. When there is no effective historical long-term memory in the current round, the current session state representation can be provided to the response generation model as dynamic memory content to maintain the continuity of information within the current session. Stable user features can be used as relatively fixed auxiliary background information and provided to the response generation model as needed by the system.
[0060] Through the above-described method, this invention enables the dynamic memory content received during the response generation stage to be selected based on the results of the current round of historical memory retrieval, thereby reducing information duplication between different memory representations.
[0061] Furthermore, in an optional embodiment of the first aspect of the present invention, the long-term memory processing method further includes: when a corresponding continuous episode memory unit cannot be explicitly matched according to the current session, but a key associated person is identified in the current input; retrieving the continuous episode memory unit associated with the key associated person; extracting the relationship status, historical changes, and historical interaction negative feedback information related to the key associated person from the retrieved continuous episode memory unit, and combining it with the latest information about the key associated person in the current session to generate a relationship status memory representation for the current interaction, and providing it to the response generation model.
[0062] Specifically, in this invention, when a clear corresponding continuous plot cannot be determined based on the current session, but a key figure in the current input can be identified, the historical continuous plot associated with that key figure can be obtained further. From the historical continuous plot, the relationship status, historical changes, and historical interaction negative feedback information related to that figure can be obtained, and combined with the latest information about that figure in the current session, a relationship status memory representation oriented towards the current interaction can be formed. For example, when the current user only mentions a long-term key figure, but the existing information is not enough to determine which specific historical event corresponds to the current interaction, the historical plot associated with that figure can be searched first, and the relationship background related to the current interaction can be obtained. When there is neither a continuous plot that meets the conditions nor a matching key figure, it can be determined that there is no usable long-term historical memory in this round.
[0063] Furthermore, to better illustrate the implementation of the long-term memory processing method for emotional expression according to the present invention, the present invention provides the following embodiments: Example 1: Implementation based on a large language model and preset processing rules: In the implementation of Example 1, one or more of the processes involved in the present invention, such as continuous plot construction, continuous plot identity association determination, differentiated state update, current session state construction, and contextual memory reconstruction, can be completed by constraining the large language model through preset processing rules.
[0064] For example, when performing continuous plot identity association determination, the current candidate continuous plot and historical continuous plot can be provided to the large language model, and judgment rules such as event main line, core issues, related objects and key scenes can be set; when performing continuous plot update, rules such as current state update, state evolution supplementation and historical set merging and deduplication can be set according to different memory attributes; when performing historical memory retrieval, the current conversation information and candidate historical continuous plot can be provided to the large language model, and processing rules can be set for current conversation information to determine the current state and historical long-term memory to supplement the event development background; when performing contextual reconstruction, information such as the current relevant event state, state evolution, relationship state, emotion and historical interaction negative feedback can be selected from the complete long-term memory and formed into a memory representation for use by the response generation model.
[0065] Of course, the various processing procedures involved in this invention can also be implemented through semantic analysis models, classification models, rule programs, or combinations of multiple processing methods. The technical solutions of this invention are not limited to a specific large language model, specific prompt word text, specific database, specific vector model, or fixed business parameters.
[0066] Example 2: Implementation of a Continuous Storyline Across Multiple Sessions: Example 2 of this invention uses a persistent relationship conflict arising between a user and their partner regarding relationship responses as an example to illustrate the cross-session continuous storyline processing process of this invention. Figure 6 As shown, the system establishes a unified continuous episode identifier for ongoing events. In the first conversation, the scenario might be as follows: The user states that their partner has recently been not replying to messages for extended periods. The user repeatedly asks if their partner still values the relationship, leading to an argument. The user also states that the repeated questioning did not make them feel more at ease but instead exacerbated the conflict. Based on the current complete conversation, the system establishes a corresponding continuous episode memory. Episode identity information is used to represent the ongoing conflict between the user and their partner regarding relationship responsiveness and security. Current status information indicates that the two have had multiple arguments but the relationship continues, with the associated object being the user's partner. Historical behavior information records that the user repeatedly questioned their partner, and historical interaction negative feedback information records that the repeated questioning did not alleviate the user's anxiety but instead intensified the conflict.
[0067] In the second session, if the user indicates that the two parties have argued again over a similar issue and have begun to reduce contact with each other, the system will determine, based on the main event, related characters, and core issues, that the new information still belongs to an existing continuous plot. Therefore, no new independent plot will be created, but the original plot identity will be maintained. Among them, "the two parties have begun to reduce contact" is used to update the current state, and "continuous arguments → reduced contact" is added to the state evolution information as a new stage change. The historical negative feedback of previous interactions will continue to be retained.
[0068] In the third session, if the user explicitly states that they have decided to end the relationship, the system will continue to determine that this information belongs to the same continuous event and update the current state of the corresponding continuous event with "the relationship has ended". At the same time, new stage changes will be added to the existing state evolution information so that the state evolution information can be represented as "continuous conflict → reduced contact → relationship ends". The historical behavior and negative feedback of historical interactions that have been formed before will still be preserved.
[0069] In the fourth session, if the user mentions the person again and expresses continued sadness, the system retrieves the corresponding previous events and corrects the historical information based on the current session state. At this point, the system uses "the relationship has ended" as the current relationship state. Information about the user's previous attempts to maintain the relationship or repeatedly seeking responses is used to supplement the historical development background and is not considered as the current relationship intention. At the same time, the system selects relevant content such as previous ongoing disputes, relationship changes, and negative feedback from historical interactions based on the current issue to generate a contextualized memory recall representation for this round. This allows the response generation model to obtain the following information: the ongoing event has developed to the point of relationship end; the user is still affected by the corresponding historical event; and the historical background of which previous processing directions have received negative feedback.
[0070] It is easy to see from the above embodiments that the method of the present invention no longer saves multiple sessions as multiple similar independent events, but maintains a unified plot identity around the same continuous event, continuously updates the current state, supplements the state evolution information and maintains long-term historical experience among multiple sessions, and then corrects and reconstructs the long-term memory according to the latest state of the current session when it is called in a later time.
[0071] In conclusion, compared to technical solutions that store historical information from different sessions as independent events, update long-term memory in a uniform manner, or directly provide retrieved historical information to the response generation model, this invention, through continuous episode memory, cross-session episode identity determination, differentiated updates based on memory attribute categories, and current state correction and contextual reconstruction of historical information, can achieve at least the following technical effects: 1. Improve the continuity of memory for continuous events across sessions and reduce long-term memory fragmentation: This invention uses continuous plot memory units with a unified plot identity as the long-term memory objects for continuous events. For event information scattered across different sessions, the system no longer establishes independent historical records based solely on the sessions in which they appear. Instead, it determines whether the current candidate plot belongs to the same continuous event as existing historical plots. When it is determined that they belong to the same continuous event, the existing plot identity is maintained and subsequent updates are performed within that plot. Even if the same continuous event has different textual expressions, different event stages, or different user states in different sessions, it can still be continuously maintained around a unified plot identity. In the process of determining the continuous plot identity, this invention not only judges whether there is semantic relevance between information, but also combines information such as the main event line, core issues, related objects, or key scenes for judgment. This allows for further differentiation between historical information that is "similar in text or emotion but actually belongs to different events" and historical information that is "different in textual expression but actually belongs to different stages of the same event." This can reduce memory fragmentation caused by the same continuous event being split into multiple independent historical records and improve the data continuity of long-term memory across sessions.
[0072] 2. Maintaining the current state, historical evolution, and long-term effective experience of continuous events: This invention adopts different update methods based on the memory attributes of different information in a continuous narrative, rather than uniformly overwriting or appending the entire continuous narrative. For current state information representing the current stage of an event, updates can be made based on newly emerging and clearly expressed information in the current session. For state evolution information representing the development process of an event, new stage changes are added while retaining existing state evolution information. For historical set information such as methods already adopted, processing directions that have generated clear negative feedback, and related characters, continuous maintenance is carried out using merging and deduplication methods. This invention can maintain the timely update of the current state of the event while continuing to preserve the established event development trajectory and historical experience that is still valuable for subsequent interactions. Compared with the uniform overwriting method, this invention can reduce the loss of historical evolution information with the latest state update. Compared with the uniform appending method, it can reduce information redundancy caused by the continuous accumulation of repeated states, repeated characters, and repeated historical behaviors in the same continuous event.
[0073] 3. Improve the applicability of long-term historical memory in the current response and reduce the interference of irrelevant historical information on the current context: After obtaining the continuous historical events related to the current question, this invention does not directly provide the complete historical memory or retrieval results to the response generation model. Instead, it further combines the latest information in the current session for state correction. When there is a difference between the current state of the long-term historical memory and the current session regarding the same ongoing event or the same related person, the current state is determined by the time-updated and clearly expressed information in the current session. The long-term historical memory is mainly used to supplement the previous development process, relationships between people, and historical feedback of the ongoing event. After completing the state correction, based on the current interaction needs, information such as event states, state evolution, relationships between people, emotions, and historical feedback directly related to the current question is selected from the complete long-term memory storage content to form a contextualized memory retrieval representation. This invention can distinguish between memory storage content for long-term preservation and memory retrieval content for the current response, reducing the possibility of historical states from the past being mistakenly used as current facts, and reducing the entry of all historical nodes, irrelevant person information, and historical content that is not directly related to the current question into the current response context.
[0074] 4. Enhance the ability to continuously utilize historical behaviors and feedback information during long-term interactions: This invention not only preserves what happened in a continuous event, but also continuously maintains the user's historical behaviors and processing directions that have received clear negative feedback within the corresponding continuous scenarios. Historical behaviors and historical interaction negative feedback information are continuously updated across sessions with the same continuous scenario and are not automatically deleted because they are not mentioned again in the current session. When the corresponding continuous scenario is related to the current problem again in a subsequent interaction, the historical behaviors and historical interaction negative feedback related to the current problem can be retrieved from long-term memory and provided to the response generation model as part of the contextualized memory retrieval representation. In this invention, the response generation model can obtain the processing process and related feedback background that the current continuous problem has previously undergone, reducing the possibility of reusing the historical processing direction that has received clear negative feedback. At the same time, by associating historical feedback with its corresponding specific continuous scenario, this type of information can be used in a targeted manner when the relevant problem reappears, without needing to indiscriminately add all of the user's historical negative feedback to the current context, thereby improving the utilization efficiency of long-term historical experience in continuous interactions.
[0075] See Figure 7 A second aspect of the present invention provides a long-term memory processing system for emotional expression, the long-term memory processing system comprising: Episode memory organization module 10 is used to organize the same event that continues to develop across sessions into consecutive episode memory units with a unified episode identity; The continuous event determination module 20 is used to determine whether the event information and the historically existing continuous episode memory unit belong to the same continuous event when new event information is generated in the current session. The memory differentiation update module 30 is used to maintain the existing continuous plot identity if it is determined that they belong to the same continuous event, and to perform a differentiation update on the continuous plot memory unit according to the memory attribute category to which the newly added or changed information in the event information belongs; The memory suitability correction module 40 is used to obtain the relevant continuous episode memory unit based on the current user input or the current session state when the generation of the current reply requires the use of historical memory, and to perform suitability correction on the historical information in the relevant continuous episode memory unit using the latest information in the current session; The memory contextual reconstruction module 50 is used to reconstruct the information related to the current interaction in the corrected continuous episode memory unit into a contextual memory retrieval representation, which is then provided to the response generation model.
[0076] In an optional embodiment of the second aspect of the present invention, the continuous episode memory unit includes: episode identity information for characterizing the unique identity of a continuous event; current state information for characterizing the current stage of the continuous event in the latest session; state evolution information for characterizing the historical evolution process of the continuous event over time across sessions; and historical set information including state information of associated objects surrounding the continuous event, historical behavior information, and historical interaction negative feedback information.
[0077] In an optional embodiment of the second aspect of the present invention, the continuous event determination module includes: The candidate plot extraction unit is used to extract candidate consecutive plots from the event information when new event information is generated in the current session. The consistency judgment unit is used to determine, based on the event main line, whether the candidate continuous plot and the historical continuous plot in the existing continuous plot memory unit meet the consistency condition. The identity continuity judgment unit is used to determine whether the candidate continuous plot and the historical continuous plot have a continuous relationship in terms of continuous event identity, based on satisfying the consistency of the main event line and further combining at least one of the core issues, related objects or key scenarios. The continuous event determination unit is used to determine that the candidate continuous plot and the historical continuous plot belong to the same continuous event if they have a continuous relationship in terms of continuous event identity; otherwise, it creates a new continuous plot identity for the event information.
[0078] In an optional embodiment of the second aspect of the present invention, the memory differentiation update module includes: The current state update unit is used to update and overwrite the current state of the original continuous plot based on the newly appearing and clearly expressed information in the current session if the newly added or changed information belongs to the current state information. The state evolution update unit is used to add the newly emerging stage changes in the current session as supplements to the historical evolution process if the newly added or changed information belongs to state evolution information, while retaining the original state evolution information. The historical set update unit is used to merge and deduplicate the newly added historical behaviors, historical interaction negative feedback, and related person information with the existing historical set content if the newly added or changed information belongs to the historical set information.
[0079] In an optional embodiment of the second aspect of the present invention, the memory suitability correction module includes: The current state determination unit is used to determine the current state using the latest and clearly expressed state information in the current session; A difference information comparison unit is used to compare the historical information in the related continuous episode memory unit that is different from the current state; The historical change supplement unit is used to supplement the historical information that is different from the current state as the historical development process, relationship changes and historical background of the continuous event.
[0080] In an optional embodiment of the second aspect of the present invention, the memory contextual reconstruction module includes: The information filtering unit is used to filter out event states, related state evolution information, character relationship states, emotional information, and historical interaction negative feedback information that are directly related to the current response from the relevant continuous plot memory units after the applicability correction is completed. The information reorganization unit is used to reorganize the event state, the related state evolution information, the character relationship state, the emotional information and the historical interaction negative feedback information into a natural language context description with a data volume smaller than that of the continuous plot memory unit; The information output unit is used to provide the natural language context description as a contextualized memory retrieval representation to the response generation model for use.
[0081] In an optional embodiment of the second aspect of the present invention, the long-term memory processing system further includes a memory unit auxiliary recall module, which is used to: when a corresponding continuous episode memory unit cannot be explicitly matched according to the current session, but a key related person is identified in the current input; retrieve the continuous episode memory unit associated with the key related person; and extract the relationship status, historical changes, and historical interaction negative feedback information related to the key related person from the retrieved continuous episode memory unit, and combine it with the latest information about the key related person in the current session to generate a relationship status memory representation for the current interaction, and provide it to the response generation model.
[0082] Figure 8 This is a schematic diagram of a long-term memory processing device for emotional expression provided by an embodiment of the present invention. This long-term memory processing device for emotional expression can vary considerably due to differences in configuration or performance. It may include one or more processors 60 (central processing units, CPUs) (e.g., one or more processors) and a memory 70, and one or more storage media 80 for storing data (e.g., one or more mass storage devices). The memory and storage media can be short-term or persistent storage. The program stored in the storage media may include one or more modules (not shown in the figure), each module including a series of instruction operations on the long-term memory processing device for emotional expression. Furthermore, the processor may be configured to communicate with the storage media to execute the series of instruction operations in the storage media on the long-term memory processing device for emotional expression.
[0083] The long-term memory processing device for emotional expression in this embodiment of the invention may further include one or more power supplies 90, one or more wired or wireless network interfaces 100, one or more input / output interfaces 110, and / or one or more operating systems, such as Windows Server, Mac OS, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 8 The illustrated structure of the long-term memory processing device for emotional expression does not constitute a limitation on the long-term memory processing device for emotional expression. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0084] This invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the long-term memory processing method for emotional expression.
[0085] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system, module, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0086] If the integrated unit is implemented as a software functional unit or a combination of software and hardware and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or 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 long-term memory processing device for emotional expression (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: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0087] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing long-term memory oriented towards emotional expression, characterized in that, include: Organize the same event that continues to develop across sessions into consecutive episode memory units with a unified episode identity; When new event information is generated in the current session, it is determined whether the event information belongs to the same continuous event as the previously existing continuous episode memory unit; If it is determined that they belong to the same continuous event, the existing continuous episode identity is maintained, and the continuous episode memory unit is updated differently according to the memory attribute category to which the newly added or changed information in the event information belongs. When generating the current response requires the use of historical memory, the relevant continuous episode memory unit is obtained based on the current user input or the current session state, and the applicability of the historical information in the relevant continuous episode memory unit is corrected using the latest information in the current session. The information related to the current interaction in the corrected continuous episode memory unit is reconstructed into a contextualized memory retrieval representation and provided to the response generation model; The continuous episode memory unit includes: episode identity information for representing the unique identity of a continuous event; current state information for representing the current stage of the continuous event in the latest session; state evolution information for representing the historical evolution process of the continuous event over time across sessions; and historical set information including state information of associated objects surrounding the continuous event, historical behavior information, and historical interaction negative feedback information. If it is determined that they belong to the same continuous event, the existing continuous episode identity is maintained, and the continuous episode memory unit is updated differently according to the memory attribute category to which the newly added or changed information in the event information belongs, including: If the newly added or changed information belongs to the current state information, then the current state of the original continuous episodes is updated and overwritten according to the newly appearing and clearly expressed information in the current session. If the newly added or changed information belongs to the state evolution information, then, while retaining the original state evolution information, the newly emerging stage changes in the current session will be added as a supplement to the historical evolution process. If the newly added or changed information belongs to the historical set information, then the newly added historical behaviors, historical interaction negative feedback and related person information will be merged with the existing historical set content and deduplicated.
2. The long-term memory processing method for emotional expression according to claim 1, characterized in that, When new event information is generated in the current session, determining whether the event information belongs to the same continuous event as the previously existing continuous episode memory unit includes: When new event information is generated in the current session, candidate consecutive episodes are extracted from the event information; Based on the main event line, determine whether the candidate continuous plot and the historical continuous plot in the existing continuous plot memory unit meet the consistency condition. Based on satisfying the consistency of the main event line, further combine at least one of the core issues, related objects, or key scenarios to determine whether the candidate continuous plot and the historical continuous plot have a continuous relationship in terms of continuous event identity; If the candidate continuous plot and the historical continuous plot have a continuous relationship in terms of continuous event identity, they are determined to belong to the same continuous event; otherwise, a new continuous plot identity is created for the event information.
3. The long-term memory processing method for emotional expression according to claim 1, characterized in that, The process of applying the latest information from the current session to the historical information in the relevant sequential episode memory units for applicability correction includes: The current state is determined using the latest and most clearly expressed state information in the current session. Compare the historical information in the relevant sequential memory units that differs from the current state; The historical information, which differs from the current state, serves as a supplement to the historical development process, relationship changes, and historical background of ongoing events.
4. The long-term memory processing method for emotional expression according to claim 1, characterized in that, The step of reconstructing the information related to the current interaction in the corrected sequential episode memory unit into a contextualized memory retrieval representation, and providing it to the response generation model, includes: After completing the applicability correction, the event state, related state evolution information, character relationship state, emotional information, and historical interaction negative feedback information that are directly related to the current response are filtered from the relevant continuous episode memory units. The event state, the related state evolution information, the character relationship state, the emotional information, and the historical interaction negative feedback information are reorganized into a natural language context description with a data volume smaller than the continuous plot memory unit; The natural language context description is provided as a contextualized memory retrieval representation to the response generation model for use.
5. The long-term memory processing method for emotional expression according to claim 1, characterized in that, Also includes: When a corresponding continuous episode memory unit cannot be clearly matched based on the current session, but a key related person is identified in the current input; Based on the key related figures, the associated continuous plot memory units are retrieved; The relationship status, historical changes, and historical interaction negative feedback information related to the key associated person are extracted from the retrieved continuous episode memory units. Combined with the latest information about the key associated person in the current session, a relationship status memory representation for the current interaction is generated and provided to the response generation model.
6. A long-term memory processing system for emotional expression, characterized in that, The long-term memory processing system includes: The plot memory organization module is used to organize the same event that continues to develop across sessions into consecutive plot memory units with a unified plot identity; The continuous event determination module is used to determine whether new event information generated in the current session belongs to the same continuous event as the previously existing continuous episode memory unit when the event information is generated. The memory differentiation update module is used to maintain the existing continuous plot identity if it is determined that they belong to the same continuous event, and to perform differentiation update on the continuous plot memory unit according to the memory attribute category to which the newly added or changed information in the event information belongs; The memory applicability correction module is used to obtain the relevant continuous episode memory unit based on the current user input or the current session state when the generation of the current reply requires the use of historical memory, and to perform applicability correction on the historical information in the relevant continuous episode memory unit using the latest information in the current session; The memory contextual reconstruction module is used to reconstruct the information related to the current interaction in the corrected continuous episode memory unit into a contextual memory retrieval representation, which is then provided to the response generation model. The continuous episode memory unit includes: episode identity information for representing the unique identity of a continuous event; current state information for representing the current stage of the continuous event in the latest session; state evolution information for representing the historical evolution process of the continuous event over time across sessions; and historical set information including state information of associated objects surrounding the continuous event, historical behavior information, and historical interaction negative feedback information. The memory differentiation update module includes: The current state update unit is used to update and overwrite the current state of the original continuous episodes based on the newly appearing and clearly expressed information in the current session if the newly added or changed information belongs to the current state information. The state evolution update unit is used to add the newly emerging stage changes in the current session as a supplement to the historical evolution process if the newly added or changed information belongs to the state evolution information, while retaining the original state evolution information. The historical set update unit is used to merge and deduplicate the newly added historical behaviors, historical interaction negative feedback, and related person information with the existing historical set content if the newly added or changed information belongs to the historical set information.
7. A long-term memory processing device for emotional expression, characterized in that, The long-term memory processing device for emotional expression includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; The at least one processor invokes the instructions in the memory to cause the long-term memory processing device for emotional expression to perform the long-term memory processing method for emotional expression as described in any one of claims 1-5.
8. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the long-term memory processing method for emotional expression as described in any one of claims 1-5.
