AI memory construction and virtual personality generation method based on full storage of dialog
By using full-volume structured dialogue storage and a personality mapping model, the problems of rigid virtual personalities and logical conflicts in AI dialogue systems have been solved, realizing the dynamic evolution and consistent performance of AI personalities, and improving the naturalness and immersion of human-computer interaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AOYUAN YUNCHUANG TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2026-02-26
- Publication Date
- 2026-06-02
AI Technical Summary
Existing AI dialogue systems lack systematic preservation and deep semantic mining of full dialogue data, making it difficult for virtual characters to maintain consistency, coherence and evolutionary ability in multi-round dialogues. Furthermore, traditional personality modeling lacks a dynamic coupling mechanism, resulting in virtual personalities becoming rigid, distorted or logically conflicting.
By constructing a multi-dimensional structured database through a full-volume dialogue structured storage mechanism, extracting multi-dimensional feature vectors, implementing a dynamic memory update mechanism, and building a personality mapping model, a closed-loop evolution mechanism of "memory input - feature extraction - personality expression - feedback learning" is formed to realize the dynamic evolution of AI personality.
It enables the dynamic evolution of AI personalities, enhances the naturalness and immersion of human-computer interaction, ensures the complete preservation of semantic continuity and contextual dependencies, solves the problems of virtual personality rigidity and logical conflicts, and supports the construction of intelligent agents with long-term trustworthy relationships.
Smart Images

