A memory evolution method with conflict resolution mechanism based on medical scene

By adopting a three-database separate memory storage architecture and a multi-dimensional evaluation mechanism, the problems of memory fragmentation and security in medical interaction systems are solved, realizing intelligent management and security verification of medical data, and improving the compliance and security of the system.

CN122507771APending Publication Date: 2026-08-04GUANGDONG EMBOSSED STORM ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG EMBOSSED STORM ROBOT CO LTD
Filing Date
2026-05-18
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing medical interaction systems suffer from problems such as fragmented memory, missing conflicts, lack of value assessment mechanisms, and lack of security verification mechanisms during long-term interactions. This leads to non-compliant medical data management, high security risks, and difficulty in achieving continuous accumulation and full-cycle traceability of patient health information.

Method used

It adopts a three-database memory storage architecture, including a short-term working memory bank, a long-term episodic memory bank, and a pathological memory bank. Through steps such as structured data extraction, multi-dimensional memory value assessment, conflict detection and fusion adjudication, and security verification, it realizes intelligent management and continuous evolution of medical memory.

Benefits of technology

It enables the classified management of medical conversation information and long-term health information, ensuring the compliance and security of medical data, systematically solving the problems of memory fragmentation and high redundancy, and improving the automation and intelligence level of medical memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122507771A_ABST
    Figure CN122507771A_ABST
Patent Text Reader

Abstract

The application relates to the field of artificial intelligence medicine, in particular to a memory evolution method with a conflict resolution mechanism based on a medical scene, which is oriented to medical health conversation, and first establishes a separate memory bank for each user, including a short-term working memory bank, a long-term episode memory bank and a pathology memory bank for storing historical pathological knowledge and diagnosis conclusions. According to the patient ID, interactive data is processed to generate structured data, new memory triples are extracted from the structured data, double deduplication and abstract compression are carried out based on semantics and the pathology memory bank, a new memory set to be evaluated is generated, the memory importance is evaluated through a multi-dimensional weighted scoring function, the memory is classified as a conversation-level memory and a long-term value memory, conflict detection is carried out on the memory with long-term value, the conflict memory is fused and judged based on a confidence weighting rule, and finally, the conflict-free memory and the fused memory are written into the long-term episode memory bank and the index is updated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence medical technology, specifically to a memory evolution method with a conflict resolution mechanism based on medical scenarios. Background Technology

[0002] With the rapid development of speech recognition, natural language processing, and large language model technologies, intelligent voice interaction systems have been widely applied in healthcare scenarios such as health management, chronic disease follow-up, and home-based medical consultation. These systems can understand patients' health needs and provide corresponding services through multi-turn dialogues. However, in the long-term process of medical interaction, existing technologies still have many shortcomings that prevent them from fully adapting to the core needs of healthcare scenarios:

[0003] First, there is a lack of fragmented and structured memory. Existing medical interaction systems typically store conversation history in the form of raw text or simple logs, lacking the ability to perform deep semantic analysis and structured extraction of medical data. This makes it impossible to extract reusable and reasonable medical knowledge units from the dialogue, hindering the continuous accumulation and full-cycle traceability of patient health information.

[0004] Second, there is a lack of memory conflict and consistency control. In long-term, multi-round medical interactions, patients may provide contradictory health data at different times, or the system may derive inconsistent medical conclusions in different contexts. Existing systems generally lack proactive memory consistency detection and resolution mechanisms specific to medical scenarios. Conflicting information can directly contaminate the knowledge base and even lead to erroneous medical advice, posing serious medical safety risks.

[0005] Third, there is a lack of mechanisms for assessing the value of memory. Existing solutions mostly use full storage or simple time-sliding window strategies, which cannot distinguish between session-level temporary information and health knowledge with long-term medical value. This results in a bloated knowledge base, low retrieval efficiency, and a large amount of noisy information interfering with the accurate retrieval of core medical knowledge.

[0006] Fourth, there is a lack of mechanisms for fusing conflicting medical memories. When conflicts between new and old medical memories are detected, existing methods often employ simple overwrite or discard strategies, lacking a multi-dimensional intelligent fusion mechanism based on the authority, timeliness, and confidence of medical data. This makes it impossible to retain valid historical medical information while incorporating newer and more reliable health data.

[0007] Fifth, there is a lack of medical security verification mechanisms. Existing general memory management solutions do not have tiered security verification rules for medical data, which cannot meet the stringent regulatory requirements for data accuracy and compliance in medical scenarios, posing both compliance and security risks.

[0008] In summary, there is an urgent need in this field for a memory evolution method with a complete conflict resolution mechanism tailored for medical and health scenarios, to address the aforementioned pain points of existing technologies and realize the structured extraction, value classification, conflict management, security verification, and continuous evolution of medical interactive memories. Summary of the Invention

[0009] The purpose of this invention is to address the problems in the background art and provide a memory evolution method with a conflict resolution mechanism based on a medical scenario.

[0010] The above-mentioned technical objective of the present invention is achieved through the following technical solution:

[0011] A memory evolution method with conflict resolution mechanism based on a medical scenario, the specific steps of which include:

