Personalized memory auxiliary interaction method based on mental cognition mechanism
By building a multi-level memory database, using technologies such as mental cognitive mechanism and vector database, the problem of large language models lacking long-term memory in long-term user interaction is solved, the generation of personalized responses is achieved, and the quality of agent interaction is improved.
Patent Information
- Application Number
- CN202510167056.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-12-26
- Filing Date
- 2025-02-14
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-02-14
AI Technical Summary
The existing large language models lack long-term memory mechanisms in scenarios where long-term interactions with users are required, and cannot effectively recall past conversations. The understanding of users' personality characteristics, preferences and role information is only at a shallow level, making it difficult to generate personalized responses.
A personalized memory-assisted interaction method based on mental cognitive mechanism is adopted to build a multi-level memory library, including episodic memory, semantic memory and abstract memory. Deep learning and understanding of historical dialogues are achieved through technologies such as vector databases and hash tables, and personalized responses are generated based on user characteristics.
It realizes a deep understanding and memory of users' long-term memory, can generate more coherent, accurate and empathetic responses, and improves the quality and personalization of agent interactions.
Smart Images

Figure CN119848217A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent agent interaction, and in particular to a personalized memory-assisted interaction method based on mental cognitive mechanisms. Background Art
[0002] With the continuous advancement of technologies such as artificial intelligence and machine learning, human-computer interaction (HCI) is driving the interaction towards a more intelligent and personalized direction. It has developed from a simple command line interface to a more complex graphical user interface (GUI), voice interaction, tactile feedback and other interaction methods. The development of these technologies has greatly enriched the form and content of human-computer interaction. As an emerging subfield, affective computing focuses on how to enable machines to recognize, understand and even simulate human emotional states. Through affective computing, human-computer interaction systems can provide personalized experiences based on the user's emotional state. In recent years, technologies related to large language models have developed rapidly, completely reshaping the way of human-computer interaction. Large language models have been widely used in various dialogue tasks, such as knowledge questions and answers, situational dialogues, psychological counseling, etc., and have performed well in multiple scenarios. However, large language models have two obvious defects in scenarios that require long-term interaction with users. First, these models lack long-term memory mechanisms and cannot effectively recall past conversations. Whenever a user starts a new topic, the large language model will be like a stranger and need to re-establish a dialogue with the user. Second, the dialogue model’s understanding of users’ personality traits, preferences, and role information remains at a superficial level, making it difficult to generate personalized responses based on users’ characteristics. Summary of the invention
[0003] The main purpose of this application is to provide a personalized memory-assisted interaction method based on mental cognitive mechanisms, aiming to solve the problem that existing large language models cannot generate personalized responses based on user characteristics.
[0004] To achieve the above-mentioned purpose, the present application provides a personalized memory-assisted interaction method based on the mechanism of mental cognition, including: constructing a memory bank, the memory bank is used to store situational memory, semantic memory, and abstract memory; obtaining the current input text of the current user, determining the desire type of the input text, and summarizing the personal role summary of the current user according to the input text; performing situational memory retrieval in the memory bank according to the current input text to obtain historical situational memory related to the current input text; and storing the current input text and timestamp as situational memory in the memory bank; performing semantic memory retrieval in the memory bank according to the desire type and personal role summary to obtain historical semantic memory related to the current desire type and personal role summary; and storing the desire type and personal role summary as semantic memory in the memory bank; performing abstract memory retrieval in the memory bank according to the current input text to obtain historical abstract memory related to the current input text; using the retrieved historical situational memory, historical semantic memory, and historical abstract memory as working memory; generating a response text according to the working memory for interaction; at the end of the current interaction cycle, summarizing all input texts in the interaction cycle to obtain daily event summaries, and storing the daily event summaries as abstract memories in the memory bank.
[0005] Optionally, after generating a response text according to the working memory and interacting, the method further includes: clearing the working memory at the end of the current round of interaction.
[0006] Optionally, context memory retrieval is performed in the memory bank based on the current input text to obtain historical context memory related to the current input text, including: converting the current input text into vectors, performing similarity retrieval in the memory bank using the vectors, and obtaining historical context memory related to the current vectors.
[0007] Optionally, the memory library includes a FAISS vector database, and storing the current input text and timestamp as situational memory in the memory library includes: storing the current vector and timestamp as situational memory in the FAISS vector database.
[0008] Optionally, semantic memory retrieval is performed in the memory bank according to the desire type and personal role summary to obtain historical semantic memory related to the current desire type and personal role summary, including: converting the desire type and personal role summary into text vectors, mapping the text vectors into hash index values using a hash function, and performing similarity search in the memory bank using the hash index value to obtain historical semantic memory related to the current hash index value.
[0009] Optionally, the memory includes a hash table, and the desire type and the personal role summary are stored in the memory as semantic memory, including: storing the hash index value in the hash table.
[0010] Optionally, the storage form of the abstract memory is: combining the daily event summaries of all interaction cycles into an event summary set in the chronological order of the interaction cycles.
[0011] Optionally, determining the desire type of the input text includes: inputting the input text into a classification model to determine its desire type.
[0012] Optionally, the classification model is obtained in the following manner: constructing a sentence dataset containing desire labels, and training a ChatGLM model using the sentence dataset to obtain a classification model.
[0013] To achieve the above-mentioned purpose, the present application also provides a personalized memory-assisted interaction system based on the mechanism of mental cognition, including: a mental module, which is used to obtain the current input text of the current user, determine the desire type of the input text, and summarize the personal role summary of the current user according to the input text; a summarizing module, which is used to summarize all the input texts in the interaction cycle at the end of the current interaction cycle to obtain a summary of daily events; a memory retrieval module, which is used to perform situational memory retrieval in the memory bank according to the current input text to obtain historical situational memory related to the current input text; it is also used to perform semantic memory retrieval in the memory bank according to the desire type and the personal role summary to obtain historical semantic memory related to the current desire type and the personal role summary; it is also used to perform abstract memory retrieval in the memory bank according to the current input text to obtain historical abstract memory related to the current input text; a memory storage module, which is used to store the current input text and timestamp as situational memory; it is also used to store the desire type and the personal role summary as semantic memory; it is also used to store the daily event summary as abstract memory; it is also used to use the retrieved situational memory, semantic memory, and abstract memory as working memory; a dialogue generation module, which is used to generate response text according to the working memory for interaction.
[0014] Compared with the prior art, the present invention has the following beneficial effects: The personalized memory-assisted interaction method based on the mind cognitive mechanism of the present invention determines the desire type of the input text based on the multi-level desire classification of the mind theory, and summarizes the user's personal role summary, which is saved as semantic memory as the user's personality and role information. It can deeply understand and remember the user's role and personality characteristics, which is conducive to generating personalized responses; drawing on the partitioned storage method of episodic memory and semantic memory in human long-term memory, abstract memory is proposed to imitate the abstract thinking of humans in cognitive tasks, and working memory is established to realize the call of related memory; it can realize the synergy of associative memory and abstract memory, and provide a more coherent and in-depth interactive experience for user dialogue; episodic memory, semantic memory, and abstract memory are constructed into a memory library with a multi-level memory structure and is constantly updated, which can effectively associate historical dialogues without re-establishing dialogues, thereby improving the interaction quality of intelligent bodies. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is a flow chart of the personalized memory assistance interaction method based on mental cognitive mechanism in this application.
[0016] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0018] The first embodiment of the present invention provides a personalized memory assistance interaction method based on mental cognition mechanism, such as Figure 1 As shown, the specific steps include: Step S1, constructing a memory bank, which is used to store episodic memory, semantic memory, abstract memory and working memory; Step S2, obtaining the current input text of the current user, determining the desire type of the input text, and summarizing the personal role summary of the current user based on the input text; Specifically, a sentence dataset containing desire labels is constructed, and the ChatGLM model is trained using the sentence dataset to obtain a classification model; the input text is input into the classification model to determine its desire type.
[0019] In this embodiment, based on the theory of mind, Freud's desire theory, etc., a classification module is established to construct basic human desire types, aiming to more accurately capture and express the user's personality characteristics and role information. Through this fine classification, a deeper and more detailed portrait is provided to the user, thereby achieving a higher level of personalization and adaptability in human-computer interaction. The specific method for establishing the classification module is as follows: more than 2,000 dialogue sentences were collected from multiple online forums, covering multiple topics such as family, health, diet, and entertainment; the most relevant specific desire was found for each dialogue sentence, as shown in Table 1, and the corresponding desire type was marked for each dialogue sentence through three different large language models (ChatGPT, Claude, Wenxinyiyan), and a sentence data set containing desire labels was obtained; the ChatGLM model was trained using this data set to learn how to infer and identify the corresponding desire type from the input sentence, and a classification model was obtained.
[0020] Table 1 Dialogue sentence tag examples
[0021] Step S3, performing similarity search in the memory base according to the current input text to obtain historical situation memory related to the current input text; and storing the current input text and timestamp in the memory base as situation memory; the memory base includes the FAISS vector database; Specifically, in step S31, the current input text is converted into vectors respectively, and the vectors are used to perform similarity search in the memory library to obtain the historical situation memory related to the current vector, that is, the related historical input text; Step S32, storing the current vector and timestamp as contextual memory in the FAISS vector database.
[0022] In this embodiment, the episodic memory is a specific event related to personal experience, and each event is timestamped similar to human episodic memory; it enables the agent to recall the specific scenes and details of the interaction with a specific user; this embodiment uses vector database technology to efficiently store and retrieve detailed dialogue events, and can achieve deep learning and understanding of historical dialogues during retrieval, so that each retrieval can be associated with the current dialogue context at the semantic level, greatly enhancing the personalized interaction experience of the dialogue agent, enabling it to generate more coherent, accurate and empathetic responses. Exemplarily, a text vectorization method based on the sentence-transformer model all-roberta-large-v1 can be used to map the current input text and timestamp to a 1024-dimensional dense vector space to obtain a vector; use the vector to perform cosine similarity retrieval in the memory library to obtain relevant historical text, and store the current vector in the FAISS vector database. At the same time, FAISS, as a library for episodic memory storage, is specifically used to handle the search problem of high-dimensional vectors, especially for large-scale data; the storage and retrieval of vectors are realized through the Flat index structure provided by FAISS.
[0023] Step S4, performing similarity search in the memory bank according to the desire type and the personal role summary, obtaining historical semantic memory related to the current desire type and the personal role summary; and storing the desire type and the personal role summary in the memory bank as semantic memory; Specifically, step S41 converts the desire type and the personal role summary into a text vector, maps the text vector into a hash index value using a hash function, and uses the hash index value to perform a similarity search in the memory library to obtain the historical situation memory related to the hash index value; In step S42, the memory includes a hash table, and the current hash index value is stored in the hash table. Since data points with the same (or similar) hash value will be stored in close blocks or in the same block, a fast approximate nearest neighbor search can be achieved during retrieval.
[0024] In this embodiment, semantic memory is the user's role information and personality characteristics, which is a personal portrait of the user. The hash-based locality-sensitive hashing algorithm (LSH) is used to store and search the hash value of the desire type and the personal role summary, ensuring that similar and related personality characteristics are stored in close retrieval areas, thereby improving the efficiency and performance of the entire system. Specifically, the LSH algorithm can embed each n-dimensional vector x∈R nGenerate a hash embedding F(x) and ensure that vectors close to each other in high-dimensional space have a higher probability of obtaining the same hash index. The LSH algorithm allows fast and approximate similarity searches in large-scale data sets without having to perform precise high-dimensional space searches, which greatly reduces computational costs.
[0025] Step S5, abstract memory retrieval is performed in the memory bank according to the current input text to obtain historical abstract memory related to the current input text; and at the end of the current interaction cycle, all input texts in the interaction cycle are summarized to obtain a daily event summary, and the daily event summary is stored in the memory bank as an abstract memory.
[0026] The storage form of abstract memory is: the daily event summaries of all interaction cycles are combined into an event summary set in chronological order, that is, Esummary = {E date1 , E date2 , . . . , E daten}.
[0027] In this embodiment, the conversation content is transformed into a higher-level representation through abstract memory. The memory content is more compact and representative. Through the event summary set Esummary, the event summary set E of each conversation date is date It is integrated into a global abstract memory to form a hierarchical memory structure. For example, an interaction cycle can be one day, and can also be set specifically as needed.
[0028] Step S6, using the retrieved historical situational memory, historical semantic memory, and historical abstract memory as working memory; generating a response text based on the working memory to interact; and clearing the working memory at the end of the current round of interaction.
[0029] In this embodiment, working memory is the temporarily stored information currently being processed. For each task of generating a personalized response, working memory provides all memories related to the current task, including the user's personality traits and role information, a series of historical memories associated with the current conversation, and high-level global abstract memory; when generating a response, episodic memory provides the necessary long-term memory for generating personalized responses, semantic memory helps the agent better understand the user's personality and preferences, and abstract memory provides a high-level understanding of user behavior and preferences, based on which an accurate and personalized response is generated. Dynamic management of working memory ensures that working memory is always focused on the current task, avoiding interference from irrelevant information, thereby improving the efficiency of cognitive processing.
[0030] The second embodiment of the present invention provides a personalized memory assistance interactive system based on mental cognition mechanism, comprising: A mind module, used to obtain the current input text of the current user, determine the desire type of the input text, and summarize the personal role summary of the current user based on the input text; The summary module is used to summarize all input texts in the interaction cycle at the end of the current interaction cycle to obtain a daily event summary; in this embodiment, the summary module can be LLM, and all input texts in the interaction cycle are summarized by calling LLM.
[0031] A memory retrieval module is used to retrieve episodic memory in the memory bank according to the current input text to obtain episodic memory related to the current input text; it is also used to retrieve semantic memory in the memory bank according to the desire type and the personal role summary to obtain semantic memory related to the current desire type and the personal role summary; it is also used to retrieve abstract memory in the memory bank according to the current input text to obtain abstract memory related to the current input text; A memory storage module, for storing the current input text and timestamp as episodic memory; for storing desire types and personal role summaries as semantic memory; for storing daily event summaries as abstract memory; and for storing retrieved episodic memory, semantic memory, and abstract memory as working memory; The dialogue generation module is used to generate response text based on working memory for interaction.
[0032] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A personalized memory assistance interaction method based on mental cognitive mechanism, characterized in that: include: Constructing a memory bank, wherein the memory bank is used to store episodic memory, semantic memory and abstract memory; Acquire a current input text of a current user, determine a desire type of the input text, and summarize a personal role summary of the current user based on the input text; Performing semantic memory retrieval in the memory bank according to the desire type and the personal role summary to obtain historical semantic memory related to the current desire type and the personal role summary; and storing the desire type and the personal role summary as semantic memory in the memory bank; Performing context memory retrieval in the memory bank according to the current input text to obtain historical context memory related to the current input text; and storing the current input text and timestamp in the memory bank as episodic memory; Performing abstract memory retrieval in the memory bank according to the current input text to obtain historical abstract memory related to the current input text; The retrieved historical episodic memory, historical semantic memory, and historical abstract memory are used as working memory; response text is generated according to the working memory to interact; At the end of the current interaction cycle, all input texts are summarized to obtain a daily event summary, which is stored in the memory bank as an abstract memory.
2. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 1 is characterized in that: After generating a response text according to the working memory and performing interaction, the method further includes: clearing the working memory at the end of the current round of interaction.
3. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 1 is characterized in that: The process of performing context memory retrieval in the memory bank according to the current input text to obtain historical context memory related to the current input text includes: The current input text is converted into a vector respectively, and the current vector is used to perform similarity search in the memory library to obtain the historical situation memory related to the current vector.
4. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 3 is characterized in that: The memory bank includes a FAISS vector database, and the current input text and timestamp are stored in the memory bank as contextual memory, including: The current vector and timestamp are stored in the FAISS vector database as episodic memory.
5. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 1 is characterized in that: The semantic memory retrieval is performed in the memory bank according to the desire type and the personal role summary to obtain the historical semantic memory related to the current desire type and the personal role summary, including: The desire type and personal role summary are converted into text vectors, the text vectors are mapped into hash index values using a hash function, and the obtained hash index values are used to perform similarity search in the memory library to obtain historical semantic memory related to the current hash index value.
6. The personalized memory assistance interaction method based on mental cognition mechanism according to claim 5 is characterized in that: The memory bank includes a hash table, and the desire type and the personal role summary are stored in the memory bank as semantic memory, including: Store the hash index value into the hash table.
7. The personalized memory assistance interaction method based on mental cognition mechanism according to claim 1 is characterized in that: The storage form of the abstract memory is: daily event summaries of all interaction cycles are combined into an event summary set according to the time sequence of the interaction cycles.
8. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 1 is characterized in that: The determining the desire type of the input text comprises: The input text is input into a classification model to determine its desire type.
9. The personalized memory assistance interaction method based on mental cognition mechanism according to claim 1 is characterized in that: The classification model is obtained in the following way: A sentence dataset containing desire labels is constructed, and the ChatGLM model is trained using the sentence dataset to obtain a classification model.
10. A personalized memory assistance interactive system based on mental cognitive mechanism, characterized in that: include: A mind module, used for obtaining a current input text of a current user, determining a desire type of the input text, and summarizing a personal role summary of the current user based on the input text; The summary module is used to summarize all input texts in the current interaction cycle at the end of the interaction cycle to obtain a daily event summary; A memory retrieval module is used to perform a situational memory retrieval in the memory bank according to the current input text to obtain a historical situational memory related to the current input text; it is also used to perform a semantic memory retrieval in the memory bank according to the desire type and the personal role summary to obtain a historical semantic memory related to the current desire type and the personal role summary; it is also used to perform an abstract memory retrieval in the memory bank according to the current input text to obtain a historical abstract memory related to the current input text; A memory storage module, for storing the current input text and timestamp as episodic memory; for storing the desire type and personal role summary as semantic memory; for storing the daily event summary as abstract memory; and for storing the retrieved episodic memory, semantic memory, and abstract memory as working memory; The dialogue generation module is used to generate response text according to the working memory for interaction.
Citation Information
Patent Citations
Method for extracting document abstract based on knowledge-based adaptive event index cognitive model
CN110188189A
Brain-inspired long-time-interval continuous pedestrian re-identification method and device
CN114445852A
Interaction control method and system and electronic equipment
CN117193582A
AI Agent long-time continuous service method based on external memory system
CN117195955A
Structured abstract dialogue method and system for background information enhancement, electronic equipment and storage medium
CN117453890A
Cited By
Conversation processing method and device, program product and electronic equipment
CN120632022A
Multi-level modular personal memory large model and construction method thereof
CN121031669A
Large model memory management and optimization system and method based on vector data lake
CN121501798A
A Large Model Memory Management and Optimization System and Method Based on Vector Data Lake
CN121501798B
Conversation processing method, device and equipment
CN121597894A