Memory-based interaction method and device, equipment, medium and program product
By parsing the memory call requests of the interactive session, filtering out the target memory units that match the session context, and calling their memory load when they are valid, the problem of insufficient context utilization in the large language model in the session is solved, and more accurate response text is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, large language models struggle to maintain and utilize contextual information efficiently and accurately during conversations, resulting in poor interaction performance.
By acquiring the memory access requests of the interactive session, parsing the session context, filtering out the target memory units that match the session context, and calling the target memory unit through the large language model when the memory state of the target memory unit is valid, the response text is determined based on the memory load in the memory unit.
It improves the interaction, ensures the accuracy and consistency of the response text, and enhances the performance of large language models in complex tasks.
Smart Images

Figure CN121786147A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a memory-based interaction method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology
[0002] With the development of computer technology, large language models (LLMs) have demonstrated powerful capabilities and broad application prospects in many fields such as natural language processing and intelligent interaction. They can not only accurately understand the complex semantics of human language, but also generate fluent and logical text content, achieving remarkable results in tasks such as text generation, question answering systems, and machine translation.
[0003] In related technologies, large language models are typically used to process user-input conversations. However, due to the large amount of contextual information and its dynamic changes during conversations, existing processing mechanisms struggle to maintain and utilize this information efficiently and accurately. This results in deficiencies in conversation coherence and contextual understanding accuracy, leading to poor interaction performance. Summary of the Invention
[0004] Therefore, it is necessary to provide a memory-based interaction method, device, computer equipment, computer-readable storage medium, and computer program product that can improve the interaction effect in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a memory-based interaction method, including:
[0006] Obtain the memory access request for the interaction session, parse the memory access request, and determine the session context for the interaction session;
[0007] Based on the session context and the memory summary of each memory unit, target memory units that match the session context are selected from multiple memory units;
[0008] When the memory state of the target memory unit is valid, the target memory unit is invoked through the large language model, and the response text of the interaction session is determined based on the memory load in the target memory unit and the interaction session.
[0009] Secondly, this application also provides a memory-based interactive device, comprising:
[0010] The request parsing module is used to obtain memory access requests for the interaction session, parse the memory access requests, and determine the session context for the interaction session.
[0011] The memory cell filtering module is used to filter out target memory cells that match the session context from multiple memory cells based on the session context and the memory summary of each memory cell;
[0012] The session response module is used to, when the memory state of the target memory unit is valid, invoke the target memory unit through a large language model, and determine the response text of the interaction session based on the memory load in the target memory unit and the interaction session.
[0013] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0014] Obtain the memory access request for the interaction session, parse the memory access request, and determine the session context for the interaction session;
[0015] Based on the session context and the memory summary of each memory unit, target memory units that match the session context are selected from multiple memory units;
[0016] When the memory state of the target memory unit is valid, the target memory unit is invoked through the large language model, and the response text of the interaction session is determined based on the memory load in the target memory unit and the interaction session.
[0017] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0018] Obtain the memory access request for the interaction session, parse the memory access request, and determine the session context for the interaction session;
[0019] Based on the session context and the memory summary of each memory unit, target memory units that match the session context are selected from multiple memory units;
[0020] When the memory state of the target memory unit is valid, the target memory unit is invoked through the large language model, and the response text of the interaction session is determined based on the memory load in the target memory unit and the interaction session.
[0021] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0022] Obtain the memory access request for the interaction session, parse the memory access request, and determine the session context for the interaction session;
[0023] Based on the session context and the memory summary of each memory unit, target memory units that match the session context are selected from multiple memory units;
[0024] When the memory state of the target memory unit is valid, the target memory unit is invoked through the large language model, and the response text of the interaction session is determined based on the memory load in the target memory unit and the interaction session.
[0025] The aforementioned memory-based interaction method, apparatus, computer device, computer-readable storage medium, and computer program product obtain memory call requests for an interaction session, parse the memory call requests, and determine the session context for the interaction session. Based on the session context and memory summaries of each memory unit, a target memory unit matching the session context is selected from multiple memory units. In other words, the management of reference memory units is implemented. Thus, based on the session context of the interaction session, relevant target memory units are queried. If the memory state of the target memory unit is valid, its availability is ensured. Subsequently, through a large language model, the target memory unit is invoked. Based on the memory load in the target memory unit and the interaction session, the response text for the interaction session is determined. That is, the pre-stored memory load in the target memory unit assists the large language model in acquiring relevant memory knowledge to accurately respond to the interaction session, ensuring the accuracy of the response text and thus improving the interaction effect. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a diagram illustrating the application environment of a memory-based interaction method in one embodiment.
[0028] Figure 2 This is a flowchart illustrating a memory-based interaction method in one embodiment;
[0029] Figure 3 This is a schematic diagram of a memory operation platform in one embodiment;
[0030] Figure 4This is a schematic diagram illustrating the detailed process of a memory operation platform in one embodiment;
[0031] Figure 5 This is a structural block diagram of a memory-based interactive device in one embodiment;
[0032] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0034] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0035] The memory-based interaction method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server.
[0036] In some embodiments, after obtaining an interaction session input via a target object identifier, the terminal 102 sends the interaction session to the server 104. The server 104 obtains a memory access request for the interaction session, parses the memory access request, and determines the session context for the interaction session. Based on the session context and the memory digests of each memory unit, the server 104 filters out a target memory unit that matches the session context from multiple memory units. If the memory state of the target memory unit is valid, the server 104 calls the target memory unit through a large language model and determines the response text of the interaction session based on the memory load in the target memory unit and the interaction session.
[0037] In some embodiments, server 104 deploys a memory-based interactive processing architecture, which includes an interface layer, an operation layer, and a facility layer. Terminal 102 sends the acquired interactive session to the interface layer of server 104. Based on the interactive session, the interface layer determines the memory access requests related to the session and sends them to the operation layer of server 104. The operation layer executes the aforementioned memory-based interactive method. The interface layer is used to interact with users and other interactive systems and serves as the entry point for all interactive operations. The operation layer is the control center of the interactive processing architecture, responsible for organizing, planning, and scheduling memory resources during inference. The facility layer is responsible for the storage, security, migration, and flow of memory data, providing fundamental support for the reliable execution of the interactive processing architecture.
[0038] Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection equipment. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0039] In one exemplary embodiment, such as Figure 2 As shown, a memory-based interaction method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 206. Wherein:
[0040] Step 202: Obtain the memory access request for the interactive session, parse the memory access request, and determine the session context for the interactive session.
[0041] An interactive session is a session in which interaction takes place. Optionally, an interactive session can be a session in which the target object queries or inquires about information. For example, an interactive session could be "Please retrieve my medical records from last year's hospitalization," or "My dog needs help." Exemplarily, an interactive session is a session about querying information sent through a target object identifier. A memory access request is a request used to access a memory location. This memory access request includes a session context, which is determined based on the context of the interactive session.
[0042] Optionally, after obtaining the interaction session sent by the terminal, the interface layer in the server performs keyword recognition on the interaction session to determine the context anchor and session intent. Based on the context anchor and session intent, it determines the session context and performs structured processing on the session context to generate a structured memory call request. The interface layer sends the memory call request to the server's operation layer, which parses the memory call data to obtain the session context.
[0043] In some embodiments, obtaining a memory call request for an interactive session includes: obtaining an interactive session with a target object identifier input through an interface layer; performing semantic understanding on the interactive session to obtain a session intent, a topic entity, and a context anchor; generating a session context based on the session intent, topic entity, context anchor, and target object identifier; and generating a structured memory call request based on the session context.
[0044] In this context, the session intent reflects the purpose of the interaction, which can be a memory query intent, a consultation intent, a request for help intent, etc. The context anchor refers to the position or keyword in the context of the interaction. The context anchor can originate from the interaction itself, or it can be inferred from the preceding context that is related to the interaction. The subject entity refers to the entity object targeted in the interaction. For example, in the interaction "Please retrieve my medical records from last year's hospitalization," the corresponding session intent is a memory query intent, the subject entity is "medical records," a topic tag related to diagnostic records, and the context anchor is "hospitalization." Another example is the interaction "My dog needs help," which corresponds to a request for help intent, the subject entity is "dog," and the context anchor is a preceding context about the dog, such as "My dog is sick."
[0045] The Interface Layer is used to translate external requests (natural language) into internal system operations. Its core component is the MemReader, which parses the interactive session of object input into a structured MemoryCall, similar to a system call. The Interface Layer also provides a unified Memory API (memory-based): enabling CRUD (create, read, update, delete), retrieval, version lookup, and auditing operations. The Interface Layer supports Memory Pipelines, which chain multiple operations together for complex workflows (e.g., read-then-write-then-archive). The Interface Layer converts natural language input into structured memory call requests, which can be viewed as a chain of memory calls, interacting with the memory units required at the call site. This Interface Layer can also perform permission checks, parameter encapsulation, and call sequence management to verify the compliance and traceability of operations.
[0046] Optionally, the interface layer obtains the interaction session sent through the terminal, which is an input session identified by the target object. The interface layer performs semantic understanding on the interaction session to determine the session intent, subject entity, and context anchor. Based on the session intent, subject entity, context anchor, and target object identifier, a session context is generated and converted into a structured memory call request, i.e., MemoryCall. Of course, if a time window is detected for the interaction session, the session context can also be generated based on the time window, session intent, subject entity, context anchor, and target object identifier. For example, the interaction session is "Please retrieve my medical records from last year's hospitalization," the corresponding session intent is a memory query intent, the subject entity is "medical records," which is a topic tag about the diagnosis record type, the context anchor is "hospitalization," and the time window is "last year."
[0047] In the above embodiments, after semantic understanding of the interactive session through the interface layer, the natural language input can be converted into a structured memory call request. In this way, the session context can be parsed based on the memory call request, ensuring that the accurate memory unit is called, the consistency of memory calls is ensured, and the interaction effect is ensured.
[0048] In some embodiments, the method further includes: determining a first degree of matching between the session intent and a preset memory query intent; and if the first degree of matching is greater than or equal to a first degree threshold, returning to the step of generating a structured memory call request based on the session context to continue execution.
[0049] Optionally, the intent vectors of the session intent and the preset memory query intent are determined, and the similarity between their respective intent vectors is calculated to obtain a first matching degree between the session intent and the preset memory query intent. If the first matching degree is greater than or equal to the first degree threshold, the step of generating a structured memory call request based on the session context is returned to continue execution. Before generating the memory call request, it is first verified whether the interactive session has a memory query intent. If a memory query intent exists, subsequent memory unit determination will proceed to ensure the effectiveness of the interaction.
[0050] In some scenarios, the session intent of an interactive session can be a comprehensive intent, meaning that the interactive session includes multiple types of intents. Therefore, the session intent can be decomposed first to obtain each sub-intent. For each sub-intent, the first matching degree between the sub-intent and the preset memory query intent can be calculated. If the largest first matching degree is greater than or equal to the first degree threshold, it means that the sub-intent corresponding to the largest first matching degree is a memory query intent. Thus, the step of generating a structured memory call request based on the session context can be returned to continue execution.
[0051] In the above embodiments, by comparing the first matching degree between the session intent and the preset memory query intent, it is possible to effectively and accurately verify whether the interactive session has a memory query intent, so as to ensure the effectiveness and accuracy of calling the memory unit to reply to the interactive session.
[0052] Step 204: Based on the session context and the memory summary of each memory unit, select the target memory unit that matches the session context from multiple memory units.
[0053] The memory summary is a concise description of the memory content contained in a memory unit. For example, the content summary includes the memory tag and semantic index information of the corresponding memory unit. The memory tag is a label for the memory unit, used to distinguish each memory unit, and can be determined based on the memory name of the memory unit. The semantic index is used to record memory content preferences, anchor points, and keyword vectors.
[0054] Optionally, the server's operation layer retrieves memory summaries from memory cells of various memory types based on the session context, and determines at least one memory cell of a memory type that matches the session context as the target memory cell.
[0055] Memory type refers to the type of memory unit, which includes Plaintext Memory, Activation Memory, and Parameter Memory. Plaintext Memory stores plaintext memories, which can be explicit text or documents, such as user notes, knowledge base fragments, or graphs. Activation Memory stores activation memories, which can be intermediate states generated by the large language model during inference (such as KV-cache, attention hidden states), used to accelerate and reuse context. It can also include summaries of recent query history sessions. Parameter Memory stores parameter memories, which can be long-term knowledge expressed by the parameters of the large language model, and can also include templates related to query scenarios, such as diagnostic templates.
[0056] Therefore, in some embodiments, based on the session context and the memory digests of each memory unit, a target memory unit matching the session context is selected from multiple memory units. This includes: obtaining memory digests of memory units of different memory types, where the memory digests include the memory tags and semantic index information of the corresponding memory units; for each memory type, performing memory retrieval on multiple memory units belonging to the memory type based on the session context, the memory digests of each memory unit belonging to the memory type, and the semantic index information, and retrieving at least one candidate memory unit belonging to the memory type; and determining the target memory unit matching the session context based on the retrieved candidate memory units of different memory types.
[0057] For example, for each memory type, a memory summary of multiple memory units of that memory type is obtained. For each memory summary, the operation layer generates a memory matching prompt text based on the session context, the memory tags of the memory summary, and semantic retrieval information. A large language model is then invoked to perform semantic understanding on the memory matching prompt text to determine the second matching degree between the corresponding memory unit and the session context. Based on the second matching degree corresponding to each memory unit of that memory type, memory units with a second matching degree greater than or equal to a threshold are selected as target memory units for that memory type. This memory matching prompt text is used to prompt the large language model to determine the matching degree with the session context based on the memory tags and semantic retrieval information of the corresponding memory unit. For example, in an interaction session of "Please refer to my past medical records for diagnosis," the target memory units retrieved are the recent consultation summary (activated memory) and the diagnostic template (parameter memory).
[0058] Of course, a memory graph (constructed based on time chains, entity relationships, and dependencies) can also be obtained, and the target memory unit matching the interactive session can be retrieved based on the memory graph, session context, memory tags of the memory digest, and semantic retrieval information.
[0059] Furthermore, after determining the target memory unit, the call order and integration strategy can be dynamically planned to optimize low latency and task relevance. Alternatively, metrics such as context similarity, access frequency, time decay, and priority tags can be further evaluated to further optimize the target memory unit, i.e., further filter the target memory unit, and then execute step 206 below based on the optimized target memory unit.
[0060] In the above embodiments, by obtaining memory summaries of different types of memory units, it is possible to filter out target memory units that match the session context from memory units of different memory types to ensure the interaction effect.
[0061] Step 206: If the memory state of the target memory unit is valid, the target memory unit is invoked through the large language model, and the response text of the interaction session is determined based on the memory load and interaction session in the target memory unit.
[0062] The memory state reflects the lifecycle status of the corresponding memory unit (generation, activation, merging, expiration, eviction, etc.) to indicate whether the memory unit is valid. A valid state is neither evicted nor expired. Each memory unit includes metadata and a payload. The metadata includes: identity (ID), provenance, version, lifecycle information, access control (ACL), priority, and behavioral metrics (such as access frequency). The payload includes the actual memory content, which can be text, activation status, or parameter patches.
[0063] Optionally, the server's operation layer verifies the memory state of the target memory unit. When the memory state is valid, it generates a response prompt text based on the interactive session. The target memory unit is then invoked through a large language model to obtain the corresponding interactive session response text based on the interactive session semantic understanding of the response prompt text according to the memory load in the target memory unit.
[0064] In some embodiments, the method further includes: determining a target object identifier for the input interaction session; obtaining historical session records of the target object identifier, the historical session records including the usage frequency and interaction feedback of each memory unit during the historical interaction process of the target object identifier; and determining the memory state of the target memory unit based on at least one of the usage frequency and interaction feedback of the target memory unit in the historical session records.
[0065] The memory state includes five states: generated, activated, merged, archived, evicted, and expired. Among them, generated, activated, merged, and archived are valid states, while evicted and expired are invalid states.
[0066] For example, the operation layer, based on the target object identifier of the input interaction session, obtains the historical session records of the target object identifier. These historical session records include the usage frequency and interaction feedback of each memory unit during the historical interactions of the target object identifier. The operation layer obtains a threshold for the usage frequency and, based on the usage frequency and interaction feedback of the target memory unit in the historical session records, as well as the threshold, determines the memory state of the target memory unit. The higher the usage frequency and the more positive the interaction feedback, the more effective the memory state. For instance, in a medical application, during the response process to the current interaction session, if the memory unit containing the medication suggestion is found to be in a generating state, it means that the memory unit was used once before, and the memory unit that first generated the medication suggestion is now in a generating state. If the memory unit containing the medication suggestion is found to be in an active state, it means that the memory unit... After multiple user confirmations (interaction feedback), it will be "merged" into frequently used suggestions; if it is not used for a long time, it will eventually be archived or expire.
[0067] In the above embodiments, by obtaining the historical session records of the historical interaction process of the target object identifier, the memory state of the target memory unit during the current interaction session can be effectively and dynamically determined, ensuring the interaction effect.
[0068] In some embodiments, the method further includes: obtaining interactive feedback about the interactive session; updating the historical session record associated with the target object identifier based on the interactive feedback; and verifying whether the memory state of the target memory unit associated with the target object identifier should be updated based on the updated historical session record.
[0069] For example, after the server returns the response text to the terminal for display, the terminal obtains the interaction feedback regarding the interactive session and sends it to the server. The server's operation layer queries the historical session records of the target object identifier, retrieves the sub-record for the target memory unit from the historical session records, adds the interaction feedback to the sub-record, and increments the usage frequency in the sub-record to obtain an updated sub-record. Based on the updated sub-record, the historical session records are updated. Based on the interaction feedback and usage frequency of the target memory unit in the updated historical session records, the system verifies whether the memory state of the target memory unit associated with the target object identifier is valid. Therefore, after obtaining a new interactive session sent by the target object identifier again, and after querying the target memory unit again, the system determines whether the state of the target memory unit is still valid based on the verification result.
[0070] In the above embodiments, based on interactive feedback, the historical session records associated with the target object identifier can be updated in a timely manner to dynamically verify whether the memory state of the target memory unit needs to be updated, ensuring the effectiveness of candidate interactive session processing, and also enabling memory to be transformed from static data fragments into dynamic, context-aware resources.
[0071] In the aforementioned memory-based interaction method, memory call requests for the interaction session are obtained, parsed, and the session context of the interaction session is determined. Based on the session context and the memory digests of each memory unit, target memory units matching the session context are selected from multiple memory units. In other words, the management of reference memory units is implemented. Thus, based on the session context of the interaction session, relevant target memory units are queried. If the memory state of the target memory unit is valid, its availability is ensured. Then, through a large language model, the target memory unit is invoked. Based on the memory load in the target memory unit and the interaction session, the response text for the interaction session is determined. That is, the pre-stored memory load in the target memory unit assists the large language model in acquiring relevant memory knowledge to accurately respond to the interaction session, ensuring the accuracy of the response text and thus improving the interaction effect.
[0072] In a specific embodiment, such as Figure 3 The diagram shown is a schematic of a memory operation platform in one embodiment. The interaction processing architecture is deployed on a server and includes business applications, agents / users / pipelines, a memory operation platform, and a large language model. The structure of the memory operation platform can be found in [reference needed]. Figure 3Specifically, the memory operation platform comprises an interface layer, an operation layer, and a facility layer. The interface and operation layers are described above. The facility layer provides basic capabilities such as storage, governance, migration, and sharing. It also provides MemGovernance: access control (ACL), retention policy, audit logs, and sensitive content handling (watermark). Furthermore, it offers MemVault: a memory vault that manages multiple namespaces and interfaces with various storage backends (vector databases, relational databases, blob storage, etc.). The facility layer also provides MemLoader / MemDumper: supporting the import (load) and export (dump) of memory units, enabling memory migration between different platforms / agents. Finally, it provides MemStore: a publish-subscribe (pub / sub) mechanism that allows memory units to be subscribed to and shared by other agents, enabling cross-agent collaboration. For example... Figure 4 The diagram shown is a detailed flowchart of a memory operation platform in one embodiment. Figure 4 The intermediate infrastructure layer is the facility layer mentioned earlier. Figure 4 The diagram, from left to right, illustrates the complete memory processing pipeline from user input to parsing, scheduling, injection, and response generation. Each stage corresponds to coordinated module calls, with memory units serving as cross-layer carriers to achieve structured, governable, and traceable memory lifecycle management. Figure 4 Taking the interactive dialogue "My dog needs help" as an example, the response text output by the memory-based interaction method in this case is "To raise a dog, you need to prepare a comfortable...". The interaction process is explained in detail below:
[0073] First, the interface layer obtains the interaction session sent by the terminal, that is, the interaction session input through the target object identifier. Then, the interface layer obtains the interaction session input through the target object identifier; performs semantic understanding on the interaction session to obtain the session intent, subject entity, and context anchor; based on the session intent, subject entity, context anchor, and target object identifier, it generates a session context; it determines the first degree of matching between the session intent and a preset memory query intent; if the first degree of matching is greater than or equal to a first degree threshold, it generates a structured memory call request based on the session context.
[0074] The interface layer then sends the memory access request to the operation layer. The operation layer parses the memory access request and determines the session context for the interaction session.
[0075] Secondly, the operation layer obtains memory summaries of memory units of different memory types. The memory summaries include the memory tags and semantic index information of the corresponding memory units. For each memory type, based on the session context, the memory summaries of each memory unit belonging to the memory type, and the semantic index information, memory retrieval is performed on multiple memory units belonging to the memory type to retrieve at least one candidate memory unit belonging to the memory type. Based on the retrieved candidate memory units of different memory types, the target memory unit that matches the session context is determined.
[0076] Next, the operation layer determines the target object identifier of the input interaction session; obtains the historical session record of the target object identifier, which includes the usage frequency and interaction feedback of each memory unit in the historical interaction process of the target object identifier; and determines the memory state of the target memory unit based on at least one of the usage frequency and interaction feedback of the target memory unit in the historical session record.
[0077] Next, if the memory state of the target memory unit is valid, the operation layer calls the target memory unit through the large language model and determines the response text of the interaction session based on the memory load and interaction session in the target memory unit.
[0078] Then, the operation layer sends the response text to the terminal so that the terminal can display the response text.
[0079] Finally, after the terminal obtains the interactive feedback on the reply text, it sends it to the operation layer. Based on the interactive feedback, the operation layer updates the historical session record associated with the target object identifier, and based on the updated historical session record, verifies whether the memory state of the target memory unit associated with the target object identifier should be updated.
[0080] It's important to note that the above process can also update memory cells in real time. Relevant data within a memory cell is archived into MemoryVault and organized by user, task, or context. Archiving operations can be triggered by policies, user commands, or scheduled tasks, ensuring frequently accessed data remains active, while less frequently used data is cold-stored or stored long-term. The archiving phase also invokes Governance for permission encapsulation and compliance checks. Each memory cell is assigned a set of access control policies, such as Access Control Lists (ACLs), Time-to-Live (TTL), and conditional activation policies, which determine its availability based on user roles and task context. For example, a treatment summary might be fully visible to the nursing team but only partially visible to the patient. After watermarking, it can be registered in MemoryStore for inter-institutional sharing. This comprehensive governance and archiving pipeline ensures that all memory cells—across multiple modalities and agents—are processed in a structured, transparent, and traceable manner, ensuring compliance and efficiency in collaborative healthcare environments.
[0081] In the above embodiments, by acquiring and parsing memory call requests related to the interactive session, the session context of the interactive session is determined. Based on the session context and the memory summaries of each memory unit, a target memory unit matching the session context is selected from multiple memory units. This involves managing the reference memory units. Therefore, based on the session context of the interactive session, the relevant target memory unit is queried. If the target memory unit's memory state is valid, its availability is ensured. Then, through a large language model, the target memory unit is invoked. Based on the memory load in the target memory unit and the interactive session, the response text for the interactive session is determined. In other words, the pre-stored memory load in the target memory unit assists the large language model in acquiring relevant memory knowledge to accurately respond to the interactive session, ensuring the accuracy of the response text and thus improving the interaction effect. Furthermore, the above interactive processing architecture is highly valuable for long-term dialogue agents, personalized AI, and knowledge-intensive applications (such as enterprise knowledge bases and compliance systems), especially in applications that need to remember user preferences, track knowledge updates, and share memory across sessions / models. Furthermore, the memory operation platform in the aforementioned interactive processing architecture, based on an interface layer, operation layer, and facility layer, features a dynamic and adaptive memory management mechanism that addresses the limitations of existing large language models in long-context reasoning, continuous personalization, and knowledge consistency. The memory operation platform treats memory as an active and evolving part of the model's cognition, supporting long-term learning, adaptability, and cross-platform coordination. It also integrates three types of memory—parameter memory, activation memory, and plaintext memory—providing a unified framework that enables large language models to efficiently manage and utilize memory resources, significantly improving their performance in complex tasks. The memory operation platform adopts a three-layer architecture to ensure comprehensive and efficient memory management. The interface layer receives user input and parses it into memory-related tasks, such as retrieving, storing, or updating memory, ensuring seamless interaction between the user and the system. The operation layer manages the scheduling, organization, and evolution of different types of memory (parameterized memory, activation memory, and plaintext memory), ensuring efficient and coordinated memory operations. The facility layer provides support for secure storage, access governance, and cross-agent collaboration, ensuring memory security and availability, making it particularly suitable for multi-agent or cross-platform scenarios.
[0082] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0083] Based on the same inventive concept, this application also provides a memory-based interactive device for implementing the memory-based interactive method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more memory-based interactive device embodiments provided below can be found in the limitations of the memory-based interactive method described above, and will not be repeated here.
[0084] In one exemplary embodiment, such as Figure 5 As shown, a memory-based interactive device 500 is provided, including: a request parsing module 502, a memory unit filtering module 504, and a session response module 506, wherein:
[0085] The request parsing module 502 is used to obtain memory access requests for the interactive session, parse the memory access requests, and determine the session context for the interactive session.
[0086] The memory cell filtering module 504 is used to filter out target memory cells that match the session context from multiple memory cells based on the session context and the memory summary of each memory cell.
[0087] The conversation response module 506 is used to call the target memory unit through the large language model when the memory state of the target memory unit is valid, and determine the response text of the interaction session based on the memory load and interaction session in the target memory unit.
[0088] In some embodiments, the apparatus further includes a request construction module for obtaining an interactive session inputting a target object identifier through an interface layer; performing semantic understanding on the interactive session to obtain a session intent, a topic entity, and a context anchor; generating a session context based on the session intent, the topic entity, the context anchor, and the target object identifier; and generating a structured memory call request based on the session context.
[0089] In some embodiments, the request building module is used to determine a first degree of matching between the session intent and the preset memory query intent; if the first degree of matching is greater than or equal to the first degree threshold, the step of generating a structured memory call request based on the session context is returned to continue execution.
[0090] In some embodiments, the memory cell filtering module 504 is used to obtain memory summaries of memory cells of different memory types. The memory summaries include memory tags and semantic index information of the corresponding memory cells. For each memory type, based on the session context, the memory summaries of each memory cell belonging to the memory type, and the semantic index information, memory retrieval is performed on multiple memory cells belonging to the memory type to retrieve at least one candidate memory cell belonging to the memory type. Based on the retrieved candidate memory cells of different memory types, the target memory cell matching the session context is determined.
[0091] In some embodiments, the apparatus further includes a state determination module, configured to determine the target object identifier of the input interaction session; obtain historical session records of the target object identifier, the historical session records including the usage frequency and interaction feedback of each memory unit during the historical interaction process of the target object identifier; and determine the memory state of the target memory unit based on at least one of the usage frequency and interaction feedback of the target memory unit in the historical session records.
[0092] In some embodiments, the apparatus further includes a state update module for obtaining interactive feedback about the interactive session; updating the historical session record associated with the target object identifier based on the interactive feedback; and verifying, based on the updated historical session record, whether to update the memory state of the target memory unit associated with the target object identifier.
[0093] The modules in the aforementioned memory-based interactive device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0094] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 6As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a memory-based interactive method.
[0095] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0096] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0097] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0098] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0099] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0100] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0101] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0102] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A memory-based interaction method, characterized in that, The method includes: Obtain the memory access request for the interaction session, parse the memory access request, and determine the session context for the interaction session; Based on the session context and the memory summary of each memory unit, target memory units that match the session context are selected from multiple memory units; When the memory state of the target memory unit is valid, the target memory unit is invoked through the large language model, and the response text of the interaction session is determined based on the memory load in the target memory unit and the interaction session.
2. The method according to claim 1, characterized in that, The step of obtaining the memory access request for the interaction session includes: The interactive session that identifies the target object is obtained through the interface layer; The interactive session is semantically understood to obtain the session intent, topic entity, and context anchor. A session context is generated based on the session intent, topic entity, context anchor, and target object identifier; Based on the session context, a structured memory call request is generated.
3. The method according to claim 2, characterized in that, The method further includes: Determine the first degree of matching between the session intent and the preset memory query intent; If the first matching degree is greater than or equal to the first degree threshold, the step of generating a structured memory call request based on the session context continues.
4. The method according to claim 1, characterized in that, The step of filtering target memory units that match the session context from multiple memory units based on the session context and the memory digests of each memory unit includes: Obtain memory summaries for memory units of different memory types, wherein the memory summaries include memory tags and semantic index information for the corresponding memory units; For each memory type, based on the session context, the memory summary of each memory unit belonging to the memory type, and the semantic index information, memory retrieval is performed on multiple memory units belonging to the memory type to retrieve at least one candidate memory unit belonging to the memory type. Based on the retrieved candidate memory units of different memory types, a target memory unit that matches the session context is determined.
5. The method according to claim 1, characterized in that, The method further includes: Determine the target object identifier for the input interaction session; Obtain the historical session records of the target object identifier, the historical session records including the usage frequency and interaction feedback of each memory unit in the historical interaction process of the target object identifier; The memory state of the target memory unit is determined based on at least one of the usage frequency and interaction feedback of the target memory unit in the historical session records.
6. The method according to claim 5, characterized in that, The method further includes: Obtain interactive feedback regarding the interactive session; Based on the interactive feedback, the historical session records associated with the target object identifier are updated, and based on the updated historical session records, it is verified whether the memory state of the target memory unit associated with the target object identifier should be updated.
7. A memory-based interactive device, characterized in that, The device includes: The request parsing module is used to obtain memory access requests for the interaction session, parse the memory access requests, and determine the session context for the interaction session. The memory cell filtering module is used to filter out target memory cells that match the session context from multiple memory cells based on the session context and the memory summary of each memory cell; The session response module is used to, when the memory state of the target memory unit is valid, invoke the target memory unit through a large language model, and determine the response text of the interaction session based on the memory load in the target memory unit and the interaction session.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.