[0012] S1. Memory bank establishment: A separate memory bank is established for each patient ID, which includes a short-term working memory bank, a long-term episodic memory bank, and a pathological memory bank; the pathological memory bank stores the historical pathological knowledge and diagnostic conclusions corresponding to the patient ID.

[0013] S2. Data source generation: Based on the patient ID, process the data generated during the voice interaction to generate structured data information A with source labels for memory evolution;

[0014] S3. Newborn Memory Extraction: During the response completion phase of each round of voice interaction, a structured newborn memory triple A1 is extracted from the structured data information A. Based on semantic similarity, core predicate consistency and timestamp, the newborn memory triple A1 is subjected to cross-database redundancy filtering with existing memories in the long-term episodic memory bank and historical pathological knowledge in the pathological memory bank. Then, the summary is compressed by a text summarization model of medical domain knowledge to generate a newborn memory set B to be evaluated.

[0015] S4. Memory Value Assessment and Classification: The importance score of each neonatal memory triplet in the neonatal memory set B to be evaluated is calculated using a multi-dimensional weighted scoring function. Based on a preset threshold, it is classified into memory B1, which has only conversational value, and memory B2, which has long-term value. Memory B1, which has only conversational value, is directly written into the short-term working memory bank and its survival time is set. Memory B2, which has long-term value, is marked as an item to be written into long-term memory C.

[0016] S5, Conflict Detection, Fusion Resolution, Security Verification, and Long-Term Write: Perform the following operations on the long-term memory item C to be written:

[0017] S5-1, Conflict Detection: Perform a thematic consistency check between the long-term memory item C to be written and the existing memories in the long-term episodic memory bank. For each memory in the long-term memory item C to be written, perform three checks in sequence: patient entity alignment, medical concept alignment, and temporal context alignment. When all three checks pass, mark it as a long-term memory item C1 to be tested. If any check fails, mark it as a long-term memory item C2 to be written with independent themes. Perform a medical scene-specific conflict type check on the long-term memory item C1 to be tested, and generate conflict-free long-term memory item C11 and conflicting long-term memory item C12 to be written.

[0018] S5-2, Fusion Decision: For conflicting long-term memory items C12, a fusion decision is made based on the confidence weighting rule to generate a fused long-term memory item C3.

[0019] S5-3, Security Verification and Write Update: The long-term memory items C2 (which do not require detection), C11 (which are conflict-free), and C3 (which are merged) are aggregated into a set of memory items C4 for security verification. Medical security access control verification is then performed on these items. Memory items C5 that pass the security verification are written into the long-term narrative memory database. At the same time, all memory content written into the long-term narrative memory database is converted into standardized natural language descriptions, which are then converted into semantic vectors by a vectorization encoding unit and written as nodes into the HNSW index. Additionally, the core medical entities, predicates, and timestamps of each memory item are stored as metadata filter fields (payload / metadata filter) of the vector node, enabling accurate semantic retrieval of medical memories.

[0020] Preferably, in S1, all data in the short-term working memory bank, long-term episodic memory bank, and pathological memory bank are uniquely bound to the patient ID, supporting full-cycle memory retrieval and tracing from the patient's initial record to the current moment across the entire historical time range.

[0021] Preferably, in S2, the structured data information A is generated in the following way: the interaction information is acquired through the voice acquisition module of the intelligent voice interaction system, converted into text data through voice recognition, and then the interaction intent is parsed through the intent classification model to generate multi-source structured data containing the final recognition text, structured detection data, and final response text; wherein the final recognition text is labeled with the source tag A_user_statement for the patient's self-reported health data, the structured detection data is labeled with the source tag A_device / lab for the medical device detection data, and the final response text is labeled with the source tag A_model_infer for the large language model inference derived data.

[0022] Preferably, the specific steps for retrieving neonatal memories in S3 include:

[0023] S3-1, Structured Information Extraction: A lightweight information extraction model is used to identify and extract neonatal memory triples A1 from structured data information A. The categories of neonatal memory triples A1 include patient statements of facts, patient expressions of concern, system findings and conclusions, system suggestions and plans, and timestamps.

[0024] S3-2, Dual Redundancy Processing: The newborn memory triplet A1, the existing memories in the long-term episodic memory bank, and the relevant historical pathological knowledge in the pathological memory bank are converted into high-dimensional semantic vectors through the same semantic coding model. The semantic similarity sim is calculated using the cosine similarity function. If and only if sim ≥ the preset semantic similarity threshold and the core predicates are completely identical, it is determined to be a duplicate. For the memory triplet determined to be duplicated, the redundancy is filtered by comparing the timestamp difference with the preset time threshold, and an updated newborn memory triplet is generated.

[0025] S3-3, Abstract Compression: For the updated neonatal memory triplet, semantic compression of the natural language description fields is performed using a text summarization model based on medical domain knowledge to generate a neonatal memory set B to be evaluated.

[0026] Preferably, in step S4, the calculation formula for the multi-dimensional weighted scoring function is as follows:

[0027] S(K)=α×F_r(K)+β×F_e(K)+γ×F_t(K)+δ×F_a(K)

