Personalized memory assistance interaction method based on mental cognitive mechanism
By constructing a multi-level memory bank and mental cognition mechanism, the problem of large language models lacking long-term memory and personalized response in long-term interactions is solved, and personalized and coherent interaction of intelligent agents in long-term interactions is achieved.
Patent Information
- Application Number
- CN202510167056.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2024-12-26
- Filing Date
- 2025-02-14
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-02-14
AI Technical Summary
Large language models lack long-term memory mechanisms in long-term interactions with users and cannot effectively recall past conversations. Whenever a user starts a new topic, the conversation needs to be re-established, and it is difficult to generate personalized responses based on user characteristics.
Construct a multi-level memory library, including episodic memory, semantic memory and abstract memory, determine the user's personal role summary and desire type through mental cognitive mechanisms, use FAISS vector database and hash table for efficient retrieval, and generate personalized responses.
It enables intelligent agents to recall historical conversations during long-term interactions, providing a coherent and in-depth interactive experience, improving the quality of interaction, and generating the accuracy and coherence of personalized responses.
Smart Images

Figure CN119848217B_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 interactions towards greater intelligence and personalization. It has evolved from simple command-line interfaces to more complex graphical user interfaces (GUIs), voice interaction, haptic feedback, and other interactive methods. These technological developments have greatly enriched the forms and content of human-computer interaction. Affective computing, as an emerging subfield, focuses on enabling machines to recognize, understand, and even simulate human emotions. 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 rapidly developed, completely reshaping the way human-computer interaction is conducted. Large language models have been widely used in various conversational tasks, such as knowledge question-answering, situational dialogue, and psychological counseling, and have performed well in many scenarios. However, large language models have two significant drawbacks in scenarios requiring long-term user interaction. First, these models lack long-term memory mechanisms and cannot effectively recall past conversations. Whenever a user initiates a new topic, the large language model becomes like a stranger, requiring a fresh conversation with the user. Second, the dialogue model's understanding of users' personality traits, preferences, and role information remains at a shallow 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 episodic 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 based on the input text; performing episodic memory retrieval in the memory bank based on the current input text to obtain historical episodic memory related to the current input text; and storing the current input text and timestamp as episodic memory in the memory bank; performing semantic memory retrieval in the memory bank based on 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 based on the current input text to obtain historical abstract memory related to the current input text; using the retrieved historical episodic memory, historical semantic memory, and historical abstract memory as working memory; generating response text based on the working memory to interact; 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, using the vectors to perform similarity retrieval in the memory bank, 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 contextual memory in the memory library includes: storing the current vector and timestamp as contextual memory in the FAISS vector database.
[0008] Optionally, semantic memory retrieval is performed in the memory bank based on 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 a text vector, mapping the text vector into a hash index value using a hash function, and performing a 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 bank includes a hash table, and storing the desire type and the personal role summary as semantic memory in the memory bank includes: 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 according to the time sequence 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 by constructing a sentence dataset containing desire labels, and training a ChatGLM model using the sentence dataset to obtain the classification model.
[0013] To achieve the above-mentioned purpose, the present application also provides a personalized memory assistance interaction system based on the mind cognitive mechanism, including: a mind 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 summary 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 daily event summary; 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; and is also used to perform 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 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; and is also used to store the desire type and personal role summary as semantic memory; and is also used to store the daily event summary as abstract memory; and 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 based on working memory for interaction.
[0014] Compared with the prior art, the present invention has the following advantages:
[0015] 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 constantly updated memory library with a multi-level memory structure, which can effectively associate historical dialogues without the need to re-establish dialogues, thereby improving the interaction quality of intelligent agents. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a flowchart of the personalized memory assistance interaction method based on mental cognitive mechanisms in this application.
[0017] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0018] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0019] 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:
[0020] Step S1, constructing a memory bank, which is used to store episodic memory, semantic memory, abstract memory and working memory;
[0021] 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;
[0022] 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.
[0023] In this embodiment, a classification module is established based on theories of mind and Freud's theory of desire, constructing basic human desire types. This aims to more accurately capture and represent user personality traits and persona information. This refined classification provides users with a deeper and more detailed profile, thereby achieving a higher level of personalization and adaptability in human-computer interaction. The specific classification module construction method involves collecting over 2,000 conversation sentences from multiple online forums, covering topics such as family, health, diet, and entertainment. For each conversation sentence, the most relevant specific desire is identified (see Table 1). Three different large language models (ChatGPT, Claude, and Wenxin Yiyan) are used to label each conversation sentence with a corresponding desire type, resulting in a sentence dataset containing desire labels. This dataset is then used to train the ChatGLM model, enabling it to learn how to infer and identify the corresponding desire type from the input sentences, thus generating a classification model.
[0024] Table 1 Dialogue sentence tag examples
[0025]
[0026] Step S3, performing similarity search in the memory bank based on the current input text to obtain historical context memory related to the current input text; and storing the current input text and timestamp as context memory in the memory bank; the memory bank includes the FAISS vector database;
[0027] Specifically, in step S31, the current input text is converted into a vector, and the vector is used to perform similarity search in the memory library to obtain the historical context memory related to the current vector, that is, the related historical input text;
[0028] Step S32: Store the current vector and timestamp as contextual memory in the FAISS vector database.
[0029] In this embodiment, episodic memory refers to specific events related to personal experiences, each with a timestamp, similar to human episodic memory. This allows the agent to recall the specific scenes and details of interactions with specific users. This embodiment utilizes vector database technology to efficiently store and retrieve detailed conversation events. This allows for deep learning and understanding of historical conversations during retrieval, enabling each retrieval to be semantically linked to the current conversation context. This significantly enhances the personalized interaction experience for the conversational agent and enables it to generate more coherent, accurate, and empathetic responses. For example, 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 into a 1024-dimensional dense vector space to generate vectors. Cosine similarity searches are then performed on the vectors within the memory database to retrieve relevant historical text, and the current vectors are stored in the FAISS vector database. Furthermore, FAISS, as a repository for episodic memory, is specifically designed to handle high-dimensional vector search problems, making it particularly suitable for large-scale data. The flat index structure provided by FAISS enables storage and retrieval of vectors.
[0030] Step S4: performing a similarity search in the memory bank based on the desire type and the 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;
[0031] Specifically, step S41 converts the desire type and 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;
[0032] 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 values are stored in adjacent blocks or in the same block, a fast approximate nearest neighbor search can be achieved during retrieval.
[0033] 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 for fast and approximate similarity searches in large datasets without having to perform an exact high-dimensional space search, which greatly reduces computational costs.
[0034] Step S5, perform abstract memory retrieval in the memory bank based on the current input text to obtain historical abstract memory related to the current input text; and at the end of the current interaction cycle, summarize all input texts in the interaction cycle to obtain a daily event summary, and store the daily event summary as an abstract memory in the memory bank.
[0035] 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}.
[0036] In this embodiment, the conversation content is transformed into a higher-level representation through abstract memory.
[0037] 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, forming a hierarchical memory structure. For example, an interaction cycle can be one day, and can also be set specifically as needed.
[0038] Step S6: Use the retrieved historical situational memory, historical semantic memory, and historical abstract memory as working memory; generate response text based on the working memory to interact; and clear the working memory at the end of the current round of interaction.
[0039] In this embodiment, working memory is the temporary storage of information currently being processed. For each task of generating a personalized response, working memory provides all memories relevant 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 memories. 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 the user's behavior and preferences, based on which an accurate and personalized response is generated. Dynamic management of working memory ensures that working memory remains focused on the current task, avoiding interference from irrelevant information, thereby improving the efficiency of cognitive processing.
[0040] A second embodiment of the present invention provides a personalized memory assistance interactive system based on a mental cognitive mechanism, comprising:
[0041] The mind module 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 based on the input text;
[0042] 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, which summarizes all input texts in the interaction cycle by calling LLM.
[0043] A memory retrieval module is used to retrieve episodic memories from the memory bank based on the current input text to obtain episodic memories related to the current input text; it is also used to retrieve semantic memories from the memory bank based on the desire type and personal role summary to obtain semantic memories related to the current desire type and personal role summary; it is also used to retrieve abstract memories from the memory bank based on the current input text to obtain abstract memories related to the current input text;
[0044] A memory storage module is used to store the current input text and timestamp as episodic memory; to store desire types and personal role summaries as semantic memory; to store daily event summaries as abstract memory; and to use retrieved episodic memory, semantic memory, and abstract memory as working memory;
[0045] The dialogue generation module is used to generate response text based on working memory for interaction.
[0046] The above are only preferred embodiments of the present application and do not 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 for storing 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 based on 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 contextual memory retrieval in the memory bank based on the current input text to obtain historical contextual memory related to the current input text; And store the current input text and timestamp as contextual 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; The retrieved historical episodic memory, historical semantic memory, and historical abstract memory are used as working memory; response text is generated based on the working memory to interact; At the end of the current round of interaction, clearing the working memory; 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: The process of searching the memory bank for contextual memory based on the current input text to obtain historical contextual memory related to the current input text includes: The current input text is converted into a current vector respectively, and the current vector is used to perform similarity search in the memory library to obtain historical context memory related to the current vector.
3. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 2 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 contextual memory.
4. 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.
5. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 4 is characterized in that: The memory bank includes a hash table, and storing the desire type and the personal role summary as semantic memory in the memory bank includes: Store the hash index value into the hash table.
6. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 1 is characterized in that: The storage form of the abstract memory is: combining the daily event summaries of all interaction cycles into an event summary set according to the time sequence of the interaction cycles.
7. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 1 is characterized in that: Determining the desire type of the input text includes: The input text is input into a classification model to determine its desire type.
8. The personalized memory assistance interaction method based on mental cognitive mechanism according to claim 7 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.
9. A personalized memory assistance interactive system based on mental cognitive mechanism, characterized by: include: A memory bank construction module, used to construct a memory bank for storing episodic memory, semantic memory, and abstract memory; A mind module, configured to obtain 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; 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 configured to perform an episodic memory search in the memory bank based on the current input text to obtain historical episodic memories related to the current input text; further configured to perform a semantic memory search in the memory bank based on the desire type and the personal role summary to obtain historical semantic memories related to the current desire type and the personal role summary; and further configured to perform an abstract memory search in the memory bank based on the current input text to obtain historical abstract memories related to the current input text. a memory storage module configured to store the current input text and timestamp as episodic memory in a memory bank; further configured to store the desire type and personal role summary as semantic memory in the memory bank; further configured to store the daily event summary as abstract memory in the memory bank; and further configured to use the retrieved episodic memory, semantic memory, and abstract memory as working memory; a dialogue generation module, configured to generate response text based on the working memory for interaction; The clearing module is used to clear the working memory when the current round of interaction ends.
Citation Information
Patent Citations
Structured abstract dialogue method and system for background information enhancement, electronic equipment and storage medium
CN117453890A
Memory system of large model, intelligent agent and memory storage updating method of intelligent agent
CN118504603A