Figure CN122133678A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and human-computer interaction technology, specifically to a method for constructing AI memory and generating virtual personalities based on full dialogue storage. Background Technology
[0002] With the deepening development of artificial intelligence technology, dialogue systems have gradually moved from simple question-and-answer interactions to the stage of building intelligent agents with personalized and persistent memory capabilities. Current mainstream AI dialogue models are mostly based on static parameterized personality settings or short-term contextual memory mechanisms, lacking systematic preservation and deep semantic mining of users' long-term interaction history. This makes it difficult for virtual characters to maintain consistent, coherent, and evolving personality traits in multi-turn dialogues. Especially in application scenarios requiring highly human-like interaction, such as emotional companionship, educational guidance, or virtual social interaction, AI urgently needs to build a traceable, reasonable, and updatable memory system from comprehensive dialogue data, and on this basis, generate dynamically evolving virtual personalities.
[0003] Among them, the AI memory construction and virtual personality generation method based on full dialogue storage aims to extract multi-dimensional features, including semantic preferences, emotional tendencies, behavioral patterns, and relationship cognition, by structurally archiving all historical dialogue content between users and AI, forming a high-dimensional memory representation. This method further combines the timeliness and importance weights of memories to achieve dynamic maintenance and optimization of the memory bank. Through a personality mapping model, memory features are transformed into calculable and iterative personality vectors, thereby supporting AI to exhibit personality behaviors consistent with its "growth trajectory" at different interaction stages.
[0004] However, existing technologies generally employ truncated context windows or keyword indexing mechanisms to process historical dialogues, failing to fully preserve semantic continuity and contextual dependencies, resulting in severe memory fragmentation. Simultaneously, traditional personality modeling relies heavily on pre-set labels or static embeddings, lacking a dynamic coupling mechanism with real interaction data, making it difficult to reflect the interactive nature of user-AI co-evolution. Furthermore, the high redundancy and noise interference of full-volume dialogue data make effective feature extraction difficult, while existing personality generation frameworks lack a closed-loop feedback path between memory updates and personality adjustments, leading to rigid, distorted, and even logically conflicting virtual personalities. Therefore, there is an urgent need for an AI virtual personality generation method that can integrate full-volume dialogue memories and support dynamic personality evolution. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method for constructing AI memories and generating virtual personalities based on full dialogue storage, thus solving the problems mentioned in the background technology.
[0006] To achieve the above objectives, this invention provides the following technical solution: an AI memory construction and virtual personality generation method based on full dialogue storage, comprising the following specific steps: S1: Establish a full-volume structured storage mechanism for dialogues, archive the complete dialogue texts between users and AI in all interaction cycles in a time-series manner without loss, and construct a multi-dimensional structured database containing original sentences, semantic parsing results, sentiment tags, topic classifications and contextual dependencies, using the conversation unit as the basic organizational unit, to form a traceable and searchable AI memory bank. S2: Extract multi-dimensional feature vectors from the AI memory bank, use a deep semantic analysis model to perform fine-grained analysis on each dialogue record, extract semantic preference features, emotional tendency evolution trajectory, behavioral response pattern, relationship cognition state and topic attention density, and integrate discrete features into a high-dimensional memory representation with time evolution characteristics through a temporal aggregation algorithm. S3: Implement a dynamic memory update mechanism. Calculate the initial importance weight of each newly entered dialogue based on its memory strength, information novelty, emotional salience, and relevance to existing memories. Combine this with a decay function to evaluate the timeliness of historical memories. When the overall weight of a memory falls below a preset threshold, a forgetting operation is triggered. At the same time, a reinforcement storage strategy is implemented for frequently activated or highly relevant memories to achieve adaptive optimization of the memory bank. S4: Construct a personality mapping model, taking the dynamically updated high-dimensional memory representation as input, and mapping it to a low-dimensional personality vector space through a nonlinear transformation layer. The personality vector consists of multiple interpretable dimensions, including openness, agreeableness, conscientiousness, emotional stability, and autonomous evolutionary tendency. The value of each dimension is determined by the weighted activation degree of the corresponding memory feature group and supports real-time adjustment as new memories are injected. S5: Generate and maintain an iterative virtual personality. Based on the current personality vector, adjust the AI's language style, emotional expression intensity, topic guidance strategy, and decision-making preferences in the new round of dialogue. At the same time, record the feedback signals generated by this interaction to correct the personality vector update path in reverse. This forms a closed-loop evolution mechanism of "memory input - feature extraction - personality expression - feedback learning", enabling the AI to exhibit an anthropomorphic personality performance that conforms to its interactive growth trajectory.
[0007] Preferably, the full-dialogue structured storage mechanism in S1 adopts a distributed time-series database architecture, which has the ability to process no less than 100,000 dialogue records per second, with a single record storage latency of less than 10 milliseconds. The data retention strategy supports permanent archiving and hierarchical encrypted access control to ensure the integrity and privacy security of the stored data.
[0008] Preferably, the deep semantic analysis model in S2 is based on an improved Transformer architecture, integrating named entity recognition, intent classification, sentiment polarity judgment and coreference resolution modules, with a word embedding dimension of 768, an attention head count of 12, and a maximum context window expanded to 16384 tokens, supporting cross-session long-distance semantic dependency modeling.
[0009] Preferably, the semantic preference features extracted in S2 include word usage frequency distribution, sentence complexity index, and the proportion of abstract concept mentions. The trajectory of sentiment evolution is represented by the positive and negative sentiment score integral curves within a sliding window. The behavioral response pattern covers response delay statistics, question initiative index, and topic continuation rate.
[0010] In S3, memory strength is determined by speech length, emotional concentration, and information entropy. Information novelty is calculated by the difference in semantic similarity with the most recent 30 dialogues on the same topic. Relevance is quantified based on the cosine distance between knowledge graph embedding vectors. The decay function adopts a double exponential composite model, with short-term memory decay time of 7 days and long-term memory half-life of 90 days.
[0011] Preferably, before the forgetting operation is performed in S3, conflict detection is required. If the memory to be forgotten has a logical supporting relationship with other high-weight memories, its retention priority is automatically increased and storage resources are reallocated to avoid the break of key cognitive chains.
[0012] Preferably, the training process of the personality mapping model in S4 adopts a supervised-self-supervised hybrid paradigm. The labeled dataset contains no less than 500,000 sets of human dialogues and their corresponding Big Five personality scores. The self-supervised task is designed to predict missing personality dimension values based on partially masked memory sequences. The loss function integrates mean squared error and ranking correlation index.
[0013] Preferably, in S4, the personality vector update adopts an incremental update rule, with a base learning rate of 0.01 and a momentum factor of 0.9 introduced to smooth fluctuations. When the angle between two adjacent update directions is greater than 60 degrees, a stability verification procedure is initiated to prevent personality mutations from causing behavioral distortions.
[0014] Preferably, in S5, language style regulation is achieved by controlling the top-p sampling parameters and repetition penalty coefficient of the generative model, the intensity of emotional expression is mapped to the fundamental frequency range and speech rate variables of the speech synthesis system, and the topic guidance strategy dynamically adjusts the exploration-utilization ratio based on the openness dimension value in the personality vector.
[0015] Preferably, the feedback signals in S5 include the user's explicit satisfaction score, dialogue interruption rate, active regression frequency, and implicit emotional resonance index, wherein the implicit emotional resonance index is calculated by the joint calculation of the emotional polarity synchronization rate and semantic synergy of both parties, and is used to drive the reverse fine-tuning of the personality vector.
[0016] Preferably, it also includes deploying a personality consistency monitoring module to compare the deviation between the current dialogue output and the historical personality profile in real time. When the deviation exceeds the threshold three times in a row, a personality stabilization intervention mechanism is triggered to force a return to the most recently verified stable vector state, thereby ensuring the credibility and consistency of the virtual personality.
[0017] Preferably, it also includes building a personality evolution log system to record and attribute every major change in personality vectors, generate a visualized growth trajectory map, support external debugging interface calls to review the logic chain of personality changes, and enhance the system's transparency and controllability.
[0018] Preferably, the method is applicable to multimodal interaction scenarios and can integrate multiple input forms such as text, voice, emoticons and action commands, uniformly encode them into standardized event entries in the memory bank, and ensure the integrated integration of cross-modal interaction experience and the calculation of personality influence.
[0019] Preferably, the method is applied to personalized education tutoring AI, which gradually forms a teaching personality that combines professional authority and emotional affinity by continuously accumulating teacher-student interaction memories, and adaptively adjusts the intensity of encouragement and guidance density at different learning stages to improve students' willingness to participate and the efficiency of knowledge absorption.
[0020] Preferably, the method is applied to an emotionally supportive virtual companion system. Based on intimate conversational history spanning months or even years, it develops highly personalized attachment patterns and empathy, proactively providing psychological support under stressful situations and exhibiting emotional memory recall behavior consistent with shared experiences. This invention provides an AI memory construction and virtual personality generation method based on full conversation storage, which has the following beneficial effects: (1) When the system is running, a full-scale dialogue structured storage mechanism is established to build a traceable multi-dimensional AI memory bank; multi-dimensional features such as semantic preferences, emotional tendencies, and behavioral patterns are extracted through a deep semantic analysis model and aggregated into a high-dimensional memory representation with time evolution characteristics; a dynamic update mechanism based on memory strength, novelty, relevance and decay function is implemented to achieve adaptive optimization of the memory bank; a personality mapping model is constructed to map the memory representation to a low-dimensional personality vector space composed of openness, agreeableness, conscientiousness, emotional stability and autonomous evolution tendency; the AI's language style, emotional expression and decision preference are regulated based on personality vectors, and a "memory-personality-feedback" closed-loop evolution mechanism is formed by combining user feedback signals.
[0021] (2) This invention establishes a full-scale dialogue structured storage mechanism, achieving lossless archiving and multi-dimensional semantic annotation of the entire interaction history between the user and the AI. This fundamentally overcomes the memory fragmentation problem caused by context window truncation in traditional methods, ensuring the complete preservation of semantic continuity and contextual dependencies. A deep semantic analysis model extracts multi-dimensional features such as semantic preferences, sentiment tendencies, and behavioral patterns, and a temporal aggregation algorithm is used to construct a high-dimensional memory representation with evolutionary characteristics, significantly improving the extraction accuracy and noise resistance of effective features. A dynamic update mechanism based on memory strength, novelty, relevance, and timeliness is introduced, enabling adaptive optimization of the memory bank. This not only eliminates redundant information in a timely manner but also strengthens key cognitive nodes, solving the problems of high redundancy and noise interference caused by full-scale data.
[0022] (3) By constructing a personality mapping model, the dynamically evolving memory representation is transformed into a computable and iterative personality vector, breaking through the limitations of traditional personality modeling that relies on preset labels or static embedding. This enables AI personalities to possess dynamic coupling capabilities driven by real interactive data. The resulting closed-loop evolution mechanism of "memory input—feature extraction—personality expression—feedback learning" allows virtual personalities to continuously grow and self-correct in long-term interactions, exhibiting highly human-like behavioral consistency and emotional depth. This completely changes the current situation where AI character personalities are rigid, distorted, and prone to logical conflicts. This method not only significantly improves the naturalness and immersion of human-computer interaction but also provides a solid technical foundation for building intelligent agents with long-term trustworthy relationships, possessing significant theoretical value and broad application prospects. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the overall technical solution architecture of the AI memory construction and virtual personality generation method based on full dialogue storage proposed in this invention; Figure 2 This is a schematic diagram of the core principle framework of the coupling mechanism between dynamic memory updating and personality mapping in this invention; Figure 3 This is a schematic diagram of the multi-level interaction relationship and data flow of the closed-loop evolution mechanism of "memory input - feature extraction - personality expression - feedback learning" in this invention. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0025] Example 1 This invention provides a method for constructing AI memories and generating virtual personalities based on full dialogue storage. Please refer to [link to relevant documentation]. Figure 1 This includes the following specific steps: S1: Establish a full-volume structured storage mechanism for dialogues, archive the complete dialogue texts between users and AI in all interaction cycles in a time-series manner without loss, and construct a multi-dimensional structured database containing original sentences, semantic parsing results, sentiment tags, topic classifications and contextual dependencies, using the conversation unit as the basic organizational unit, to form a traceable and searchable AI memory bank. S2: Extract multi-dimensional feature vectors from the AI memory bank, use a deep semantic analysis model to perform fine-grained analysis on each dialogue record, extract semantic preference features, emotional tendency evolution trajectory, behavioral response pattern, relationship cognition state and topic attention density, and integrate discrete features into a high-dimensional memory representation with time evolution characteristics through a temporal aggregation algorithm. S3: Implement a dynamic memory update mechanism. Calculate the initial importance weight of each newly entered dialogue based on its memory strength, information novelty, emotional salience, and relevance to existing memories. Combine this with a decay function to evaluate the timeliness of historical memories. When the overall weight of a memory falls below a preset threshold, a forgetting operation is triggered. At the same time, a reinforcement storage strategy is implemented for frequently activated or highly relevant memories to achieve adaptive optimization of the memory bank. S4: Construct a personality mapping model, taking the dynamically updated high-dimensional memory representation as input, and mapping it to a low-dimensional personality vector space through a nonlinear transformation layer. The personality vector consists of multiple interpretable dimensions, including openness, agreeableness, conscientiousness, emotional stability, and autonomous evolutionary tendency. The value of each dimension is determined by the weighted activation degree of the corresponding memory feature group and supports real-time adjustment as new memories are injected. S5: Generate and maintain an iterative virtual personality. Based on the current personality vector, adjust the AI's language style, emotional expression intensity, topic guidance strategy, and decision-making preferences in the new round of dialogue. At the same time, record the feedback signals generated by this interaction to correct the personality vector update path in reverse. This forms a closed-loop evolution mechanism of "memory input - feature extraction - personality expression - feedback learning", enabling the AI to exhibit an anthropomorphic personality performance that conforms to its interactive growth trajectory.
[0026] Example 2 This embodiment is an explanation based on Embodiment 1. Please refer to it. Figure 1 For details: see reference Figure 3The schematic diagram of the overall technical solution architecture shown illustrates that the core process of the method described in this invention consists of five major steps. These steps are tightly coupled through data flow and control signals, forming a complete, adaptive, and evolving intelligent personality generation system. In the aforementioned AI memory construction and virtual personality generation method based on full-volume dialogue storage, step S1 establishes a full-volume dialogue structured storage mechanism. This mechanism archives the complete dialogue text between the user and AI throughout all interaction cycles in a lossless manner according to time sequence. Using the dialogue unit as the basic organizational unit, a multi-dimensional structured database is constructed, containing original statements, semantic parsing results, sentiment tags, topic classifications, and contextual dependencies, forming a traceable and searchable AI memory bank. Specifically, step S1, the full-volume dialogue structured storage mechanism, adopts a distributed time-series database architecture. This architecture is deployed on multiple physical nodes and uses a consistent hashing algorithm to achieve data sharding and load balancing, ensuring that the system has the ability to process no less than 100,000 dialogue records per second, with an end-to-end latency of less than 10 milliseconds from receipt to persistent storage of a single record.
[0027] Each dialogue record is encapsulated as a standardized event entry, whose internal structure includes fields such as: Session ID, User ID, Timestamp (accurate to microseconds), Original Message Content, Message Type (text, speech-to-text, emoji encoding, action commands, etc.), Sender Identifier, Receiver Identifier, and reserved extended fields. During data writing, the system synchronously calls the semantic parsing engine to process the original message content in real time, generating semantic parsing results, sentiment tags, topic classifications, and contextual dependencies, and storing this metadata as additional fields in the database. Semantic parsing results include part-of-speech tagging sequences, dependency syntax trees, named entity recognition lists and their types; sentiment tags are output by the sentiment analysis module, using five levels of discrete values (-2 to +2) to represent sentiment polarity intensity; topic classification is based on a pre-trained topic model, assigning messages to one of hundreds of predefined topic categories; contextual dependencies are determined through referencing resolution and coreference chain construction algorithms, recording a list of historical message IDs referenced by the current message. The data retention policy supports a permanent archiving mode and implements hierarchical encrypted access control. The original message content is encrypted using the AES-256 algorithm, and the key is derived from the user's master key to ensure the integrity and privacy of the stored data.
[0028] Example 3 This embodiment is an explanation based on Embodiment 1. Please refer to it. Figure 1-3Specifically, in the aforementioned AI memory construction and virtual personality generation method based on full dialogue storage, step S2 extracts multi-dimensional feature vectors from the AI memory bank, uses a deep semantic analysis model to perform fine-grained analysis on each dialogue record, extracts semantic preference features, emotional tendency evolution trajectory, behavioral response pattern, relational cognitive state, and topic attention density, and integrates discrete features into a high-dimensional memory representation with temporal evolution characteristics through a temporal aggregation algorithm. Specifically, in step S2, the deep semantic analysis model is based on an improved Transformer architecture, with a 24-layer encoder stack, a word embedding dimension of 768, 12 attention heads, and a maximum context window expanded to 16384 tokens, enabling it to effectively model long-distance semantic dependencies across multiple conversation units. This model integrates four core sub-modules: a named entity recognition module for identifying and classifying entities such as names, locations, organizations, and dates; an intent classification module using a multilayer perceptron to discern the potential targets behind user speech; and an emotion polarity judgment module based on a bidirectional LSTM network to output fine-grained emotion scores. The coreference resolution module utilizes a span-based method to resolve the referential relationship between pronouns and noun phrases. At the feature extraction level, semantic preference features include vocabulary usage frequency distribution (statistically analyzing frequently used specific words and their proportion in the total vocabulary), sentence complexity index (derived by calculating the average dependency distance and nesting depth of sentences), and abstract concept mention ratio (using knowledge bases such as WordNet to determine the abstraction level of words and calculate their frequency of occurrence). The sentiment trend trajectory is not a single snapshot but is represented by a positive and negative sentiment score integral curve within a sliding window. This curve has a time resolution of 1 day and a window size of 7 days. A smooth sentiment trend line is obtained by weighted integration of all sentiment scores within the window. Behavioral response patterns encompass response latency statistics (recording the mean and variance of the time interval between the AI receiving a user message and issuing a reply), question initiative index (calculating the proportion of times the AI proactively asks questions out of the total number of messages), and topic continuity rate (measuring the success rate of the AI successfully guiding the user back to the original topic or related sub-topics after the user switches topics). All these discrete, record-oriented features are integrated using a temporal aggregation algorithm. The algorithm first aligns the features by timestamp, then uses a gated recurrent neural network (GRU) to encode the sequence, and finally outputs a fixed-dimensional high-dimensional memory representation vector. Each dimension of the vector contains the evolutionary information of a specific semantic or behavioral pattern in the time dimension.
[0029] Example 4 This embodiment is an explanation based on Embodiment 1. Please refer to it. Figure 1Specifically: In the above-mentioned AI memory construction and virtual personality generation method based on full dialogue storage, S3 implements a dynamic memory update mechanism. Based on the memory strength, information novelty, emotional salience, and correlation with existing memories of each newly entered dialogue, its initial importance weight is calculated. The timeliness of historical memories is evaluated in conjunction with a decay function. When the comprehensive weight of a memory is lower than a preset threshold, a forgetting operation is triggered. At the same time, a reinforcement storage strategy is implemented for high-frequency activated or highly correlated memories to achieve adaptive optimization of the memory bank. Specifically, in S3, memory strength is determined by a weighted sum of three factors: speech length (in characters), emotional concentration (absolute value of emotional polarity), and information entropy (calculated based on lexical diversity), with weighting coefficients of 0.4, 0.4, and 0.2, respectively. Information novelty is quantified by calculating the semantic similarity difference between the current dialogue content and the last 30 dialogues on the same topic. Semantic similarity is calculated using the Sentence-BERT model to calculate cosine similarity; novelty is 1 minus this similarity. Relevance is quantified based on the cosine distance between knowledge graph embedding vectors. The system maintains a dynamically updated knowledge graph, linking entities and relationships extracted from the dialogue. Each memory corresponds to one or more nodes in the graph, and its relevance is the average connection strength with other high-weight nodes in the graph. The initial importance weight Winitial is calculated using the following formula: ; Where S, N, E, and R represent memory strength, information novelty, sentiment salience (absolute value of sentiment polarity), and relevance, respectively; α, β, γ, and δ are configurable hyperparameters with default values of 0.3, 0.3, 0.2, and 0.2, respectively. After memory storage, its weight decays over time t (in days) according to a decay function. The decay function uses a double exponential composite model, and its expression is: Among them, the short-term component weight w s =0.7, attenuation rate λ s =ln(2) / 7 (corresponding to a 7-day decay time), long-term component weight w l =0.3, attenuation rate λ l=ln(2) / 90 (corresponding to a 90-day half-life). A scheduled task runs in the background of the system to periodically scan all memory entries and calculate their current comprehensive weight W(t). When W(t) is lower than a preset threshold (e.g., 0.1), it is marked as a candidate for forgetting. Before performing the forgetting operation, the system needs to perform conflict detection. By traversing the knowledge graph, it checks whether the memory to be forgotten serves as a logical premise or supporting evidence for other high-weight memories (W(t)>0.5). If so, it automatically increases its retention priority and reallocates storage resources to avoid breaking the key cognitive chain. Conversely, for those memories that are frequently queried or have a high degree of correlation with other memories, the system will copy them to the cache layer and increase their initial weight, implementing a reinforced storage strategy.
[0030] S4 involves constructing a personality mapping model. The dynamically updated high-dimensional memory representation is taken as input and mapped to a low-dimensional personality vector space through a nonlinear transformation layer. This personality vector consists of multiple interpretability dimensions, including openness, agreeableness, conscientiousness, emotional stability, and autonomous evolutionary tendency. The values of each dimension are determined by the weighted activation degree of the corresponding memory feature group and can be adjusted in real-time with the injection of new memories. Specifically, S4, the personality mapping model, is a multi-layer fully connected neural network. Its input layer receives the high-dimensional memory representation vector (1024 dimensions) from S2. After nonlinear transformation through three hidden layers (dimensions of 512, 256, and 128 respectively), it finally outputs a 5-dimensional personality vector. The training process of this model adopts a supervised-self-supervised hybrid paradigm. The supervised learning part uses a large-scale labeled dataset containing no fewer than 500,000 sets of human dialogue records. Each set of records is rated by psychological experts according to the Big Five personality theory, with ratings ranging from 1 to 5. The self-supervised learning task is designed to predict missing personality dimension values based on partially masked memory sequences. This involves randomly masking certain time segments of the input memory representation, requiring the model to reconstruct the complete personality vector based only on the remaining segments. The loss function integrates mean squared error (MSE) and ranking correlation. The former ensures the minimum absolute error between the predicted and true values, while the latter guarantees the correct relative ranking of personality dimensions across different samples. After model deployment, personality vector updates employ an incremental update rule. Whenever a new high-dimensional memory representation is generated, the model performs a forward propagation to obtain a new predicted personality vector value. The difference between this predicted value and the current personality vector, multiplied by the base learning rate of 0.01, serves as the step size for this update. To prevent drastic fluctuations in personality due to noisy data, a momentum factor of 0.9 is introduced to incorporate historical update directions. In addition, the system has a built-in stability verification program that monitors the angle between two adjacent update directions in real time. When the angle is greater than 60 degrees, it is judged as a potential risk of personality mutation. At this time, direct updates will be paused and the verification program will be started instead. The program will backtrack the last 10 interactions, recalculate a more robust average update direction, and apply only a small part (e.g., 30%) of the average direction to the current personality vector, thereby effectively preventing behavioral distortion caused by personality mutation.
[0031] Example 5 A method for constructing AI memories and generating virtual personalities based on full dialogue storage. Please refer to [link / reference]. Figure 2Specifically: S5 generates and maintains an iterative virtual personality, and adjusts the AI's language style, emotional expression intensity, topic guidance strategy and decision preference in the new round of dialogue based on the current personality vector. At the same time, it records the feedback signals generated by this interaction, which are used to correct the personality vector update path in reverse, forming a closed-loop evolution mechanism of "memory input - feature extraction - personality expression - feedback learning", so that the AI can show an anthropomorphic personality performance that conforms to its interaction growth trajectory. Specifically, in S5, language style regulation is achieved by transmitting control signals to downstream dialogue generation models (such as the GPT series). These signals directly affect the sampling parameters of the generation process. For example, when the conscientiousness dimension value in the personality vector is high, the system will reduce the top-p sampling parameter (e.g., from 0.9 to 0.7) and increase the repetition penalty coefficient to generate more rigorous and information-dense responses. The intensity of emotional expression is mapped to the fundamental frequency range and speech rate variables of the speech synthesis system. If the emotional stability dimension value is low and the current emotional tendency is negative, the fundamental frequency range will be appropriately reduced and the speech rate will be slowed down to convey empathy and reassurance. The topic guidance strategy dynamically adjusts the exploration-exploitation ratio based on the openness dimension value in the personality vector. When openness is high, the system tends to introduce new topics (exploration), and conversely, it focuses more on deepening the current topic (exploitation). After each dialogue, the system collects and calculates various feedback signals, including the user's explicit satisfaction score (obtained through an interface button), the dialogue interruption rate (the proportion of users who do not respond after the AI's reply), the active return frequency (the number of times the user actively initiates a new dialogue within 24 hours), and the implicit emotional resonance index. Among them, the implicit emotional resonance index is a key feedback metric that does not require active user input. It is jointly calculated by the emotional polarity synchronization rate (the ratio of identical emotional polarity symbols between the user and the AI in multiple consecutive rounds of dialogue) and semantic coherence (derived by calculating the moving average of the cosine similarity of the semantic vectors of the two parties' utterances). These feedback signals are aggregated into a feedback vector, which is used to drive the inverse fine-tuning of the personality vector. The fine-tuning process updates the weights of the last few layers of the personality mapping model through small backpropagation by calculating the gradient between the feedback vector and each dimension of the personality vector, thereby establishing a direct learning pathway from external behavioral feedback to internal personality state.
[0032] To further enhance the robustness and controllability of the system, this invention also includes a personality consistency monitoring module. Before each AI-generated response, this module invokes a lightweight discriminative model to compare the deviation between the currently generated response content and the expected response features based on historical personality profiles in real time. This deviation is quantified by calculating the Euclidean distance between the style embedding vector of the response and the ideal style center point corresponding to the personality vector. When this deviation exceeds a preset threshold three times consecutively, the system determines that personality drift or distortion may have occurred and triggers a personality stabilization intervention mechanism. This mechanism forcibly rolls back the current personality vector to the most recent stable vector state confirmed by the user or verified internally by the system, and then regenerates the current round of dialogue based on this state. Furthermore, this invention also includes constructing a personality evolution log system. This system records in detail every significant change event in the personality vector (e.g., a change in any dimension exceeding 0.2). The log content includes the vector values before and after the change, the ID of the key memory entry that triggered the change, related feedback signals, and attribution analysis of the cause of the change (derived through feature importance analysis). These log data are used to generate a visualized growth trajectory map, displaying the evolution curves of each personality dimension in the form of a timeline, and supporting external debugging interface calls, allowing developers or researchers to examine the complete logical chain behind any personality change, greatly enhancing the transparency and controllability of the system.
[0033] As a specific application example of this invention, the method can be applied to personalized education tutoring AI scenarios. In this scenario, the AI teacher gradually forms a teaching personality that combines professional authority with emotional affinity by continuously accumulating all interaction memories with a specific student. For example, in the initial interaction, if a student shows fear of mathematics (negative emotional tendency, low topic attention density), the AI's memory bank will record this state, and the agreeableness and emotional stability dimensions in its personality vector will be adjusted accordingly. In subsequent dialogues, the AI will adopt a more encouraging language style (high agreeableness) and actively introduce interesting mathematical stories (high openness) to stimulate interest. As the student's knowledge level improves and confidence is built, the AI will observe positive feedback signals such as an increase in the student's initiative to ask questions and a decrease in the rate of dialogue interruption, thereby gradually increasing the conscientiousness dimension and increasing the difficulty of practice questions and the density of guidance. This dynamic adjustment of personality makes the teaching strategy highly matched with the student's learning state and emotional needs, thereby significantly improving the student's willingness to participate and the efficiency of knowledge absorption.
[0034] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for constructing AI memories and generating virtual personalities based on full dialogue storage, characterized by: Includes the following steps: S2. Extract multi-dimensional feature vectors from the memory bank, use a semantic analysis model to perform fine-grained analysis of the dialogue content, obtain semantic preferences, changes in emotional tendencies, behavioral response patterns, relationship cognition status and topic attention density, and form a high-dimensional memory representation with time evolution characteristics through temporal aggregation. S3. Calculate the importance of newly entered dialogues based on memory strength, information novelty, emotional salience, and relevance to existing memories, and combine the decay mechanism to evaluate the timeliness of historical memories. When the overall importance is below the threshold, perform the forgetting operation, and at the same time strengthen the storage of high-frequency activated or highly associated memories. S4. Input the updated high-dimensional memory representation into the personality mapping model, and generate a low-dimensional personality vector containing openness, agreeableness, conscientiousness, emotional stability and autonomous evolutionary tendency through nonlinear transformation. S5. Based on the personality vector, the AI is regulated in subsequent dialogues to control its language expression, emotional output, topic guidance, and decision preferences, and the personality vector update path is corrected according to the interactive feedback to form a closed-loop evolution mechanism.
2. The AI memory construction and virtual personality generation method based on full dialogue storage according to claim 1, characterized in that: The full-volume dialogue structured storage mechanism in S1 adopts a distributed time-series database architecture, which has the ability to write no less than 100,000 dialogue records per second, with a single record storage latency of less than 10 milliseconds. The data retention strategy supports permanent archiving and hierarchical encrypted access control.
3. The AI memory construction and virtual personality generation method based on full dialogue storage according to claim 1, characterized in that: The deep semantic analysis model in S2 is based on the improved Transformer architecture and integrates modules for named entity recognition, intent classification, sentiment polarity judgment and coreference resolution. The word embedding dimension is 768, the number of attention heads is 12, and the maximum context window is expanded to 16384 tokens. The semantic preference features include word usage frequency distribution, sentence complexity index, and the proportion of abstract concept mentions; The trajectory of the emotional tendency evolution is represented by the positive and negative emotional score integral curves within a sliding window; the behavioral response mode covers response delay statistics, question initiative index, and topic continuation rate.
4. The AI memory construction and virtual personality generation method based on full dialogue storage according to claim 1, characterized in that: In S3, memory strength is determined by speech length, emotional concentration, and information entropy. Information novelty is calculated by the difference in semantic similarity with the most recent 30 dialogues on the same topic. Relevance is quantified based on the cosine distance between knowledge graph embedding vectors. The decay function adopts a double exponential composite model. The short-term memory decay time is 7 days, and the long-term memory half-life is 90 days.
5. The AI memory construction and virtual personality generation method based on full dialogue storage according to claim 4, characterized in that: Before the forgetting operation in S3 is executed, conflict detection is required. If the memory to be forgotten has a logical support relationship with other high-weight memories, its retention priority is automatically increased and storage resources are reallocated.
6. The AI memory construction and virtual personality generation method based on full dialogue storage according to claim 1, characterized in that: The training process of the personality mapping model in S4 adopts a supervised-self-supervised hybrid paradigm. The labeled dataset contains no less than 500,000 sets of human dialogues and their corresponding Big Five personality scores. The self-supervised task is designed to predict missing personality dimension values based on partially masked memory sequences. The loss function integrates mean squared error and ranking correlation index.
7. The method for constructing AI memory and generating virtual personality based on full dialogue storage according to claim 1, characterized in that: In S4, the personality vector update adopts an incremental update rule, with a base learning rate of 0.01 and a momentum factor of 0.9 introduced to smooth fluctuations. When the angle between two adjacent update directions is greater than 60 degrees, a stability verification procedure is initiated.
8. The AI memory construction and virtual personality generation method based on full dialogue storage according to claim 1, characterized in that: In S5, language style regulation is achieved by controlling the top-p sampling parameters and repetition penalty coefficient of the generative model. The intensity of emotional expression is mapped to the fundamental frequency range and speech rate variables of the speech synthesis system. The topic guidance strategy dynamically adjusts the exploration-utilization ratio based on the openness dimension value in the personality vector.
9. The AI memory construction and virtual personality generation method based on full dialogue storage according to claim 1, characterized in that: The feedback signals in S5 include explicit user satisfaction scores, conversation interruption rate, active regression frequency, and implicit emotional resonance index. The implicit emotional resonance index is calculated by combining the emotional polarity synchronization rate and semantic synergy of both parties and is used to drive the reverse fine-tuning of personality vectors.
10. The method for constructing AI memory and generating virtual personality based on full dialogue storage according to claim 1, characterized in that: It also includes deploying a personality consistency monitoring module to compare the deviation between the current dialogue output and the historical personality profile in real time. When the deviation exceeds the threshold three times in a row, a personality stabilization intervention mechanism is triggered. It also includes building a personality evolution log system to record and attribute every major change in personality vectors, generate a visualized growth trajectory map, and support external debugging interface calls to review the logic chain of personality changes.