[0028] Where α, β, γ, and δ are configurable weight coefficients, α, β, γ, and δ ∈ [0,1] and satisfy α+β+γ+δ=1; S(K) is the importance score of the neonatal memory triple K to be evaluated, F_r(K) is the repetition frequency score, F_e(K) is the patient emphasis signal score, F_t(K) is the medical topic relevance score, and F_a(K) is the source authority score;

[0029] The source authority score is weighted according to the priority of the source tag, and the weighting rule is: A_device / lab > A_user_statement > A_model_infer.

[0030] Preferably, in step S4, the lifespan of the memory data in the short-term working memory is a configurable parameter, and the system automatically cleans up memory data that has exceeded its validity period.

[0031] Preferably, in S5-1, the medical scenario-specific conflict types include the following three categories, and satisfying any one of them is considered a conflict:

[0032] Numerical range conflict: The objects of the memory item to be tested and the existing memory items are both numerical medical indicators, and the numerical difference exceeds the reasonable fluctuation range preset by the medical indicator.

[0033] Classification state conflict: The objects of the memory item to be tested and the existing memory items are both state-type medical results, and the states belong to predefined mutually exclusive medical categories;

[0034] Mutually exclusive event conflict: The memory item to be tested and the existing memory item describe mutually exclusive events in medicine.

[0035] Preferably, the specific steps of the fusion decision in S5-2 include:

[0036] S5-2-1, Confidence Initialization: Assign initial confidence to conflicting long-term memory items C12 and corresponding conflicting existing memories. The initial confidence is determined based on the source authority of the memory item and the information extraction confidence.

[0037] S5-2-2, Confidence Adjustment: Based on the time decay rule and the source priority rule, the confidence is adjusted in the following order and formula: (1) Time decay rule: For each memory item K, calculate its time decay factor relative to the current time decay factor decay(K)=exp(-Δt(K) / τ), where Δt(K) is the time difference between the timestamp of K and the current time, and τ is the time decay constant; (2) Source priority rule: Define the source bonus src_bonus(K)=0.2 (if K.source=A_user_statement and is an explicit statement in this round) or 0.1 (if K.source=A_device / lab) or 0 (if K.source=A_model_infer); (3) Adjusted confidence: confidence_adjusted(K)=clip(confidence_init(K)×decay(K)+src_bonus(K),0,1), that is, the two rules are superimposed according to "multiplicative decay and additive source bonus";

[0038] S5-2-3, Decision Execution: Compare the adjusted confidence level conf(C12) with conf(existing): (a) If conf(C12) - conf(existing) > threshold θ: Overwrite the existing memory with C12; (b) If conf(existing) - conf(C12) > threshold θ: Discard C12, keep the existing memory unchanged, and downgrade C12 to short-term working memory to preserve session-level visibility; (c) If |conf(C12) - conf(existing)| ≤ threshold θ, then keep both and attach a conflict flag {conflict_pair: [id_C12,id_existing]}, and finally generate the fused item C3 to be written to long-term memory (overwriting path a) or keep the coexisting pair (path c). Path b does not generate C3.

[0039] Preferably, in S5-3, the medical security access control verification performs hierarchical verification rules based on the source label of the memory item:

[0040] ① For memory items with the source label A_user_statement, they first undergo patient statement anomaly detection. Based on rules and the medical knowledge base, it is determined whether the statement content is within a reasonable physiological range and whether it seriously contradicts the existing pathological memory bank. If the anomaly detection is passed, it is marked as "awaiting clinical verification" and written into the long-term episodic memory bank. If the anomaly detection is not passed, it is downgraded to a memory with only conversational value and written into the short-term working memory bank, and clinical attention prompts are triggered.

[0041] ② For memory items with the source label A_device / lab, verify that their values ​​are within a reasonable physiological range and the instrument's detection range to pass the security check;

[0042] ③ For memory items with the source label A_model_infer, the following two checks must be performed sequentially: (a) Clinical evidence anchoring check: Check whether the memory item is associated with at least one data point under the same patient ID, with a timestamp within the last 90 days, and sourced from A_device / lab or A_user_statement; if there is no association, the check fails; (b) Authoritative knowledge base citation check: Based on a predefined whitelist of medical authoritative knowledge bases, check whether the key medical terms of the memory item can be mapped to at least one entry in the whitelist; if there is no mapping, the check fails; if the mapping is successful, the evidence_ref field is added to record the citation source; only memory items that pass both checks can pass the security check;

[0043] Memory items that fail the security check are downgraded to session-only memories and written to the short-term working memory.

[0044] As a preferred approach, each memory item written into the long-term episodic memory bank is converted into a standardized natural language description and a semantic vector is generated by a vectorization encoding unit. The HNSW index is then updated using this semantic vector as the node. At the same time, the core medical entity, predicate, and timestamp of the memory item are additionally stored as the metadata filter fields (payload / metadata filter) of the vector node. Subsequent retrieval supports joint queries of vector similarity retrieval and metadata filtering to achieve accurate semantic retrieval of medical memories.

[0045] In summary, the beneficial effects of this invention are as follows:

[0046] 1. This invention is designed for the medical and health scenario with a customized "three-database separation" memory storage architecture. Through hierarchical storage of short-term working memory, long-term plot memory, and pathology memory, it realizes the classified management of temporary information of medical sessions, long-term health information of patients, and core pathological diagnosis information. At the same time, it binds the patient ID to achieve full-cycle traceability and fully adapts to the compliance management requirements of medical data.

[0047] 2. This invention constructs a closed-loop management system for the entire lifecycle of medical memory. Through a complete process of "structured extraction - double deduplication - summary compression - value grading - conflict detection - fusion adjudication - security verification - index update", it systematically solves the pain points of fragmented, redundant, and difficult-to-accumulate medical dialogue memory, and realizes the automated, intelligent and continuous evolution of medical memory.

[0048] 3. This invention designs a multi-dimensional memory value assessment mechanism specifically for medical scenarios. By adapting a weighted scoring function to medical scenarios, it accurately distinguishes between conversational temporary memory and core memory with long-term medical value. This avoids a bloated knowledge base and ensures the complete retention of core health information. At the same time, the weights are configurable to adapt to the needs of different medical sub-scenarios.

[0049] 4. This invention constructs a complete medical memory conflict resolution mechanism. First, it completes the theme consistency screening through three-dimensional alignment. Then, it determines three exclusive conflict types for medical data. Finally, it achieves intelligent conflict resolution through confidence-weighted fusion adjudication rules, replacing the crude method of simple overwrite / discard in existing technologies. This not only ensures the consistency of the knowledge base, but also preserves valuable medical information to the maximum extent.

[0050] 5. This invention adds a medical tiered security access control verification mechanism, sets differentiated verification rules for medical data from different sources, aligns with the authoritative tiering logic of medical data, avoids the risk of erroneous medical information being written into the long-term knowledge base from the source, and greatly improves the medical security and compliance of the system. Attached Figure Description

[0051] Figure 1This is a schematic diagram of the overall process of the memory evolution method of the present invention;

[0052] Figure 2 This is a schematic diagram of the S4 memory value assessment and classification process of the present invention;

[0053] Figure 3 This is a schematic diagram of the S5 conflict detection, fusion, and long-term writing process of the present invention. Detailed Implementation

[0054] The following specific embodiments are merely illustrative of the present invention and are not intended to limit the invention. Those skilled in the art can make modifications to these embodiments without contributing any inventive step after reading this specification, but such modifications are protected by patent law as long as they are within the scope of the claims of the present invention.

[0055] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0056] Example 1:

[0057] according to Figures 1-3 As shown in the figure, this embodiment provides a memory evolution method with conflict resolution mechanism based on a medical scenario. Taking Mr. Wang's blood glucose management interaction scenario as an example, the specific implementation steps are as follows:

[0058] S1. Establishment of the memory bank

[0059] A unique patient ID was assigned to Mr. Wang, and a dedicated memory bank was established for him, including: a short-term working memory bank, a long-term episodic memory bank, and a pathology memory bank. The pathology memory bank stores Mr. Wang's past diabetes diagnosis reports, blood glucose monitoring history, doctor's treatment conclusions, and other core pathological information. All memory data is uniquely bound to Mr. Wang's patient ID, supporting full-cycle health information retrieval and traceability by ID.

[0060] S2, Data Source Generation

[0061] Mr. Wang interacted with the intelligent health assistant via voice: "My blood sugar level was 7.8 mmol / L two hours after dinner yesterday, and it was 6.5 mmol / L this morning on an empty stomach. Is this change normal?"

[0062] The system acquires interactive voice through a voice acquisition module, converts it into text data via ASR, and then uses a medical intent classification model to parse the core intent as "blood glucose data assessment," generating structured data information A with source labels, specifically including:

[0063] The final identified text is: "My blood sugar was 7.8 mmol / L two hours after dinner yesterday, and it was 6.5 mmol / L this morning on an empty stomach. Is this change normal?", with the source tag A_user_statement added.

[0064] Structured detection data: {Indicator: 2-hour postprandial blood glucose, value: 7.8 mmol / L, time: yesterday; Indicator: fasting blood glucose, value: 6.5 mmol / L, time: this morning}, as the final structured extraction result of the identified text, inheriting the source label A_user_statement;

[0065] The final response text reads: "Your 2-hour postprandial blood glucose and fasting blood glucose are both within the target range for type 2 diabetes patients. Your blood glucose fluctuations are reasonable. Please continue to maintain your current diet and exercise habits." The source tag A_model_infer has been added.

[0066] S3, Newborn Memory Extraction

[0067] After this round of interactive responses is completed, the system initiates the neonatal memory retrieval process:

[0068] S3-1, Structured Information Extraction: A lightweight information extraction model from the medical field is used to extract neonatal memory triples A1 from structured data A, specifically including:

[0069] ① (Subject: Mr. Wang, Predicate: 2-hour postprandial blood glucose, Object: 7.8 mmol / L, Time: 2026-04-25T21:30:00+08:00, Category: Patient's statement of facts)

[0070] ② (Subject: Mr. Wang, Predicate: Fasting blood glucose, Object: 6.5 mmol / L, Time: 2026-04-26T07:30:00+08:00, Category: Patient's statement of facts)

[0071] ③ (Subject: System, Predicate: Blood glucose assessment conclusion, Object: Blood glucose control is in line with target, fluctuation is reasonable, Time: 2026-04-26T08:15:00+08:00, Category: System findings and conclusions)

[0072] ④ (Subject: System, Predicate: Health advice, Object: Maintain current diet and exercise habits, Time: 2026-04-26T08:15:00+08:00, Category: System advice and planning)

[0073] S3-2, Cross-Dual-Library Redundancy Filtering: The above-mentioned newborn memory triple A1, the existing memories in Mr. Wang's long-term plot memory bank, and the historical blood glucose data in the pathological memory bank are converted into high-dimensional semantic vectors through the same medical semantic coding model. The semantic similarity is calculated by the cosine similarity function. It is determined to be a duplicate if and only if sim≥0.85 and the core predicates are completely identical (AND relationship).

[0074] The preset semantic similarity threshold is 0.85. After comparison, the semantic similarity between the new memory triplet and the historical memory is lower than 0.85. There are no completely identical items in the core predicate, so it is determined that there is no duplication. All are retained and the occurrence count of each memory is initialized to 1. If there is a duplicate item, the current item is not directly discarded. Instead, the "recent occurrence count" and "most recent occurrence timestamp" of the existing memory item are updated. The current item is discarded only if the timestamp difference is ≤ the preset time threshold (e.g., 24 hours) to avoid short-term repeated pollution. Otherwise, the current item is retained (considered as a valid repeated emphasis signal) and the occurrence count of the corresponding historical memory is incremented by 1.

[0075] S3-3, Abstract Compression: Using a text summarization model based on medical domain knowledge, the natural language description fields of the retained neonatal memory triples are semantically compressed, compressing long text conclusions into standardized medical descriptions, and finally generating a neonatal memory set B to be evaluated.

[0076] S4. Memory Value Assessment and Classification

[0077] A multi-dimensional weighted scoring function is used to calculate the importance score of each memory triplet in the neonatal memory set B to be evaluated. In this embodiment, the preset weighting coefficients are α=0.2, β=0.2, γ=0.3, and δ=0.3, satisfying α+β+γ+δ=1. The calculation formula is as follows:

[0078] S(K)=0.2×F_r(K)+0.2×F_e(K)+0.3×F_t(K)+0.3×F_a(K)

[0079] in:

[0080] F_r(K) is the repetition frequency score, F_r(K)=min(count_30d(K) / 5,1), where count_30d(K) is the cumulative occurrence count of the memory item in the past 30 days (maintained in S3-2).

[0081] F_e(K) represents the patient's emphasis signal score, F_e(K) = 0.5 × kw_hit(K) + 0.5 × emo_intensity(K), where kw_hit(K) is the hit rate of emphasis keywords ("especially", "definitely", "really", etc.), and emo_intensity(K) is the normalized score of emotional intensity output based on an audio emotion recognition model (such as Wav2Vec2-emotion). Note: The calculation of emo_intensity requires retaining the original speech segment. In addition to generating the recognized text, the speech acquisition module in S2 also caches the original speech for 30 days for use in this step.

[0082] F_t(K) is the medical topic relevance score, F_t(K) = max_{topic∈Topics}cos(emb(K),emb(topic)), where Topics is a predefined set of core medical topics (including but not limited to: hyperglycemia management, hypertension management, chronic disease follow-up, postoperative rehabilitation, medication adherence, allergy history, family history, etc., totaling 30 topics), and emb is the BERT encoder for the medical field;

[0083] F_a(K) is the source authority score, F_a(K) = 1.0 (if K.source=A_device / lab) or 0.6 (if K.source=A_user_statement) or 0.4 (if K.source=A_model_infer), and the weights are assigned according to the priority of A_device / lab > A_user_statement > A_model_infer.

[0084] The preset importance score threshold is 0.5. The calculation is as follows:

[0085] The importance scores of blood glucose numerical memory items are all >0.5, which are judged to be memory items with long-term value B2 and marked as items to be written into long-term memory C;

[0086] Health advice-related memory items with an importance score <0.5 are classified as B1 memories with only conversational value, written into the short-term working memory bank, and set to have a lifespan of 7 days. The system will automatically delete them upon expiration.

[0087] S5, conflict detection, fusion adjudication, security verification, and long-term write.

[0088] S5-1, Collision Detection

[0089] The topic consistency of the item C to be written to long-term memory is judged by comparing it with the existing memories in Mr. Wang's long-term episodic memory bank, and a three-dimensional alignment check is performed:

[0090] ① Patient entity alignment: The memory item to be written and the existing memory both belong to Mr. Wang's patient ID, alignment passed;

[0091] ② Medical concept alignment: The core object to be written into the memory item is the blood glucose index, which is consistent with the core medical concept in the existing memory, so the alignment is successful;

[0092] ③ Time context alignment: The time of the memory item to be written is the most recent 2 days, which is continuous with the time context of the existing memory, so the alignment is successful;

[0093] All 3D verifications passed; item C1 is now marked as a long-term memory item to be written and requires further testing.

[0094] For C1, a medical conflict type determination was performed. The most recent blood glucose record retrieved from Mr. Wang's long-term episodic memory bank was "fasting blood glucose 8.2 mmol / L one month ago, postprandial 2-hour blood glucose 10.3 mmol / L". Comparison was performed as follows:

[0095] The numerical differences did not exceed the reasonable fluctuation range preset for blood glucose indicators, and there were no numerical range conflicts;

[0096] There are no mutually exclusive medical states and events, and no conflicts between classified states or between mutually exclusive events;

[0097] The item C11 was ultimately determined to be conflict-free and ready to be written to long-term memory.

[0098] If a conflict is detected in this round, for example, if the system's historical conclusion is "blood sugar control is not up to standard" and this round's conclusion is "blood sugar control is up to standard", then it is marked as a conflicting item to be written into long-term memory C12 and enters the fusion adjudication process.

[0099] S5-2, Fusion Judgment

[0100] For the conflicting long-term memory entry C12 mentioned above, perform a fusion decision:

[0101] S5-2-1, Confidence Initialization: Assign initial confidence to conflicting old and new memories. Both conclusions are generated by system model inference (A_model_infer), with an initial base value of 0.5 mapped according to source authority; simultaneously, the confidence (softmax probability) of each conclusion is taken from the information extraction model. The extraction confidence of historical conclusions is 0.92, and that of the current conclusion is 0.95. After normalizing to the additive interval [-0.05, 0.05], the initial confidence of historical conclusions = 0.5 + (0.92 - 0.93) × 0.5 = 0.495, and that of the current conclusion = 0.5 + (0.95 - 0.93) × 0.5 = 0.510;

[0102] S5-2-2, Confidence Adjustment: Based on the time decay rule and the source priority rule, the confidence is adjusted according to the following formula: (1) Time decay rule: Calculate the time decay factor relative to the current time, decay(K)=exp(-Δt(K) / τ), where Δt(K) is the time difference (hours) between the timestamp of K and the current time, and τ is the time decay constant (default is 720 hours = 30 days). For the current memory, Δt=0, decay=1.0, and for the historical memory, Δt=720, decay≈0.368; (2) Source priority rule: Define the source bonus src_bonus(K)=0.2 (if K.source=A_user_statement and is the current time). (Explicit statement) or 0.1 (if K.source=A_device / lab) or 0 (if K.source=A_model_infer), both the current round and the history are A_model_infer, src_bonus=0; (3) Adjusted confidence: confidence_adjusted(K)=clip(confidence_init(K)×decay(K)+src_bonus(K),0,1), current round=clip(0.510×1.0+0,0,1)=0.510, history=clip(0.495×0.368+0,0,1)≈0.182;

[0103] S5-2-3, Decision Execution: Compare the adjusted confidence level conf(C12) = 0.510 with conf(existing) = 0.182. The difference 0.328 > the threshold θ = 0.1, belonging to path (a): Overwrite the historical memory with the current memory to generate the fused item C3 to be written into long-term memory. Note: If conf(existing) - conf(C12) > θ, then execute path (b) to discard C12; if |conf(C12) - conf(existing)| ≤ θ, then execute path (c) to keep both and add a conflict marker.

[0104] S5-3, Security Verification and Write Update

[0105] The unchecked long-term memory items C2, conflict-free long-term memory items C11, and the merged long-term memory items C3 are grouped into a memory item set C4 for security verification. Tiered medical security access control verification is then performed based on the source label.

[0106] For blood glucose value memory items with the source label A_user_statement, they are marked as "awaiting clinical verification" and then directly pass the security check (patient verbal data has passed the anomaly detection).

[0107] For the assessment conclusion memory item with source label A_model_infer, it was verified that it was anchored to the patient's latest blood glucose test data and referenced the control standards of the "Guidelines for the Prevention and Treatment of Type 2 Diabetes in China", and the verification was passed;

[0108] Memory items that fail the verification are downgraded to memories with only session value and written to the short-term working memory.

[0109] The memory item C5, which passed the security verification, is written into Mr. Wang's long-term episodic memory bank. At the same time, all written memory content is converted into standardized natural language descriptions (e.g., "2026-04-25 Mr. Wang's blood glucose 2 hours after a meal was 7.8 mmol / L, which meets the control target"). This is then converted into a semantic vector by a vectorization encoding unit and written as a node into the HNSW index. Simultaneously, metadata {user_id: "Mr. Wang_001", entity: ["blood glucose","2h after a meal"], predicate: "blood glucose measurement", timestamp: 1745580600} is attached for filtering during the retrieval stage, completing the entire memory evolution process.

[0110] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A memory evolution method with conflict resolution mechanism based on medical scenarios, characterized in that, The specific steps include: S1. Memory bank establishment: A separate memory bank is established for each patient ID, which includes a short-term working memory bank, a long-term episodic memory bank, and a pathological memory bank; the pathological memory bank stores the historical pathological knowledge and diagnostic conclusions corresponding to the patient ID. S2. Data source generation: Based on the patient ID, process the data generated during the voice interaction to generate structured data information A with source labels for memory evolution; S3. Newborn Memory Extraction: During the response completion phase of each round of voice interaction, a structured newborn memory triple A1 is extracted from the structured data information A. Based on semantic similarity, core predicate consistency and timestamp, the newborn memory triple A1 is subjected to cross-database redundancy filtering with existing memories in the long-term episodic memory bank and historical pathological knowledge in the pathological memory bank. Then, the summary is compressed by a text summarization model of medical domain knowledge to generate a newborn memory set B to be evaluated. S4. Memory Value Assessment and Classification: The importance score of each neonatal memory triplet in the neonatal memory set B to be evaluated is calculated using a multi-dimensional weighted scoring function. Based on a preset threshold, it is classified into memory B1, which has only conversational value, and memory B2, which has long-term value. Memory B1, which has only conversational value, is directly written into the short-term working memory bank and its survival time is set. Memory B2, which has long-term value, is marked as an item to be written into long-term memory C. S5, Conflict Detection, Fusion Resolution, Security Verification, and Long-Term Write: Perform the following operations on the long-term memory item C to be written: S5-1, Conflict Detection: Perform a thematic consistency check between the long-term memory item C to be written and the existing memories in the long-term episodic memory bank. For each memory in the long-term memory item C to be written, perform three checks in sequence: patient entity alignment, medical concept alignment, and temporal context alignment. When all three checks pass, mark it as a long-term memory item C1 to be tested. If any check fails, mark it as a long-term memory item C2 to be written with independent themes. Perform a medical scene-specific conflict type check on the long-term memory item C1 to be tested, and generate conflict-free long-term memory item C11 and conflicting long-term memory item C12 to be written. S5-2, Fusion Decision: For conflicting long-term memory items C12, a fusion decision is made based on the confidence weighting rule to generate a fused long-term memory item C3. S5-3, Security Verification and Write Update: The long-term memory items C2 (which do not require detection), C11 (which are conflict-free), and C3 (which are merged) are aggregated into a set of memory items C4 for security verification. Medical security access control verification is then performed on these items. Memory items C5 that pass the security verification are written into the long-term narrative memory database. At the same time, all memory content written into the long-term narrative memory database is converted into standardized natural language descriptions, which are then converted into semantic vectors by a vectorization encoding unit and written as nodes into the HNSW index. Additionally, the core medical entities, predicates, and timestamps of each memory item are stored as metadata filter fields (payload / metadata filter) of the vector node, enabling accurate semantic retrieval of medical memories.

2. The memory evolution method with conflict resolution mechanism based on a medical scenario according to claim 1, characterized in that, In S1, all data in the short-term working memory bank, long-term episodic memory bank, and pathological memory bank are uniquely bound to the patient ID, supporting full-cycle memory retrieval and tracing from the patient's initial record to the current moment across the entire historical time range.

3. The memory evolution method with conflict resolution mechanism based on a medical scenario according to claim 1, characterized in that, In S2, the structured data information A is generated in the following way: the interaction information is obtained through the voice acquisition module of the intelligent voice interaction system, converted into text data by voice recognition, and then the interaction intent is analyzed through the intent classification model to generate multi-source structured data containing the final recognition text, structured detection data, and final answer text. The final identified text is labeled with the source tag A_user_statement (patient self-reported health data), the structured detection data is labeled with the source tag A_device / lab (medical device detection data), and the final answer text is labeled with the source tag A_model_infer (large language model inference derived data).

4. The memory evolution method with conflict resolution mechanism based on a medical scenario according to claim 1, characterized in that, The specific steps for retrieving neonatal memories in S3 include: S3-1, Structured Information Extraction: A lightweight information extraction model is used to identify and extract neonatal memory triples A1 from structured data information A. The categories of neonatal memory triples A1 include patient statements of facts, patient expressions of concern, system findings and conclusions, system suggestions and plans, and timestamps. S3-2, Dual Redundancy Processing: The newborn memory triplet A1, the existing memories in the long-term episodic memory bank, and the relevant historical pathological knowledge in the pathological memory bank are converted into high-dimensional semantic vectors through the same semantic coding model. The semantic similarity sim is calculated using the cosine similarity function. If and only if sim ≥ the preset semantic similarity threshold and the core predicates are completely identical, it is determined to be a duplicate. For the memory triplet determined to be duplicated, the redundancy is filtered by comparing the timestamp difference with the preset time threshold, and an updated newborn memory triplet is generated. S3-3, Abstract Compression: For the updated neonatal memory triplet, semantic compression of the natural language description fields is performed using a text summarization model based on medical domain knowledge to generate a neonatal memory set B to be evaluated.

5. The memory evolution method with conflict resolution mechanism based on a medical scenario according to claim 1, characterized in that, In S4, the calculation formula for the multi-dimensional weighted scoring function is as follows: S(K)=α×F_r(K)+β×F_e(K)+γ×F_t(K)+δ×F_a(K) Where α, β, γ, and δ are configurable weight coefficients, α, β, γ, and δ ∈ [0,1] and satisfy α+β+γ+δ=1; S(K) is the importance score of the neonatal memory triple K to be evaluated, F_r(K) is the repetition frequency score, F_e(K) is the patient emphasis signal score, F_t(K) is the medical topic relevance score, and F_a(K) is the source authority score; The source authority score is weighted according to the priority of the source tag, and the weighting rule is: A_device / lab > A_user_statement > A_model_infer.

6. The memory evolution method with conflict resolution mechanism based on a medical scenario according to claim 1, characterized in that, In step S4, the lifespan of the data stored in the short-term working memory is a configurable parameter, and the system automatically cleans up the data that has exceeded its expiration date.

7. The memory evolution method with conflict resolution mechanism based on a medical scenario according to claim 1, characterized in that, In S5-1, the specific conflict types for medical scenarios include the following three categories, and a conflict is determined to exist if any one of them is met: Numerical range conflict: The objects of the memory item to be tested and the existing memory items are both numerical medical indicators, and the numerical difference exceeds the reasonable fluctuation range preset by the medical indicator. Classification state conflict: The objects of the memory item to be tested and the existing memory items are both state-type medical results, and the states belong to predefined mutually exclusive medical categories; Mutually exclusive event conflict: The memory item to be tested and the existing memory item describe mutually exclusive events in medicine.

8. The memory evolution method with conflict resolution mechanism based on a medical scenario according to claim 1, characterized in that, The specific steps of the fusion decision in S5-2 include: S5-2-1, Confidence Initialization: Assign initial confidence to conflicting long-term memory items C12 and corresponding conflicting existing memories. The initial confidence is determined based on the source authority of the memory item and the information extraction confidence. S5-2-2, Confidence Adjustment: Based on the time decay rule and the source priority rule, the confidence is adjusted in the following order and formula: (1) Time decay rule: For each memory item K, calculate its time decay factor relative to the current time decay factor decay(K)=exp(-Δt(K) / τ), where Δt(K) is the time difference between the timestamp of K and the current time, and τ is the time decay constant; (2) Source priority rule: Define the source bonus src_bonus(K)=0.2 (if K.source=A_user_statement and is an explicit statement in this round) or 0.1 (if K.source=A_device / lab) or 0 (if K.source=A_model_infer); (3) Adjusted confidence: confidence_adjusted(K)=clip(confidence_init(K)×decay(K)+src_bonus(K),0,1); S5-2-3, Decision Execution: Compare the adjusted confidence level conf(C12) with conf(existing): (a) If conf(C12) - conf(existing) > threshold θ: Overwrite the existing memory with C12; (b) If conf(existing) - conf(C12) > threshold θ: Discard C12, keep the existing memory unchanged, and downgrade C12 to short-term working memory to preserve session-level visibility; (c) If |conf(C12) - conf(existing)| ≤ threshold θ, then coexist with both and attach a conflict flag {conflict_pair: [id_C12, id_existing]}, and finally generate the fused item C3 to be written to long-term memory (overwriting path a) or retain the coexisting pair (path c). Path b does not generate C3.

9. The memory evolution method with conflict resolution mechanism based on a medical scenario according to claim 3, characterized in that, In S5-3, the medical security access control verification performs hierarchical verification rules based on the source label of the memory item: ① For memory items with the source label A_user_statement, they first undergo patient statement anomaly detection. Based on rules and medical knowledge base, it is determined whether the statement content is within a reasonable physiological range and whether it seriously contradicts the existing pathological memory bank. If the anomaly detection is passed, it is marked as "awaiting clinical verification" and then written into the long-term plot memory bank. Memory that fails the anomaly detection is downgraded to a conversation-only memory and written into the short-term working memory bank, triggering a clinical attention cue. ② For memory items with the source label A_device / lab, verify that their values ​​are within a reasonable physiological range and the instrument's detection range to pass the security check; ③ For memory items with the source label A_model_infer, the following two checks must be performed sequentially: (a) Clinical evidence anchoring check: Check whether the memory item is associated with at least one data point under the same patient ID, with a timestamp within the last 90 days, and sourced from A_device / lab or A_user_statement; if there is no association, the check fails; (b) Authoritative knowledge base citation check: Based on a predefined whitelist of medical authoritative knowledge bases, check whether the key medical terms of the memory item can be mapped to at least one entry in the whitelist; if there is no mapping, the check fails; if the mapping is successful, the evidence_ref field is added to record the citation source; only memory items that pass both checks can pass the security check; Memory items that fail security checks are downgraded to session-only memories and written to the short-term working memory.

10. The memory evolution method with conflict resolution mechanism based on a medical scenario according to claim 1, characterized in that, In step S5-3, each memory item written into the long-term episodic memory bank is converted into a standardized natural language description and a semantic vector is generated by a vectorization encoding unit. The HNSW index is updated using this semantic vector as the node. At the same time, the core medical entity, predicate, and timestamp of the memory item are added and stored as the metadata filter fields (payload / metadata filter) of the vector node. In subsequent retrieval, joint queries of vector similarity retrieval and metadata filtering are supported to achieve accurate semantic retrieval of medical memories.