State determination method and device for agent memory
Patent Information
- Application Number
- CN202611486091.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-10-30
AI Technical Summary
[0002]现有智能体系统经常把“被搜索到”“返回给模型”“被回答采用”“被用户确认”都简化成访问次数,预取、调试读取以及未被模型使用的候选等事件也会提高记忆的强度,使低价值或错误记忆长期占据召回结果的前列
[0009]根据本公开的技术,提供了一种智能体记忆的状态确定方法及装置,对于记忆集合中的记忆,采用记忆的记忆类型对应的确定方式,确定记忆的有效性;根据智能体的请求处理链路中的记忆使用事件的事件类型,确定智能体在请求处理结果的生成过程中涉及的目标记忆的保留强度和置信度;根据有效性、保留强度和置信度,确定目标记忆的留存热度状态,从而结合有效性、保留强度和置信度进行记忆的留存热度状态的迁移,解决了智能体记忆在长期积累中出现的错误强化、事实过期等问题,实现了记忆的分级管理,提高了记忆的准确度和可靠性,有助于提高智能体处理结果的准确度。
Smart Images

Figure CN123014214A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence, specifically to the technical fields of large models, intelligent agents, cloud services, and natural language understanding, and particularly to a method, device, electronic device, storage medium, and computer program product for determining the state of an intelligent agent's memory, which can be applied to request processing scenarios of intelligent agents. Background Technology
[0002] Existing intelligent agent systems often simplify "being searched", "returned to the model", "being adopted by the answer", and "being confirmed by the user" into the number of visits. Prefetching, debugging reading, and candidate events that are not used by the model also increase the strength of memory, causing low-value or erroneous memories to occupy the top of the recall results for a long time. Summary of the Invention
[0003] This disclosure provides a method, apparatus, electronic device, storage medium, and computer program product for determining the state of an intelligent agent's memory.
[0004] According to the first aspect, a method for determining the state of an agent's memory is provided, including: for a memory in a memory set, determining the validity of the memory by adopting a determination method corresponding to the memory type; determining the retention strength and confidence of the target memory involved in the generation process of the request processing result by the agent according to the event type of the memory usage event in the agent's request processing chain; and determining the retention heat state of the target memory according to the validity, retention strength and confidence.
[0005] According to a second aspect, a device for determining the state of an agent's memory is provided, comprising: an validity determination unit configured to determine the validity of a memory by employing a determination method corresponding to the memory type in a memory set; a parameter determination unit configured to determine the retention strength and confidence level of the target memory involved in the generation process of the request processing result by the agent based on the event type of the memory usage event in the agent's request processing chain; and a state determination unit configured to determine the retention heat state of the target memory based on the validity, retention strength, and confidence level.
[0006] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in any implementation of the first aspect.
[0007] According to a fourth aspect, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing a computer to perform the method described in any implementation of the first aspect.
[0008] According to a fifth aspect, a computer program product is provided, comprising: a computer program that, when executed by a processor, implements the method as described in any implementation of the first aspect.
[0009] According to the technology disclosed herein, a method and apparatus for determining the state of an agent's memory are provided. For memories in a memory set, the validity of a memory is determined by determining the memory type. Based on the event type of the memory usage event in the agent's request processing chain, the retention strength and confidence of the target memory involved in the generation of the request processing result are determined. Based on the validity, retention strength, and confidence, the retention heat state of the target memory is determined. Thus, the retention heat state of the memory is transferred by combining the validity, retention strength, and confidence. This solves the problems of false reinforcement and fact expiration that occur in the long-term accumulation of agent memories, realizes hierarchical management of memories, improves the accuracy and reliability of memories, and helps to improve the accuracy of agent processing results.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is an exemplary system architecture diagram that can be applied to an embodiment of this disclosure; Figure 2 This is a flowchart of an embodiment of the method for determining the state of an intelligent agent's memory according to the present disclosure; Figure 3 This is a schematic diagram illustrating the process of determining the validity of derived memories according to this embodiment; Figure 4 This is a schematic diagram of the transition of the memory lifecycle state machine according to this embodiment; Figure 5 This is a schematic diagram illustrating an application scenario of the intelligent agent memory state determination method according to this embodiment; Figure 6 This is a flowchart of yet another embodiment of the method for determining the state of an intelligent agent's memory according to the present disclosure; Figure 7 This is a structural diagram of one embodiment of the intelligent agent memory state determination device according to the present disclosure; Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present disclosure. Detailed Implementation
[0012] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0013] The technical solutions disclosed herein involve the collection, storage, use, processing, transmission, provision, and disclosure of various types of information, such as user personal information, in accordance with relevant laws and regulations and do not violate public order and good morals.
[0014] Figure 1 An exemplary architecture 100 is shown that the state determination method and apparatus for intelligent agent memory can be applied to this disclosure.
[0015] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. The communication connections between terminal devices 101, 102, and 103 form a network topology. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0016] Terminal devices 101, 102, and 103 can be hardware or software that supports network connectivity for data acquisition, interaction, and processing. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices that support network connectivity, information acquisition, interaction, display, and processing functions, including but not limited to smartphones, tablets, e-book readers, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices. They can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are imposed here.
[0017] Server 105 can be a server providing various services, such as a server that determines the request processing result based on memories recalled from the memory set by an agent in response to query requests issued by terminal devices 101, 102, and 103. Furthermore, the server can determine the retention strength and confidence level of the target memory involved in the generation of the request processing result by considering the event type of memory usage events in the agent's request processing chain, thereby determining the retention heat status of the target memory. As an example, server 105 can be a cloud server.
[0018] It should be noted that a server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules (such as software programs or software modules used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0019] It should also be noted that the method for determining the state of an intelligent agent's memory provided in the embodiments of this disclosure is generally executed by a server, but the possibility of it being executed by a terminal device, or by the server and the terminal device cooperating with each other, is not excluded. Accordingly, the various parts (e.g., various units) included in the intelligent agent's memory state determination device can be all located in the server, all located in the terminal device, or separately located in the server and the terminal device.
[0020] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included. When the electronic device on which the agent's memory-based state determination method runs does not need to transmit data with other electronic devices, the system architecture may only include the electronic device (e.g., a server or terminal device) on which the agent's memory-based state determination method runs.
[0021] Please refer to Figure 2 , Figure 2 A flowchart illustrating a method for determining the state of an intelligent agent's memory, provided in an embodiment of this disclosure. Flowchart 200 includes the following steps: Step 201: For memories in the memory set, determine the validity of the memory by using the method corresponding to the memory type.
[0022] In this embodiment, the execution subject of the state determination method of the intelligent agent memory (e.g., Figure 1 For memories in the memory set, the validity of the memory is determined by the method corresponding to the memory type.
[0023] In an intelligent agent system, memory refers to the information units acquired, generated, or accumulated by the agent in the process of responding to user requests, performing tasks, or interacting with the external environment. It is the knowledge foundation upon which the agent relies for reasoning and decision-making in the subsequent generation of request processing results. The memory set is the collection of all the memories held by the agent, and each memory carries the agent's cognition of a certain entity, event, user preference, or historical interaction fragment.
[0024] During an interaction with a user, the agent learns that "User A's permanent residence is in City A," and this information is written into the memory set, forming a memory. In another interaction, the agent summarizes "User A prefers light-flavored food" based on multiple historical preference records of User A, and this summary result is also written into the memory set, forming another memory.
[0025] Memory types are classifications of memories within a memory set based on their content structure, generation method, or semantic features. Different memory types differ in their content organization, update logic, and lifecycle characteristics, thus requiring their respective identification methods to determine their validity. For example, memory types include at least atomic factual memories and derived memories. Atomic factual memories are the smallest indivisible units of memory representing a single fact; derived memories are memories generated based on one or more other memories through reasoning, induction, or calculation, and their validity presupposes the validity of the memories they depend on.
[0026] In the example above, "User A's permanent residence is in City A" is an atomic fact memory, which is a single fact that cannot be further divided; "User A prefers light-flavored food" is a derived memory, which is derived from multiple historical interaction records, and its validity depends on the fact that the memories corresponding to those historical interaction records are still valid.
[0027] Validity refers to the attribute state of whether a memory is still true, valid, and can be referenced by an agent at the current moment. A memory is determined to be valid because the information it carries is still valid at the current moment, and the agent can use it as a basis in the process of generating the request processing result. A memory is determined to be invalid because the information it carries is no longer valid, has expired, or has lost its reliable basis at the current moment, and the agent should no longer use it as a basis for generating the request processing result.
[0028] If User A has moved to Location B, then the atomic fact memory "User A's permanent residence is Location A" no longer holds true at the current moment, and its validity should be deemed invalid. Correspondingly, the derived memory "It is suitable to recommend local life services in Location A to User A" that depends on this fact also loses its validity because the fact on which it depends no longer holds true.
[0029] As an example, when a memory is written into a memory set, the validity determination logic corresponding to its memory type is synchronously bound to it. The binding operation embeds the determination logic into the memory's metadata in the form of executable rules, enabling the memory itself to carry the criteria for determining its validity. Memory types include atomic fact memories and derived memories. For atomic fact memories, the bound determination logic is based on the consistency between the factual content carried by the atomic fact memory and the current system perception state; for derived memories, the bound determination logic is based on whether the upstream memory on which the derived memory relied when it was generated has changed at the current moment.
[0030] When it is necessary to determine the validity of a memory, the associated decision logic is extracted directly from the memory's metadata, and this decision logic is executed based on the current system state to obtain the memory's validity determination result. The validity determination result is either valid or invalid.
[0031] As another example, the memory to be validated is retrieved from the memory set. The memory to be validated can be all the memories in the memory set, or it can be a portion of the memories in the memory set that meet preset trigger conditions. The preset trigger conditions include situations such as the memory's write time reaching a preset review cycle, the entity information associated with the memory being updated, or the agent referencing the memory in the request processing chain.
[0032] Maintain a validity determination service independent of the memory set. This service has pre-defined determination methods for each memory type. These methods are registered using type identifiers as indexes, and the determination methods for different memory types are independent of each other in terms of judgment criteria and execution process. Memory types include atomic fact memories and derived memories.
[0033] When it is necessary to determine the validity of a memory in the memory set, the validity determination service receives the memory to be determined and its memory type identifier. Based on the memory type identifier, the validity determination service selects the determination method corresponding to the memory type from the registered determination methods, and executes the selected determination method with the content of the memory as input, obtaining the validity determination result of the memory. The validity determination result is either valid or invalid.
[0034] In this implementation, the validity determination logic is decoupled from the memory ontology. The determination methods for each memory type are centrally managed in an independent service component. The memory itself does not carry the determination logic; the validity determination is dynamically scheduled by an external service based on the memory type identifier. When the determination method for a certain memory type needs to be adjusted or expanded, only the registration logic in the validity determination service needs to be updated; there is no need to modify each existing memory in the memory set individually.
[0035] In some optional implementations of this embodiment, the execution entity performs step 201 as follows: in response to the memory being an atomic fact memory, the validity of the atomic fact memory is determined based on the fact validity time interval of the atomic fact memory and the system perception time interval.
[0036] The effective time interval of a fact refers to the time attribute during which the factual content carried by an atomic factual memory remains valid in the objective world. It can be represented by the fields valid_from (effective date) and valid_to (expiration date). Different atomic factual memories have different effective time intervals due to the differences in the time characteristics of the factual content they carry. For example, some facts have long-term stability, and their effective time intervals span a long period; some facts have time-limited characteristics, and their effective time intervals span a short period or have a clear end point.
[0037] For example, the fact carried by the atomic fact memory "User A's ID number is XX" has long-term stability, and its effective time interval will not expire naturally under normal circumstances; the fact carried by the atomic fact memory "User A's current membership card is valid until December 31, 2026" has a clear end point, and its effective time interval is bounded by December 31, 2026.
[0038] The system awareness time interval refers to the time range within which the system learns about and revokes facts, which can be represented by the fields recorded_at (recorded time) and invalidated_at (invalidated time). Specifically, the system awareness time interval has two layers of meaning: first, the time when the system learns about the atomic fact memory, that is, the time node when the system first records and perceives the existence of the fact (recorded time); second, the time when the system revokes the atomic fact memory, that is, the time node when the system determines that the fact is no longer true and marks it as invalid (invalidated time).
[0039] For example, if the atomic fact memory "User A currently resides in location A" is obtained and recorded by the system through interaction with User A on March 10, 2026, then the system obtained the fact on March 10, 2026. Subsequently, if User A moves to location B in July 2026, and the system obtains the change through a new interaction on July 15, 2026 and cancels the original fact, then the system cancels the fact on July 15, 2026.
[0040] As an example, the above determination process can be represented as: business_valid(F, tq) = (valid_from <= tq) AND (valid_to IS NULL ORtq < valid_to); system_known(F, ts) = (recorded_at <= ts) AND (invalidated_at IS NULLOR ts < invalidated_at) validity_gate(F,q) = business_valid(F, question_time) system_known(F, evaluation_time) The query request retrieves the business time (tq) to be queried, and then performs range determination by comparing the current time with both the actual valid time interval and the system-perceived time interval. The specific determination logic is as follows: Determine whether the atomic fact memory F is within its business lifecycle at the business time tq. That is, the atomic fact memory is active (valid_from <= tq) and has not expired (valid_to is empty or tq < valid_to). This ensures that the request processing result matches the actual state at the time the fact occurred.
[0041] Determine whether the atomic fact memory F has been recorded and not invalidated at the system evaluation time ts. That is, the data has been stored (recorded_at <= ts) and has not been explicitly invalidated (invalidated_at is empty or ts < invalidated_at). This ensures that the system truly "knows" this information at the current processing time and has not marked it as an error.
[0042] Multiply the two conditions above (logical AND) to form the final filter. Only if the atomic fact memory is valid in both the business time period being queried and available in the system at the time of evaluation is the result allowed (valid). If either dimension is not satisfied, the result is 0 (invalid).
[0043] In this implementation, dual time range constraints ensure that atomic fact memories are only considered valid when they are objectively valid and the system's cognition has not been revoked, thus avoiding the use of invalid facts and improving the accuracy and reliability of the memories.
[0044] In some optional implementations of this embodiment, the execution entity determines the validity of the atomic fact memory in the following way: based on the fact validity time interval of the atomic fact memory, the system perception time interval, and the judgment result of the atomic fact memory based on the fact establishment conditions, the validity of the atomic fact memory is determined.
[0045] The conditions for establishing facts refer to a set of preconditions used to determine whether the factual content carried by an atomic factual memory is sufficient to be established at the evidentiary level. The conditions for establishing facts include, but are not limited to, the following three sub-conditions: Sufficient evidence refers to the fact that the evidence supporting the facts recorded in the atomic fact memory is sufficient in both quantity and quality to provide a reasonable basis for the establishment of the facts, and there is no situation where the evidence is missing or weak enough to support the establishment of the facts.
[0046] Temporal certainty refers to the factual content recorded by the atomic factual memory not overlapping with other factual memories in the temporal dimension and not having a determined priority order. In other words, the temporal attribution of the fact is clear and determinable, and there is no uncertainty in the attribution of the fact due to temporal overlap.
[0047] Source consistency means that there is no contradiction or conflict between the factual content recorded by the atomic factual memory and its information source. In other words, the information from each source of the fact is consistent in its content orientation, and there is no situation where different sources give opposite conclusions about the same fact.
[0048] First, check whether the atomic fact memory is associated with an explicit superseded_by flag or has been manually marked as invalid. If either of these conditions exists, the atomic fact memory is directly determined to be invalid, while its recorded content is retained for audit-related retrieval, and the process ends.
[0049] If the atomic fact memory is not explicitly replaced and not manually marked as invalid, and the system determines the effective time interval and the system-perceived time interval of the atomic fact memory through the above-mentioned implementation method, and the determination result indicates that the conditions for the establishment of the fact are met, namely, sufficient evidence, non-overlapping time, and non-conflicting sources, then the validity is determined to be ACTIVE. If the determination result indicates that there is at least one of the following situations: insufficient evidence, uncertain time overlap, or conflicting sources, then the system does not immediately replace the atomic fact memory with other facts, but instead sets the validity status of the atomic fact memory to DISPUTED, retaining its recorded content for subsequent verification and adjudication.
[0050] In this implementation, by jointly verifying the time range and the conditions for the validity of facts, atomic fact memories are assigned a graded validity status to prevent the misuse of facts with questionable evidence and avoid rashly replacing the original memory, thereby further improving the accuracy and reliability of atomic fact memories.
[0051] Continue to refer to Figure 3 This diagram illustrates the process of determining the validity of derived memories.
[0052] In some optional implementations of this embodiment, the execution entity performs step 201 as follows: First step, in response to a change in the atomic fact memory upon which the memory depends, the actual generation context of the derived memory is determined based on the current generation environment of the derived memory and the set of atomic fact memories upon which the derived memory currently depends; Second step, in response to a discrepancy between the actual generation context and the generation context of the record corresponding to the derived memory in the database, the validity of the derived memory is determined based on the set of atomic fact memories.
[0053] The generation environment refers to the set of external operating conditions and configuration parameters in which the derived memory is generated.
[0054] The generation context refers to the complete information foundation upon which derived memory is based during its generation process. It is composed of the generation environment and the set of atomic fact memories upon which it depends. The generation context fully describes all the preconditions and information inputs for the generation of derived memory. The semantic content of derived memory is essentially the product of processing the various elements in the generation context.
[0055] The actual generation context refers to the generation context determined at the current moment based on the current generation environment of the derived memory and the set of atomic fact memories upon which the derived memory currently depends. The actual generation context reflects the complete information foundation upon which the derived memory can be based if it were to be regenerated at the current moment, and its content changes dynamically with changes in the underlying atomic fact memories and adjustments to the generation environment.
[0056] The generation context of a record refers to the generation context that is persistently stored in the database along with the derived memory at the time of its original generation. The generation context of a record solidifies the generation environment at the time of the generation of the derived memory and the state of the set of atomic fact memories on which it depends, serving as a historical benchmark for subsequent verification of whether the basis for the generation of the derived memory has changed.
[0057] In response to a memory being a derived memory, and the atomic fact memory upon which the derived memory depends having changed, the current generation environment of the derived memory is obtained, along with the set of atomic fact memories it currently depends on. Based on the current generation environment and the set of atomic fact memories it currently depends on, the actual generation context of the derived memory is determined. In this implementation, a memory graph is used to represent the relationships between entities, atomic fact memories, and derived memories. While the system appends forward edges to `derived_from`, it simultaneously maintains a reverse dependency index based on atomic fact version identifiers. When any atomic fact version undergoes a state change, is replaced, or becomes invalid, the system directly retrieves the set of all downstream derived memory nodes that depend on that fact version through the reverse dependency index, avoiding full graph traversal and ensuring locality and low latency in cascading updates. (Continue to refer to...) Figure 3 F1-v1 and F1-v2 are different atomic fact memory versions, and D-v1 and D-v2 are different derived memory versions. The arrows in the diagram represent switching / deactivation messages between memory versions, not modifications to the content of the memory versions.
[0058] After the new derived memory version is generated and persisted, the system does not directly modify the old memory version record. Instead, it publishes a version switch event to the message bus, asynchronously triggering the following four independent operations: First, it updates the current version pointer (current_version) of the logical memory, causing the old derived memory version to exit the normal recall channel and only remain in audit (corresponding to the management audit query mode) and historical query path (corresponding to the backtracking query mode); Second, it triggers a graph edge local update task, closing the derived_from active edge pointing to the old version and activating the dependent edge pointing to the new version; Third, it sends an invalidation message to the search index service, deleting or hiding the vector index and full-text index documents corresponding to the old version to prevent dirty data from being retrieved; Fourth, it sends a cache eviction instruction to the distributed cache cluster, clearing the runtime projection cache of the old version. The above operations are decoupled through event-driven mechanisms, ensuring low latency and eventual consistency in the main write chain.
[0059] The cascading propagation of derived memories strictly adheres to the immutable version principle, prohibiting in-situ content overwriting of old derived nodes. Old derived memory versions are preserved intact as historical evidence, while new content is written to independent new version records. To ensure processing consistency in a distributed environment, each propagation task carries a dependency fingerprint calculated using the dependency fact version set, the generation policy identifier (policy_snapshot_id), and the algorithm version (algorithm_version). Before processing affected nodes, the propagation executor first compares the node's currently stored fingerprint with the task target fingerprint; if they match, it indicates that the node has been recalculated based on the latest dependencies, and the task is idempotently skipped; if they do not match, a local regeneration process is triggered. This mechanism effectively prevents duplicate message delivery, network retries, or concurrent scheduling-induced redundant calculations and state corruption, ensuring the traceability, replayability, and determinism of the derived memory evolution process.
[0060] The record generation context corresponding to the derived memory is read from the database. The record generation context is a persistent snapshot of the generation context at the original generation time of the derived memory, recording the generation environment on which the derived memory was based and the state of the set of atomic fact memories on which it depended.
[0061] The actual generation context is compared with the recorded generation context. The purpose of this comparison is that the semantic content of derived memory is determined by its generation context. When the underlying atomic fact memory changes, the actual generation context may differ from the recorded generation context. This difference means that the information basis upon which the derived memory is established is different from its original generation basis, and its content may no longer accurately reflect the current state of the underlying facts. By comparing whether the two contexts are consistent, it can be determined whether the basis for the generation of the derived memory has undergone a substantial change, thus deciding whether its validity needs to be reassessed.
[0062] If the comparison result shows that the actual generation context is consistent with the recorded generation context, it indicates that although the atomic fact memory on which it depends is marked as changed, the change has not had a substantial impact on the generation basis of the derived memory, maintaining the original validity state of the derived memory, and the process ends.
[0063] If the comparison result shows that the actual generation context is inconsistent with the recorded generation context, it indicates that the generation basis of the derived memory has undergone substantial change. Based on the set of atomic fact memories that the derived memory currently relies on, the validity of the derived memory is determined. Based on the current state of each atomic fact memory in the currently relied-on set, it is determined whether the derived memory can still be correctly derived from the currently valid atomic fact memories, and the validity of the derived memory is determined accordingly. The determined validity result is written into the record of the derived memory for subsequent use in determining the retention rate of the derived memory.
[0064] In this implementation, the actual and recorded contexts are compared to identify the substantial changes in the basis for generation. The validity re-evaluation is triggered only when the information basis of the derived memory changes, so that the validity of the derived memory is precisely linked with the underlying atomic facts, avoiding redundant checks on the derived memory that has not been substantially affected.
[0065] In some optional implementations of this embodiment, the atomic fact memory includes at least one fact memory version `fact_version_id`, and the derived memory includes at least one derived memory version `derived_memory_version_id`. It should be noted that the generation context `generation_context` includes the set of atomic fact memories, generation strategy, and generation algorithm upon which the derived memory version depends for generation, and is not equivalent to the derived content version `derived_memory_version_id`.
[0066] A memory version refers to an independent snapshot of the same memory over time. Atomic factual memories generate a new version with each update as the facts change within their lifecycle; derived memories are regenerated when their basis for generation changes, resulting in a new version. These versions are independent of each other, arranged sequentially, and together constitute the complete evolutionary sequence of the memory. At any given time, only one version of the same memory is currently valid; the others are retained as historical records. In this implementation, a memory graph can be used to represent the relationships between entities, atomic factual memories, and derived memories.
[0067] Each fact memory version and each derived memory version are stored independently and persistently. Different types of memories store different fields. For example, the fact memory version `fact_version_id` should store `evidence_context`, including `source_id` (identifier of the evidence data source), `evidence_version_id`, the fact validity time, and the system awareness time, etc.; the derived memory version `derived_memory_version_id` stores the generation context `generation_context`, the dependency fingerprint `dependency_fingerprint` (identifier data of the generation context), the generation policy identifier `policy_snapshot_id`, and the generation algorithm version `algorithm_version`. Version attribution edges and dependency relationship edges are stored in the database in an association structure, allowing any version to trace back to the fact memory versions on which its generation was based along dependency relationship edges, and also to trace back to the complete version sequence of its memory along version inclusion edges.
[0068] In this implementation, the aforementioned execution entity performs the first step described above in the following manner to determine the actual generation context of the derived memory: in response to a change in the version of the derived memory upon which the memory depends, the actual generation context of the derived memory version is determined based on the current generation environment of the derived memory version and the set of atomic fact memories composed of the fact memories upon which the derived memory version currently depends.
[0069] In this implementation, the aforementioned execution entity performs the second step described above to determine the validity of the derived memory in the following manner: in response to the inconsistency between the actual generation context and the record generation context corresponding to the derived memory version in the database, and the atomic fact memory set being a non-empty set, a new derived memory version is generated based on the atomic fact memory set, and the validity of the new derived memory version is determined.
[0070] First, in response to the memory being a derived memory version, it is identified whether there is a change in the fact memory version `fact_version_id` among the atomic fact memories that the derived memory version depends on (e.g., a new version is generated). In response to the existence of such a fact memory version change, the current generation environment of the derived memory version is obtained, and each fact memory version that the derived memory version currently depends on is obtained, forming an atomic fact memory set. Based on the current generation environment and the atomic fact memory set, the actual generation context of the derived memory is determined.
[0071] The system retrieves the record generation context corresponding to the derived memory from the database and compares the actual generation context with the record generation context. If the comparison result shows that the actual generation context matches the record generation context, it indicates that although the version of the factual memory on which the derived memory is relied is marked as changed, the change has not had a substantial impact on the basis for the generation of the derived memory. The system maintains the validity of the current version of the derived memory, and the process ends.
[0072] If the comparison result shows that the actual generation context is inconsistent with the record generation context, further determine whether the atomic fact memory set is empty. If the atomic fact memory set is empty, it indicates that the derived memory currently has no valid fact memory version as a generation basis. Set the validity status of the derived memory version to INVALIDATED and generate invalidation messages for graph edges, search indexes, and caches. In response to the atomic fact memory set being non-empty, based on the current content of each fact memory version in the atomic fact memory set and according to the current generation environment of the derived memory, generate a new derived memory version. The new derived memory version is the latest content expression of the derived memory under the current generation basis. It is stored as the latest node in the derived memory version sequence, and dependency edges are established between the new derived memory version node and each of the dependent fact memory version nodes. Subsequently, determine the validity of the new derived memory version and write the validity determination result into the record of the new derived memory version for use in subsequent determination of the retention popularity status of the derived memory.
[0073] In this implementation, the affected derived memory is precisely located using the factual memory version as the change perception granularity. The updated result is carried by generating a new derived memory version, which balances the accuracy of validity determination and the historical traceability of memory evolution.
[0074] In some optional implementations of this embodiment, the generation environment includes a generation strategy and a generation algorithm. The generation strategy refers to a set of rules that determine under what conditions derived memories are triggered and how the generation process is organized. The generation strategy specifies the preconditions for triggering derived memory generation, the selection range of atomic fact memories participating in the generation, and the output format of the generation result. For example, the generation strategy may include: triggering the aggregation generation of facts related to an entity when the number of atomic fact memories associated with a certain entity reaches a preset threshold; triggering reasoning generation based on the above association when two or more logically related atomic fact memories simultaneously meet preset conditions. In addition, the generation environment may also include a generation environment identifier and a dependency fingerprint of the generation environment (a snapshot of the dependencies / strategies / algorithms used when generating derived memory versions); each derived memory version saves an immutable generation context, and a current_version pointer is set to indicate the generation context corresponding to the derived memory version, without rewriting its historical generation context. New memory versions enter the normal recall channel through the current_version pointer.
[0075] A generation algorithm is a computational method that transforms the specific content of an atomic fact memory set into a semantic expression of derived memory. The generation algorithm receives the atomic fact memory set as input and outputs the content text of the derived memory according to a defined computational logic. For example, generation algorithms may include: summarization algorithms that summarize and refine multiple atomic fact memories, logical reasoning algorithms that derive unknown conclusions based on known facts, and statistical algorithms that summarize numerical facts, etc.
[0076] In this implementation, the aforementioned execution entity generates a new version of the derived memory in the following way: by adopting a generation strategy and generation algorithm, a new version of the derived memory is generated based on the atomic fact memory set.
[0077] After determining that the actual generation context is inconsistent with the record generation context and that the atomic fact memory set is a non-empty set, the generation strategy and generation algorithm corresponding to the derived memory are obtained.
[0078] Based on the organization method specified by the generation strategy, the content of each fact memory version is extracted from the atomic fact memory set as the generation input. The generation algorithm performs calculation processing on the above input and outputs the semantic content of the new derived memory version. The new derived memory version is stored as the latest node in the derived memory version sequence, and a dependency relationship edge derived_from is established between the new derived memory version node and each fact memory version node it depends on. Subsequently, the validity of the new derived memory version is determined, and the validity determination result is written into the record of the new derived memory version.
[0079] In this implementation, the aforementioned execution entity can also perform the following operation: store the actual generation context as the generation context of the record corresponding to the derived memory in the database.
[0080] After the new derived memory version is generated and its validity is confirmed, the actual generation context is stored in the database as the record generation context corresponding to the new derived memory version, and the current pointer indicates the record generation context corresponding to the new derived memory version. This update operation restores the record generation context to be consistent with the current actual generation basis, ensuring that if a consistency check is triggered again in the future, the comparison benchmark reflects the true state at the time of the most recent generation, avoiding unnecessary repeated triggering of the check process due to the lag in the record generation context.
[0081] In this implementation, the reproducibility of the new derived memory version generation process is ensured by the generation strategy and generation algorithm. By synchronizing the record generation context with the actual generation context, the benchmark for subsequent consistency verification is always aligned with the latest generation state, eliminating duplicate verification and ensuring the orderliness and reliability of the state determination process.
[0082] In some optional implementations of this embodiment, the execution entity may also perform the following operation: determine the confidence level of the new derived memory version based on the confidence level and source credibility of the fact memory version in the atomic fact memory set, as well as its contribution to the new derived memory version.
[0083] The confidence level of a memory version characterizes the accuracy and reliability of the memory content itself. Source credibility measures the authority and reliability of the channel through which the memory was obtained, and should focus on determining: who the source is; whether the source is certified; whether the content has been tampered with; whether the source is authoritative; whether the link between the evidence version and the factual version is complete; and whether the current scope matches.
[0084] Source credibility does not directly determine whether the factual content is correct, but rather whether the system believes that the evidence truly comes from its claimed source. For example, a source from a signed, authoritative database has high credibility; a source from a certified business tool has high credibility; a source explicitly confirmed by the user has high credibility; a source from a regular uploaded document has medium credibility; a source from unverified webpage content has low credibility; and a source from a model's self-statement has low credibility. These specific values should be flexibly configured based on the strategy snapshot.
[0085] As an example, for each piece of evidence e_j, its corresponding source credibility is calculated using the following formula: p_j=source_type_weight authentication_factor integrity_factor authority_factor provenance_completeness source_type_weight, authentication_factor, integrity_factor, authority_factor, and proofenance_completeness represent the source type weight, authentication factor, integrity factor, authority factor, and proofenance_completeness, respectively.
[0086] The following formula is used to restrict p_j to [0,1]: p_j=clamp(p_j,0,1) If a memory version is supported by multiple pieces of evidence, the overall source credibility of the memory version can be calculated based on the directness of the evidence or its contribution weight: provenance_trust=Σ(α_j p_j) / Σ(α_j) Where p_j represents the source credibility of the j-th piece of evidence; α_j represents the relevance weight of the evidence to the current memory; α_j can be determined by the directness of the evidence, contribution weight, or source priority.
[0087] The lower the provenance_trust, the lower the final recall score of the memory. However, it cannot turn invalid facts with a gate validity_gate=0 used for memory recall back into valid facts.
[0088] Contribution refers to the degree to which each atomic fact memory in the atomic fact memory set plays a role in the semantic content of the newly derived memory version during the generation process, with a value ranging from [0,1]. The higher the contribution, the more decisive the atomic fact memory is in the content expression of the new derived memory version; the lower the contribution, the more auxiliary or marginal the atomic fact memory plays in the content expression of the new derived memory version.
[0089] In this implementation, the contribution can be calculated using methods such as counterfactual difference after removing the memory, implication / reference relationship between the answer token and the memory fragment, attention attribution, Shapley approximation, small model discrimination, or a combination thereof. Taking the counterfactual difference method after removing the memory as an example, firstly, a baseline result is generated using all candidate memories, and the task quality Q_all = Q(M) is calculated, where M is the candidate memory; then, the i-th memory is removed sequentially, keeping other inputs and generation conditions unchanged, and the result is recalculated: Q_without_i = Q(M - {mi}); the difference between the two values represents the impact of the memory: delta_i = Q_all - Q_without_i; the positive difference is normalized: credit_i = max(delta_i, 0) / sum(max(delta_j, 0)), the larger delta_i is, the more significant the decrease in task quality after removing the memory, and the greater the contribution of the memory.
[0090] Taking attention-based attribution as an example, the token range corresponding to each memory is marked in the context, and the attention of the answer token to each memory token is recorded when the model generates the answer. The attention of each layer, each attention head, and the answer token is then weighted and summarized. A_i=sum(layer_head_weight attention(answer_token,memory_token_i)) Wherein, layer_head_weight is the layer-head weight, which refers to the weighting coefficients assigned to different network layers and different attention heads, used to reflect the differences in the importance of each layer / head in the contribution evaluation; answer_token represents the answer token (or generated token), which refers to each token produced by the model in the process of generating the response; memory_token_i represents the i-th memory token, which refers to the token sequence in the context that is marked as the i-th memory segment.
[0091] Normalize the memory length and all candidate memories: credit_i = A_i / sum(A_j) This approach uses the model's level of attention as a contribution signal, but attention is not necessarily equivalent to the actual causal contribution and is usually used as an auxiliary signal.
[0092] As an example, the confidence level of the new derived memory version can be determined using the following formula: derived_confidence=clamp(Σ(credit_i×fact_confidence_i×evidence_source_trust_i) / Σ(credit_i),0,1) Here, `derived_confidence` represents the confidence level of the newly derived memory version; `credit_i`, `fact_confidence_i`, and `evidence_source_trust_i` represent the contribution of the fact memory version to the newly derived memory version, the confidence level of the fact memory version, and the source trust level, respectively. The numerical truncation function `clamp` is used to truncate the normalized value between 0 and 1. When the denominator `Σcrediti` is zero or the dependency set is empty (n=0), the system does not perform division operations, directly initializes `derived_confidence` to the preset base confidence threshold (e.g., 0.5), or marks the derived node as `INVALIDATED` and blocks normal recall. Before constructing the atomic fact memory set, the system performs pre-filtering based on the validity state (`validity_state`). Atomic fact memories in the `DISPUTED` or `INVALIDATED` states are removed from the summation set and do not participate in the calculation of the numerator and denominator, preventing low-quality or conflicting evidence from contaminating the confidence assessment of derived memories.
[0093] In this implementation, the influence of each atomic fact memory on the new derived memory version is quantified by the contribution of each atomic fact memory, and the confidence level is determined accordingly, so that the validity judgment is based on a measurable and credible foundation, thereby improving the accuracy of validity.
[0094] In some optional implementations of this embodiment, the atomic fact memory in memory is generated and updated in the following manner: First step, extract atomic facts representing the fact values of entities in the attribute dimension from the evidence data source, and determine the evidence version of the evidence data source; Second step, in response to the existence of a target atomic fact memory in the memory set that is consistent with the entity and attribute dimension of the atomic facts, and the fact value of the target atomic fact memory is different from the fact value of the atomic facts, determine the conflict resolution result of the target atomic fact memory and the atomic facts according to their respective fact validity time intervals, source credibility, and preset conflict resolution rules; Third step, determine the new fact memory version of the target atomic fact memory according to the conflict resolution result.
[0095] Evidence data sources may include, for example, user session records, system document content, tool call return results, or external event streams. Each evidence data source generates a unique source_id upon receipt, and an immutable evidence version evidence_version_id or content hash is generated based on the original content of the evidence data source, the receipt time, and the integrity verification result to ensure the integrity and verifiability of fact tracing. The atomic fact memory version generated based on this only references the evidence version and does not modify the original evidence content.
[0096] As an example, the system first extracts atomic facts representing the factual values of entities in the attribute dimension from the evidence data source. These atomic facts include the entity, attribute dimension, factual value, occurrence time, source credibility, source type, and sensitivity level. Then, the content of the atomic facts is normalized into a `fact_key`, and based on this `fact_key`, the system queries the memory set to see if a target atomic fact memory exists that matches the entity and attribute dimension of the atomic facts. If it exists, and the factual value of the target atomic fact memory differs from that of the atomic facts, the conflict resolution result between the target atomic fact memory and the atomic facts is determined based on their respective effective time intervals, source credibility (`evidence_source_trust`), and preset conflict resolution rules. The conflict resolution rules are used to determine whether there are conflicts such as time overlap between the target atomic fact memory and the atomic facts.
[0097] Finally, in response to the lack of conflict, a new version of the target atomic fact memory is determined. In this implementation, a conflict resolution mechanism based on the effective time interval of the fact and the credibility of the source ensures that the atomic fact memory maintains semantic consistency and logical reliability during dynamic updates, effectively supporting the accurate derivation and evolution of subsequent memory structures.
[0098] This implementation provides an update process for atomic fact memories, which improves update accuracy and ensures traceability between fact memory versions.
[0099] In some optional implementations of this embodiment, the execution entity further performs the following operations: in response to the existence of a target atomic fact memory consistent with the atomic fact in the memory set, it adds supporting evidence for the target atomic fact memory and updates the confidence level of the target atomic fact memory.
[0100] If a target atomic fact memory exists in the memory set that is consistent with the atomic fact in terms of entity, attribute dimension, and fact value, then the evidence source corresponding to the atomic fact is registered as supporting evidence for the target atomic fact memory, thereby increasing the number of supporting evidence associated with the target atomic fact memory. Based on this, the confidence level of the target atomic fact memory is updated according to the newly added supporting evidence to reflect the increased credibility of the target atomic fact memory after obtaining more independent corroboration.
[0101] In this implementation, by accumulating independent supporting evidence for consistent target atomic fact memories and updating the confidence level accordingly, the reliability of the memory is progressively enhanced with multi-source corroboration, thereby improving the stability and credibility of the memory content.
[0102] Step 202: Based on the event type of the memory usage event in the agent's request processing chain, determine the retention strength and confidence of the target memory involved in the generation of the request processing result by the agent.
[0103] In this embodiment, the aforementioned execution entity determines the retention strength and confidence level of the target memory involved in the generation of the request processing result by the intelligent agent based on the event type of the memory usage event in the request processing chain of the intelligent agent.
[0104] A request processing chain refers to the complete processing flow that an agent undergoes from receiving a user request to finally outputting the request processing result. The request processing chain typically includes multiple stages such as request understanding, memory retrieval, context assembly, inference computation, result generation, and result verification, with each stage sequentially executed according to a preset order. During the execution of the request processing chain, the agent needs to invoke memories from its memory set as the context for inference and generation, thereby generating memory usage behavior.
[0105] A memory usage event is an event recorded when an agent interacts with a memory in the memory set during the execution of a request processing chain. Each interaction corresponds to one memory usage event, which records the target memory involved in the interaction and the nature of the interaction.
[0106] Event types are classifications of memory usage events based on their behavioral nature and semantic function. Different event types reflect how an agent uses the target memory in different ways during the request processing chain, and also reflect the different treatment the content of the target memory receives in this request processing. Event types include, but are not limited to, the following: In the proactive recall type, the agent actively retrieves and obtains the target memory from the memory set based on query conditions in the request processing chain, indicating that the memory is relevant to the current request.
[0107] In the reference-based approach, the agent actually references the content of the target memory during the generation of the request processing result, indicating that the memory has made a substantial contribution to the generation of the request processing result.
[0108] In the case of confirmation reinforcement, the content of the target memory is confirmed by newly acquired information in the request processing chain, indicating that the content of the memory has been further confirmed.
[0109] In the correction and change type, the content of the target memory is corrected or updated by newly acquired information in the request processing chain, indicating that the original content of the memory has a deviation.
[0110] In the negative conflict type, the content of the target memory contradicts or conflicts with the new information obtained in the request processing chain, indicating that the content of the memory may no longer be accurate.
[0111] The "not adopted" type indicates that the target memory was recalled but not actually referenced during the generation of the request processing result, suggesting that the memory has a limited relevance to the current request.
[0112] Retention strength is a quantitative indicator that represents the priority of a target memory in a memory set. The higher the retention strength, the higher the retention priority of the target memory in the memory set, and the less likely it is to be erased or eliminated; the lower the retention strength, the lower the retention priority of the target memory in the memory set, and the more likely it is to be erased when memory capacity is limited.
[0113] For example, if a memory is actively recalled and adopted in multiple recent request processing links, its retention strength is high, indicating that the memory has high value for the continuous operation of the agent; if a memory is not recalled for a long time or is not adopted after being recalled multiple times, its retention strength is low, indicating that the memory has limited potential contribution to the agent's subsequent request processing.
[0114] Confidence level is a quantitative indicator characterizing the credibility of the information content carried by a target memory. A higher confidence level indicates that the content of the target memory is more reliable and worthy of being used by the agent in the process of generating the request processing result; a lower confidence level indicates that the content of the target memory is uncertain or has been questioned, and the agent should exercise caution when using the memory. Confidence level reflects the degree of credibility obtained by the content of the target memory after experiencing various memory usage events in the request processing chain.
[0115] For example, if the content of a memory is repeatedly confirmed and reinforced in the request processing chain, its confidence level is high; if the content of a memory encounters a denial conflict or a correction change in the request processing chain, its confidence level will decrease accordingly.
[0116] As an example, during the execution of the request processing chain, the agent performs an interaction with each memory in the memory set, generating a memory usage event, and writes the memory usage event to the event log of that request processing chain. The event log records events in chronological order, and each memory usage event includes at least the identifier of the memory involved and the event type of the interaction.
[0117] Once the request processing chain is completed and the request processing result has been generated, the evaluation and processing of the event log for that request processing chain is initiated. The memory usage events recorded in the event log are read one by one and categorized according to event type.
[0118] For each target memory involved, all memory usage events corresponding to that target memory in this request processing chain are summarized, and the retention strength and confidence of the target memory are determined according to the event type of each memory usage event. Specifically, based on the semantics represented by each event type, it is determined whether the direction of influence of each event type on the retention strength is positive or negative, and whether the direction of influence on the confidence is positive or negative. Then, by combining the influence direction and degree of each event type, the retention strength and confidence of the target memory at the end of this request processing chain are obtained.
[0119] The retention strength and confidence level are written back to the corresponding record of the target memory in the memory set as the current retention strength and confidence level of the target memory, for use in subsequent determination of the retention heat status of the target memory.
[0120] In some optional implementations of this embodiment, the memory includes at least one version of the memory. Specifically, the atomic fact memory includes at least one version of the fact memory, and the derived memory includes at least one version of the derived memory.
[0121] In this implementation, the aforementioned execution entity performs step 202 as follows: First, based on the time window, aggregate the memory usage events of the target memory version involved in the generation process to obtain an event set; Second, based on the event type of the memory usage events in the event set, determine and update the retention strength and confidence of the target memory version.
[0122] Each recall request during agent operation creates a globally unique recall trace identifier (recall_trace_id). Multi-path retrieval writes a RETRIEVED event to candidate memories, recording candidate scores, retrieval channels, rankings, factual memory versions, and policy versions. Only memories actually placed into the model context are recorded as RETURNED_TO_MODEL events. After an answer is generated, whether a memory involves a USED / CITED event is identified through structured citations, tool parameters, answer and memory entailment judgments, contribution attribution, or model self-reporting. After the request processing task is completed, user feedback events such as confirmation, correction, and success / failure results are associated.
[0123] A time window is a fixed time interval that traces backward from the current time, used to define the aggregation scope of memory usage events. The time window specifies which memory usage events are included in the aggregation calculation. Memory usage events falling within this time window are considered valid events with a time-sensitive impact on the current state of the target memory version; memory usage events outside this time window are not included in the aggregation. The duration of the time window can be configured according to the memory type or business scenario of the target memory version to ensure that the aggregated event set contains a sufficient number of events reflecting recent usage trends while excluding interference from historical events that have lost their timeliness. First, the aggregator, using the current system time as a reference, traces backward according to the preset time window duration to determine the time boundary of this aggregation. Within this time boundary, all memory usage events generated for the target memory version in the agent's request processing chain are retrieved. The retrieved memory usage events are arranged in chronological order of occurrence, forming the event set corresponding to the target memory version. Each memory usage event in the event set carries an event type identifier and an occurrence time identifier.
[0124] Secondly, the memory usage events in the event set are traversed to identify the event type of each event. Based on the usage characteristics represented by the event type, the influence of each event type on retention strength and confidence level is calculated. The influence of each memory usage event on retention strength is summed to obtain the total change in retention strength; the influence of each memory usage event on confidence level is summed to obtain the total change in confidence level. Based on the total changes in retention strength and confidence level, the current retention strength and confidence level of the target memory version are determined, and the determined retention strength and confidence level are written into the record of the target memory version, completing the update of the retention strength and confidence level of the target memory version.
[0125] In some implementations, the following operations can be performed before event aggregation: First, it should be noted that for each event, the following information is recorded: `event_time` indicates the time the event occurred; `event_type` indicates the event type, such as `USER_CONFIRMED` (user confirmation), `USER_CORRECTED` (user correction), `TASK_SUCCESS` (task success); `event_position` indicates the sequential position of the event in the event log, such as partition offset or incrementing sequence number; `target_memory_version_id` indicates the target memory version for which the event is applied (the event must be bound to a specific `target_memory_version_id`); `credit` indicates the contribution of the event to the target memory version; `feedback_source_reliability` indicates the reliability of the event's source, ranging from [0,1].
[0126] In this implementation, last_event_watermark (previous event watermark) indicates the position of the events that the target memory version has already processed.
[0127] The event position (event_position) is, for example, its sequentially increasing sequence number in the log: event_position = 120, 121, 122; if the system has multiple log partitions, a watermark should be saved for each partition, forming: last_event_watermark = { partition_1: 122, partition_2: 87 } In this implementation, only events after last_event_watermark are processed. Assuming the current last_event_watermark is 120, and the event positions of the received events are 121 and 122, the aggregator only processes events with event positions greater than 120 that have not yet been deduplicated.
[0128] In some cases, out-of-order events may occur. Suppose events at positions 120 and 122 are received first. Since event 121 has not yet arrived, the watermark cannot be directly set to 122. In this case, `last_event_watermark` = 120. After event 121 arrives, the aggregator processes events at positions 121 and 122 sequentially, and then updates `last_event_watermark` to `last_event_watermark = 122`. In this example, `last_event_watermark` is defined as the largest consecutively processed event position. If multiple event source partitions are included, the system maintains an independent consecutive processing position for each event source partition.
[0129] If you use the event time instead of the log sequence number, you need to set an allowable late time and define last_event_watermark as: last_event_watermark = Current maximum event time - Allowed lateness duration Events that arrive after the specified time should not be silently discarded, but should instead enter the late event compensation or replay process.
[0130] It should be noted that after each aggregation is completed, the output is updated to last_event_watermark_new, so that the next aggregation operation can continue to process events based on last_event_watermark_new.
[0131] In some implementations, after obtaining the event set but before determining and updating the retention strength and confidence of the target memory version, deduplication can be performed on the events in the event set. For example, the following key combination can be used to determine whether an event has been processed: tenant_id (user identifier), recall_trace_id, target_memory_version_id, event_type, and event_version.
[0132] In this implementation, recent memory usage events are aggregated through a time window and the impact is calculated separately according to the event type. This allows the retention strength and confidence to dynamically reflect the actual usage status of the target memory version, avoids interference from historical events, and improves computational efficiency.
[0133] In some optional implementations of this embodiment, the execution entity performs the second step described above in the following manner to determine and update the retention strength and confidence of the target memory version: First, based on the event type of the memory usage event in the event set, the retention strength and confidence of the target memory version are determined; then, in response to the fact that the concurrency control version number of the target memory version carried in the update request is consistent with the concurrency control version number of the target memory version in the database, the original retention strength and original confidence of the target memory version are updated to retention strength and confidence, respectively.
[0134] The concurrency control version number, `state_version`, is a monotonically increasing version identifier associated with each record of the target memory version in the database. Each time a record of the target memory version is successfully written to, its concurrency control version number increments. The purpose of the concurrency control version number is to ensure that only one update request can be successfully written to the database when multiple processes simultaneously initiate updates to the retention strength and confidence of the same target memory version. This avoids data overwriting and state inconsistencies caused by concurrent writes. It should be noted that the fact memory version `fact_version_id`, the derived memory version `derived_memory_version_id`, and the concurrency control version `state_version` are not the same and cannot be substituted for each other.
[0135] Read the event type of each memory usage event in the event set, and calculate the retention strength and confidence value that the target memory version should have based on the usage nature represented by each event type.
[0136] After determining the retention strength and confidence level, an update request is initiated for the target memory version. The update request carries the concurrent control version number of the target memory version read when initiating this update, as well as the retention strength and confidence level determined in this instance.
[0137] If the concurrency control version number of the target memory version carried in the update request matches the concurrency control version number of the target memory version in the database, it is determined that no other processing has successfully updated the target memory version between the read time and the current write time. The original retention strength and confidence of the target memory version are then updated to retention strength and confidence, respectively. If the concurrency control version number carried in the update request does not match the concurrency control version number of the target memory version in the database, a concurrent write conflict is determined. The system rereads the latest state and last_event_watermark, filters out unprocessed events based on the current watermark, recalculates the aggregation result, and initiates a retry with the new state_version. If the number of retries reaches the preset limit, the update request is transferred to the observable failure compensation queue, preventing silent abandonment without recording.
[0138] In this implementation, the aforementioned execution entity can also perform the following operation: update the concurrency control version number of the target memory version in the database.
[0139] After updating the original retention strength and original confidence, update the concurrency control version number of the target memory version in the database, incrementing it based on the current value to mark that the record of the target memory version has undergone a successful state change, for use by subsequent update requests when performing consistency comparisons.
[0140] For example, the current record in the database is: strength = 0.72; confidence = 0.61; last_event_watermark = 120; state_version = 8.
[0141] After the aggregator reads the data, it needs to calculate the new `strength_new`, `confidence_projection_new`, and `last_event_watermark_new` in memory and update them using CAS (Compare-And-Swap) conditions. Specifically, the old version number read is included when committing the update. UPDATE memory_version SET strength=:strength_new, confidence=:confidence_projection_new, last_event_watermark=:watermark_new, state_version = state_version + 1 WHERE memory_version_id=:target_memory_version_id AND state_version=:old_state_version When the record's memory_version_id matches the specified target ID and the current state_version is exactly old_state_version, such as 8, the strength, confidence, and last_event_watermark are updated to the new values, and the state_version is incremented by 1. The condition that the version number equals 8 constitutes an optimistic locking mechanism, ensuring that the update only takes effect if the record has not been modified by other transactions. If the update is successful, subsequent logic directly confirms the new version number as 9 (i.e., the incremented value of the original version number 8) for use by downstream processes, thus avoiding repeated database queries.
[0142] If another aggregator has already updated state_version from 8 to 9, the current update affects 0 rows, indicating a concurrent conflict. In this case, the current aggregator should reread the latest memorized state; reread the latest last_event_watermark; re-filter unprocessed events; recalculate strength and confidence; and perform the CAS update again with the new state_version; instead of directly forcibly overwriting the results of other aggregators.
[0143] In this implementation, the update request is checked before being written by controlling the version number in a concurrent manner, ensuring that only one update is successfully written to the database in a concurrent scenario, thus avoiding the overwriting or misinterpretation of retention strength and confidence.
[0144] In some optional implementations of this embodiment, the execution entity determines the retention strength of the target memory version in the following ways: First, determine the change in strength based on the strength weight corresponding to the event type of the memory use event in the event set; Second, determine the weakened strength by combining the original retention strength of the target memory version and the time decay coefficient, wherein the time decay coefficient is determined based on the memory type and importance of the target memory version; Third, determine the current retention strength of the target memory version based on the weakened strength and the change in strength.
[0145] Intensity weight is a pre-configured numerical parameter for each event type used in a memory, representing the direction and magnitude of the event type's influence on the retention strength of the target memory version. Intensity weights can be positive or negative; the sign indicates whether the event type's influence on retention strength is strengthening or weakening, and the absolute value represents the magnitude of the influence. Different event types correspond to different intensity weights; more positively used event types correspond to higher positive intensity weights, and more negatively used event types correspond to lower negative intensity weights.
[0146] For example, the intensity weights for each event type can be set according to the principles in the table below:
[0147] First, iterate through each memory usage event in the event set, read the event type identifier carried by each memory usage event, and find the pre-configured intensity weight corresponding to that event type based on the event type identifier. Then, sum the intensity weights corresponding to each memory usage event in the event set to obtain the intensity change. The intensity change reflects the combined impact of all memory usage events within this aggregation cycle on the retention strength of the target memory version.
[0148] Secondly, the retention strength value of the target memory version before this update, recorded in the database, is retrieved; this is the original retention strength. Simultaneously, a time decay coefficient is determined based on the memory type and importance of the target memory version. The time decay coefficient characterizes the rate at which the retention strength of the target memory version naturally decays over time. Specifically, the closer the memory type is to short-term use, the faster the decay rate corresponding to its time decay coefficient; conversely, the higher the importance of the target memory version, the slower the decay rate corresponding to its time decay coefficient. After determining the time decay coefficient, using the original retention strength as a baseline, a decay calculation is performed on the time span elapsed from the last state update of the target memory version to the current time, according to the decay rate determined by the time decay coefficient, to obtain the decayed strength. The decayed strength characterizes the remaining strength level of the target memory version after natural decay, without considering the influence of the current event set.
[0149] Finally, the attenuated intensity and the intensity change are superimposed, and the superposition result is constrained to fall within a preset intensity value range. The result is the current retention intensity of the target memory version. The determined retention intensity is written into the record of the target memory version for subsequent use in determining the retention heat status of the target memory version.
[0150] It should be noted that events such as RETRIEVED, RETURNED_TO_MODEL, USED / CITED, and TASK_SUCCESS only change the strength of memory retention by default, and the success or failure of a task cannot prove the truth of the facts.
[0151] In this implementation, the impact of events is quantified by intensity weights, and the decay rate is determined by memory type and importance. This ensures that the retention intensity takes into account both recent usage activity and the forgetting pattern over time, and truly reflects the current retention value of the target memory version.
[0152] In some optional implementations of this embodiment, the execution entity performs the first step described above to determine the intensity change amount in the following manner: determining the positive intensity change amount based on the intensity weight corresponding to the event type of each positive event in the event set; and determining the negative intensity change amount based on the intensity weight corresponding to the event type of each negative event in the event set.
[0153] Positive events refer to memory usage events that characterize the effective use of a target memory version in the request processing chain or that are verified as correct by the results. These include usage events where the target memory version is referenced and used, confirmation events where the content it carries is confirmed as correct, and positive attribution events that make a positive contribution to the achievement of the request processing results.
[0154] Negative events refer to memory usage events that characterize the content deviation of the target memory version in the request processing chain or have a negative impact on the achievement of the result. These include correction events where the content it carries is corrected, negative attribution events where it makes a negative contribution to the achievement of the request processing result, and contradictory events where it contradicts the facts of other memories in the memory set.
[0155] As an example, refer to the following formula to calculate the positive and negative intensity changes.
[0156] positive(m) = w1 used + w2 confirmed + w3 credit success
[0157] negative(m) = v1 corrected + v2 credit bad_outcome + v3 contradiction
[0158] Wherein, positive(m), used, confirmed, and success represent the positive intensity change, the use event, the user confirmation event, and the task success event, respectively; w1, w2, and w3 represent the intensity weights of the use event, the user confirmation event, and the task success event, respectively; credit represents the contribution of memory to the request processing result; negative(m), corrected, bad_outcome, and contradiction represent the negative intensity change, the user correction event, the bad result event, and the contradictory event, respectively; and v1, v2, and v3 represent the intensity weights of the user correction event, the bad result event, and the contradictory event, respectively.
[0159] In some optional implementations of this embodiment, the execution entity performs the third step described above in the following manner to determine the retention strength of the target memory version: based on the attenuated strength, the positive strength change, and the negative strength change, the retention strength of the target memory version is determined.
[0160] As an example, the retention strength can be calculated using the following formula: S_decay = S_base exp(-Δt / τ(type, importance)) S_next = clamp(S_decay + log(1+positive) - negative, S_min, S_max) The base strength S_base decays according to the decay coefficient, and the decay rate is controlled by τ(type, importance): the more critical the type and the higher the importance, the larger τ is, and the slower the decay. This ensures that important memories last, while trivial memories fade away naturally.
[0161] The attenuated intensity S_decay is increased by a positive gain (logarithmically compressed to prevent over-intensity) and subtracted by a negative intensity change, then clipped to a reasonable range [S_min, S_max]. The result is the current retained intensity, used for sorting, filtering, or triggering updates.
[0162] In this implementation, by distinguishing between positive and negative events and quantifying their impact on retention strength, the retention strength accurately reflects the actual usability and content reliability of the target memory version.
[0163] In some optional implementations of this embodiment, the execution entity determines the confidence level of the target memory version in the following ways: First, determine the effective weight of the memory usage event based on the source credibility and event type contribution of the memory usage event in the event set to the request processing result; Second, determine the confidence level of the target memory version based on the degree of influence and effective weight of each memory usage event in the event set on the confidence level.
[0164] As an example, the effective weights are first calculated using the following formula: event_weight= feedback_source_reliability × credit Among them, event_weight, feedback_source_reliability, and credit represent the effective weight, the credibility of the source of the memory used, and the contribution, respectively.
[0165] Then, the product of the influence of each memory usage event on the confidence level and the effective weight is accumulated to determine the confidence level of the target memory version.
[0166] In this implementation, the confidence level of the target memory version is determined based on the source credibility and contribution of the memory usage event, which improves the accuracy of the confidence level.
[0167] In some optional implementations of this embodiment, the execution entity performs the second step described above to determine the confidence level of the target memory version in the following manner: First, based on the degree of influence of each positive event in the event set on the confidence level and the effective weight of the positive events, the amount of positive evidence is determined; then, based on the degree of influence of each negative event in the event set on the confidence level and the effective weight of the negative events, the amount of negative evidence is determined; finally, based on the amount of positive evidence and the amount of negative evidence, the confidence level of the target memory version is determined.
[0168] Positive evidence quantity refers to the cumulative quantitative indicator of the degree of support that each positive event in the event set provides for the credibility of the target memory version. It is used to measure the total positive contribution of positive events to the confidence of the target memory version.
[0169] Negative evidence quantity refers to the cumulative quantitative indicator of the degree to which each negative event in the event set weakens the credibility of the target memory version. It is used to measure the total amount of negative doubts raised by negative events regarding the confidence of the target memory version.
[0170] As an example, the following formula is used to determine the amount of positive evidence: support_weight= Σ(event_weight × positive_coefficient) Among them, support_weight, event_weight, and positive_coefficient represent the amount of positive evidence, the effective weight, and the degree of influence of positive events on the confidence level, respectively.
[0171] The amount of negative evidence is determined using the following formula: conflict_weight= Σ(event_weight × negative_coefficient) Among them, conflict_weight and negative_coefficient represent the amount of negative evidence and the degree of influence of negative events on confidence, respectively.
[0172] Furthermore, by combining the amount of positive and negative evidence, the confidence level of the target memory version is determined.
[0173] In this implementation, by quantifying the supporting and weakening effects of positive and negative events on the confidence level, the confidence level dynamically reflects the actual credibility level of the target memory version under the current evidence, thereby further improving the accuracy of the confidence level.
[0174] In some optional implementations of this embodiment, the execution entity determines the confidence level of the target memory version based on the amount of positive evidence and the amount of negative evidence in the following manner: based on the prior strength of the target memory version, the historical confidence level of the target memory version is split into historical positive evidence and historical negative evidence; the current positive evidence is obtained by combining the historical positive evidence and the current positive evidence; the current negative evidence is obtained by combining the historical negative evidence and the current negative evidence; and the confidence level of the target memory version is determined based on the current positive evidence and the current negative evidence.
[0175] As an example, using the Beta evidence counting model, let: confidence_old (historical confidence level) = C_old; prior_strength (prior strength) = K Convert historical confidence scores into historical positive evidence (alpha_old) and historical negative evidence (beta_old): alpha_old = C_old × K beta_old = (1 - C_old) × K Calculate the current amount of positive evidence alpha_new and the current amount of negative evidence beta_new: alpha_new = alpha_old + support_weight beta_new = beta_old + conflict_weight The new confidence projection is obtained: confidence_projection = alpha_new / (alpha_new + beta_new) Finally, the result is restricted to [0,1]: confidence_projection = clamp(confidence_projection, 0, 1) If the system field is directly named confidence, confidence_projection can be written to this field; if you want to retain the original value, you can save both confidence_base and confidence_projection.
[0176] For derived memories, dependency confidence should also be calculated by combining the confidence of the atomic facts they depend on. The effective confidence used in the final query can be determined by the strategy, for example: effective_confidence=min(confidence_projection, dependency_confidence) In this way, derived memories will not obscure the fact that the underlying facts are already underconfident or controversial simply because they are used more frequently.
[0177] It should be noted that the prior strength can be preset, and the amount of historical positive evidence alpha_old and the amount of historical negative evidence beta_old need to be persistently stored so that they can be verified in audit mode.
[0178] In this implementation, the historical confidence level is decomposed into positive and negative evidence through prior strength and accumulated and merged with the current incremental evidence, so that the confidence level fully reflects the evidence evolution process of the target memory version throughout its entire life cycle, further improving the accuracy of the confidence level.
[0179] Step 203: Determine the retention heat status of the target memory based on effectiveness, retention strength, and confidence.
[0180] In this embodiment, the aforementioned execution entity determines the retention heat status of the target memory based on effectiveness, retention strength, and confidence level.
[0181] Retention heat status is a qualitative or quantitative representation of the overall retention value of a target memory within the memory set. It reflects the degree to which a target memory is relevant and necessary for subsequent requests from the agent at the current moment, serving as a direct basis for subsequent processing of target memories in agent memory management. A higher retention heat status indicates greater retention value of the target memory within the memory set, resulting in a higher priority for retrieval and citation in subsequent requests. Conversely, a lower retention heat status indicates lower retention value of the target memory, making it more likely to be downgraded, archived, or cleared when memory capacity is limited or during memory reorganization.
[0182] Retention intensity is categorized into three levels from highest to lowest: HOT, WARM, and COLD. REVALIDATING may be added as needed. For example, when a target memory is valid and both retention strength and confidence are at a high level, its retention intensity is determined to be HOT. When a target memory is valid, but at least one of its retention strength or confidence is not at a high level and the other has not decreased to a low level, its retention intensity is determined to be WARM. When a target memory is valid, but both its retention strength and confidence are at a low level, its retention intensity is determined to be COLD.
[0183] As an example, validity, retention strength, and confidence are each mapped to a value on the same metric scale. For validity, if the validity of the target memory is determined to be valid, it is mapped to a preset valid value; if the validity of the target memory is determined to be invalid, it is mapped to a preset invalid value. For retention strength and confidence, their currently determined quantified values are used.
[0184] Based on preset weighting coefficients, the mapped validity, retention strength, and confidence values are weighted and fused to obtain a comprehensive retention score for the target memory. The weighting coefficients represent the respective contributions of validity, retention strength, and confidence to the comprehensive retention score, and the values of the weighting coefficients are pre-configured according to the agent's business scenario and management strategy.
[0185] The overall retention popularity score is compared with several preset score interval thresholds to determine the score interval into which the overall retention popularity score falls, and the retention popularity status corresponding to this score interval is determined as the retention popularity status of the target memory. The retention popularity status is divided into several levels in descending order, with higher levels indicating greater retention value of the target memory in the memory set.
[0186] The determined retention heat status is written into the record of the target memory, so that the agent can use it in subsequent request processing to prioritize the recall of the target memory, manage memory capacity pressure, or organize the memory.
[0187] As another example, validity is used as the first-level judgment condition. The validity of the target memory is determined. If the validity of the target memory is determined to be invalid, the retention strength and confidence level of the target memory are no longer considered. The retention status of the target memory is directly set to the lowest level, indicating that the target memory has lost its fundamental condition for request processing. Regardless of its retention strength and confidence level, it should no longer be cited by the agent in the process of generating the request processing result.
[0188] If the validity of the target memory is determined to be valid, the process proceeds to the second level of evaluation. In this second level, the combination of the retention strength and confidence level of the target memory is used as the evaluation criterion. Specifically, the current value of the retention strength is compared with a preset retention strength benchmark to determine whether the retention strength of the target memory is high, medium, or low; the current value of the confidence level is compared with a preset confidence level benchmark to determine whether the confidence level of the target memory is high, medium, or low.
[0189] Based on the combination relationship between the retention strength level and the confidence level, the retention heat status corresponding to the combination relationship is retrieved from a preset mapping table of combination relationships and retention heat status. For example, the retention heat status corresponding to a high retention strength level and a high confidence level is higher than the retention heat status corresponding to a low retention strength level and a low confidence level; the retention heat status corresponding to a high retention strength level but a low confidence level and the retention heat status corresponding to a low retention strength level but a high confidence level can be configured to be the same or different levels according to business needs.
[0190] Continue to refer to Figure 4 The diagram illustrates the transitions of the memory lifecycle state machine. The lifecycle includes the validity state (including ACTIVE, DISPUTED, INVALIDATED), the retention state (including HOT, WARM, COLD, REVALIDATING), and the storage state (including PRESENT, ARCHIVED, PURGE_PENDING (not shown in the diagram), PURGED).
[0191] In terms of validity status, a memory is initially in the ACTIVE state or after confirmation. When a conflict of evidence is detected or the confidence level is reduced, the memory migrates to the DISPUTED state; if new evidence is subsequently obtained to confirm it, it is restored to ACTIVE. If a memory in the DISPUTED state is explicitly corrected or retracted, it is downgraded to INVALIDATED; this state still supports review, and if the review is successful, it can revert to DISPUTED pending further adjudication.
[0192] In terms of retention, memories that are active and meet retention strategies enter the HOT state. As time decays or usage frequency decreases, memories naturally sink to the WARM state; if they are recalled or reinforced, they can rise back to HOT. If a memory is in a low-usage state for a long time or the system faces capacity pressure, it will further cool down to the COLD state; memories in the COLD state can also warm up to WARM when they are reused.
[0193] In the storage dimension, active memories are kept in the PRESENT state by default. Memory is migrated to the ARCHIVED state when triggered by archiving policies or due to storage capacity pressure; it can be restored to PRESENT and resume online service after authorization. Additionally, memories in the COLD state in the retention dimension can also be directly archived to ARCHIVED when certain conditions are met. When memories in the ARCHIVED state exceed the policy-defined recovery window or meet compliance cleanup requirements, they will enter the PURGED state.
[0194] In terms of final state and cleanup logic, PURGED is typically considered the final state of the lifecycle, blocking regular recall and data revival. If recovery is indeed necessary, it must be strictly authorized and regenerated from the original chain of evidence. Meanwhile, when a memory in the validity dimension is determined to be INVALIDATED and triggers a deletion or hard failure command, the system will directly initiate the cleanup process, forcibly migrating it to PURGED across intermediate states to complete compliant forgetting and physical reclamation.
[0195] In some optional implementations of this embodiment, the execution entity performs step 203 as follows to determine the retention heat status of the target memory: based on validity, retention strength and confidence, the retention heat status of the target memory version is determined.
[0196] In this implementation, validity, retention strength, and confidence are all data at the memory version level. Referring to the above method of determining the retention heat status based on memory-level validity, retention strength, and confidence, the retention heat status of the target memory version is determined, which will not be repeated here.
[0197] In this implementation, the target memory version obtains accurate retention heat positioning based on its own validity, retention strength and confidence, and realizes lifecycle management that matches its actual status, thereby improving the granularity of retention heat status management.
[0198] In some optional implementations of this embodiment, the execution entity retains the retention heat status in the following way: it determines the retention heat status of the target memory version based on at least one of the following reference parameters: validity, retention strength, confidence level, and reference parameter set.
[0199] The reference parameter set includes usage interval, sensitivity strategy, and memory capacity pressure. The usage interval represents the difference between the last time the target memory version was used and the current time, and the sensitivity strategy represents the control conditions for the retention heat status of the target memory version.
[0200] The sensitive policy does not simply add or subtract a score from all memories, but rather returns state constraints from the policy control plane, including: allowed_max_state (maximum allowed state), min_retention_period (minimum retention period), ordinary_recall_allowed (ordinary recall allowed), encryption_required (encryption required), and purge_allowed (purge allowed).
[0201] For example, the sensitivity strategies for each sensitivity level are as follows:
[0202] Assuming that the retention strength and usage frequency are sufficient to enter the HOT state, but the sensitive policy stipulates that allowed_max_state = WARM, then the final state can only be WARM at most.
[0203] Memory capacity pressure can be expressed as: capacity_pressure= (tenant_capacity_used + memory_size) / tenant_capacity_budget Among them, capacity_pressure, tenant_capacity_used, memory_size, and tenant_capacity_budget represent memory capacity pressure, tenant used capacity, memory capacity, and tenant capacity budget, respectively.
[0204] The level of memory capacity stress can be determined by soft threshold and hard threshold: Pressure < 0.80 is normal 0.80 ≤ pressure < 1 indicates a state of capacity shortage. Pressure ≥ 1 indicates capacity exceeds budget. The role of capacity pressure is to adjust the retention heat status: under normal capacity, the retention heat status is mainly adjusted based on retention intensity, usage interval and confidence level; when capacity is tight, the retention level of long-term unused memory is reduced first; when the budget is exceeded, candidates for cleanup are selected from COLD or ARCHIVED memory.
[0205] Candidates for cleanup can be sorted by the following score; the higher the score, the more suitable they are for archiving or cleanup: eviction_priority=a×(1-S_factor)+b×(1-U_factor)+c×(1-C_effective)-d×sensitivity_penalty Where S_factor, U_factor, C_effective, and sensitivity_penalty represent retention strength factor, effectiveness factor, confidence level, and sensitivity penalty, respectively.
[0206] For the target memory version, the retention score is calculated using the following formula: retention_score=wS×S_factor+wU×U_factor+wC×C_effective-wP×capacity_pressure Where wS + wU + wC + wP = 1, for example, it can be set to wS = 0.4, wU = 0.3, wC = 0.2, wP = 0.1. The retention score (retention_score) is only used to determine retention status and is not used to re-validate the validity of facts.
[0207] The retention heat state is transitioned based on a threshold for the retention score. For example, a specific state mapping is as follows: If the current validity state is ACTIVE and retention_score ≥ 0.75, the retention heat state will be moved to HOT; if the current validity state is ACTIVE and 0.45 ≤ retention_score < 0.75, the retention heat state will be moved to WARM; if the current validity state is ACTIVE and 0.20 ≤ retention_score < 0.45, the retention heat state will be moved to COLD.
[0208] At the same time, the following mandatory rules are added: When the validity state is INVALIDATED, the normal recall operation of the memory during the agent's request processing is not possible, and it can be migrated to ARCHIVED; when the validity state is DISPUTED, it cannot enter HOT, COLD does not mean invalid, and it will not be given priority in the normal recall mode; when the memory capacity hard budget is exceeded, the memory with high eviction_priority is migrated to ARCHIVED or PURGE_PENDING.
[0209] In this implementation, to prevent frequent jittering between HOT and WARM versions, different entry and exit thresholds should be used.
[0210] For example: To be eligible for HOT (Hot Tolerance) status: retention_score ≥ 0.80 Exiting HOT: retention_score < 0.65 Enter WARM: retention_score ≥ 0.50 Exiting WARM: retention_score < 0.35 You can also require the new state to remain for more than the minimum dwell time before the migration is executed.
[0211] Lifecycle engine final output: retention_state_new: New cold and hot retention state; storage_state_action: Whether to archive, restore, or enter the cleanup queue; lifecycle_visibility: Whether the memory is visible in the current query mode; state_version_new: The technology version number after this state update.
[0212] The lifecycle engine, which determines the lifecycle of a memory, can change the retention heat status and validity, but cannot make an already invalidated fact valid again by increasing retention strength or changing the retention heat status.
[0213] In this implementation, retention heat is determined by combining multi-dimensional indicators with reference parameters such as usage interval, sensitivity strategy and capacity pressure, so as to realize dynamic and refined management of the memory version and improve the accuracy and reliability of retention heat status.
[0214] In some optional implementations of this embodiment, the execution entity may also perform the following operations: First step, determine the recall memory from the memory set based on the visibility of the lifecycle state according to the validity, retention strength, confidence and query pattern of the query request, wherein the lifecycle state includes the state corresponding to the validity and the retention heat state; Second step, generate the request processing result of the query request based on the recall memory.
[0215] The query pattern is a parameter carried in the query request that represents the intent and access level of the current access. It is used to determine the visibility rules applicable to memories at different lifecycle states in the memory set during the recall process. Different query patterns correspond to different visibility ranges, thereby enabling differentiated screening and filtering of memories during the recall phase.
[0216] Query modes include, for example: normal query mode, suitable for daily interaction scenarios, which is only visible for memories with a valid status and the current version (current_version); management audit query mode, suitable for system operation and maintenance or compliance review scenarios, which requires determining the visibility of each status memory based on management audit permissions, such as being visible for all validity statuses and all retention popularity statuses; and backtracking query mode, suitable for historical tracing scenarios, which is visible for memories with a valid status or those that have expired.
[0217] Visibility of lifecycle states in query patterns refers to the rules governing whether each state in the lifecycle is allowed to be included in the recall scope under a specific query pattern. Since lifecycle states include two dimensions: the state corresponding to validity and the retention popularity state, visibility rules must constrain both dimensions simultaneously. For example, in a normal query pattern, memories with an expired state corresponding to validity and memories with an archived retention popularity state are both determined to be invisible and not included in the recall candidate; however, in a management audit query pattern, these states are all determined to be visible and can participate in the recall normally.
[0218] Lifecycle states can also include storage state (storage_state), which includes PRESENT (current), ARCHIVED (already stored), PURGE_PENDING (pending to be cleared), and PURGED (cleared). In the ARCHIVED state, recoverable content is still retained, while in the PURGED state, only compliantly permitted tombstones and irreversible audit summaries are retained.
[0219] As an example, upon receiving a query request, the system first parses the query pattern carried in the request and determines the applicable lifecycle state visibility rule for this recall based on the query pattern. Then, it iterates through the memory set, reading the validity state and retention heat state for each memory. The validity state and retention heat state together constitute the lifecycle state of the memory, and the visibility rule is used to determine whether the memory is visible under the current query pattern. For candidate memories that pass the visibility determination, a comprehensive evaluation is further performed combining validity, retention strength, and confidence to identify recall memories that meet the recall criteria. Finally, the system organizes and generates the query request processing result based on the recalled memories and returns the result to the query initiator.
[0220] It should be noted that this embodiment sets up independent access gating for the normal query mode and the management audit query mode. For normal business queries in the normal query mode, the system makes a joint judgment based on at least three dimensions: memory lifecycle state, query time semantics, and candidate use. First, it determines whether a memory can enter normal recall based on its lifecycle state. Memory in the ACTIVE state can participate in normal recall, memory in the QUIET state is only allowed to be used for internal reasoning or passive response, memory in the ARCHIVED state can only participate in recall after meeting the rehydration condition, and memory in the INVALIDATED and PURGED states cannot enter normal recall. Second, it determines the time validity based on the time range pointed to by the query and the valid_from and valid_to of the memory. Current state queries cannot use old facts that have been replaced or expired, and historical state queries can only recall memories that are valid within the target time range. Third, based on different uses such as internal reasoning, passive response, and active mention, it performs gating based on relevance, agent retention strength, user perception salience, sensitivity level, context fit, and mention strategy to prevent memories that can be used for internal understanding from being inappropriately exposed. The rehydration condition refers to the fact that the memory of the ARCHIVED state retains only lightweight information such as semantic sketches, topics, entities, or low-dimensional vectors in the hot index; when the lightweight information hits the query, the system reads the complete memory content from the cold storage and restores it to the form that can be used in this processing.
[0221] For audit queries in the management audit query mode, the system does not bypass security and deletion constraints due to their audit purpose. Audit queries must simultaneously pass the calling entity identity authentication, audit permission verification, tenant and user scope isolation, audit purpose and field range verification, and record the query subject, query time, query conditions, return range, and the policy version used. Memory in the INVALIDATED state can return necessary evidence references, state change records, and decision trajectories if the user has the appropriate permissions and complies with laws, regulations, and tenant policies, but by default, it will not be included in the normal business recall. For memory that has entered the PURGED state, neither normal queries nor audit queries may recover or return the original text, vectors, keywords, graph relationships, derived summaries, or other content that can reconstruct the original semantics; the system can only return deletion tombstone records or deletion proofs that do not contain the original factual content and cannot be used to recover the original memory, such as the memory identifier that has been irreversibly processed, deletion time, deletion reason category, deletion operation identifier, applicable policy version, and integrity check value. If a user requests deletion, a legal obligation to delete, or a data retention period requires the complete removal of relevant information, the above constraints take precedence over the audit retention policy. The audit system shall not allow deleted memories to be made available again under the pretext of auditing, playback, or fault recovery.
[0222] In some implementations, multi-way retrieval may return multiple versions of the same memory. In the current general recall, version parsing must first be performed according to the factual valid time interval, the system-aware time interval, the validity status, and the version rules. Then, candidate memory versions are merged according to logical memory (i.e., the memory concept to which multiple iterations of memory versions belong). When the same memory version comes from multiple retrieval channels, the retrieval evidence is merged; when different memory versions have the same value, the evidence is merged and the currently valid version is selected; when different memory versions have conflicting values or overlapping times, the dispute review process is initiated, and silent merging or simply selecting the latest version is not allowed.
[0223] In this implementation, the visibility of lifecycle states is differentiated by query patterns, so that the recall process can accurately filter memories according to access intent while taking into account both effectiveness and confidence, avoiding irrelevant or unauthorized memories from being recalled, and ensuring the relevance and security of the recall results.
[0224] In some optional implementations of this embodiment, the execution entity performs the first step described above in the following manner to determine the recall memory from the memory set: based on validity, retention strength, confidence, the visibility of the lifecycle state to the query pattern of the query request, source credibility, and evidence gain, the recall memory is determined from the memory set.
[0225] Evidence gain characterizes the number of mutually consistent and independent supporting pieces of evidence upon which a memory depends. Source credibility refers to a quantitative assessment of the reliability of the original source of evidence upon which a memory depends; it reflects the level of trustworthiness of the evidence source in maintaining its authenticity, integrity, and tamper-proof nature during its generation, transmission, and storage. The focus should be on determining whether a memory is supported by multiple sources, whether the sources are independent of each other, whether the evidence directly supports factual values, whether the evidence is temporally consistent, and whether it is merely a repeated delivery or copy of the same content.
[0226] For each piece of supplementary evidence, first, calculate the support score using the following formula: support_j = directness_j independence_j temporal_consistency_j Here, directness_j indicates whether the evidence directly expresses the fact; independence_j indicates whether the evidence comes from an independent source; and temporal_consistency_j indicates whether the time is consistent with the current facts.
[0227] Then, only independent supplementary evidence is included in the evidence gain: raw_support = Σ(support_j) Furthermore, the gain is compressed using a logarithmic function: evidence_boost=min(B_max,1+β log(1+raw_support)) Where β represents the evidence gain coefficient; B_max represents the maximum gain limit; when there is no additional evidence, evidence_boost=1, indicating no increase or decrease.
[0228] Source credibility is independent of the semantic correctness of the content itself, and is measured only for the attributes of the evidence source. For example, the type of evidence source (such as official databases, user testimonials, third-party tool returns, etc.), the historical accuracy of the source, the integrity verification results of the collection process, and the compliance with sensitivity levels can all be used as the basis for calculating source credibility. Higher source credibility indicates a more solid foundation for the evidence as factual support; conversely, lower credibility indicates that the evidence may be at risk of contamination, forgery, or distortion, and should be downgraded or flagged in recall decisions.
[0229] As an example, first, the recall score final_score of the memory is calculated using the following formula: final_score = relevance strength_factor(S) validity_gate(F,q) confidence_factor(C) provenance_trust evidence_boost lifecycle_visibility Here, relevance, strength_factor(S), validity_gate(F,q), confidence_factor(C), proof_trust, evidence_boost, and lifecycle_visibility represent semantic relevance, retention strength, validity gate, confidence, source credibility, evidence gain, and lifecycle visibility, respectively.
[0230] The values for Relevance are [0,1]; the values for strength_factor(S) are [0,1]; the values for validity_gate(F,q) are {0,1}; the values for confidence_factor(C) are [0,1]; the values for proofance_trust are [0,1]; the values for evidence_boost are [1,B_max]; and the values for lifecycle_visibility are {0,1}. Validity_gate and lifecycle_visibility are hard gates (0 / 1); confidence_factor and strength_factor are mapped to [0,1].
[0231] It should be noted that when validity_gate = 0, the final score must be 0; proofance_trust does not mean that the fact has been proven true; evidence_boost must be capped to avoid unlimited amplification caused by multiple duplicate evidence; these parameters and calculation rules should be fixed by policy_snapshot and recorded in the recall event for easy auditing and replay.
[0232] Then, the memory versions in the memory set are sorted according to the recall score final_score to determine the recalled memories.
[0233] In this implementation, differentiated weighted recall is carried out by integrating multiple factors such as source credibility and evidence gain, so that highly corroborated and reliable memories are given priority, while avoiding the misuse of low-quality or controversial memories, thereby improving the accuracy and traceability of the recall results.
[0234] In this embodiment, the memory management policy supports multi-level inheritance and overriding configuration based on platform, organization, project, agent, user, session, and memory type. Policy parameters include at least event weight, time decay coefficient, fact conflict determination threshold, cold / hot state migration threshold, data recovery window period, and physical cleanup cycle. The control plane compiles the above policies into an immutable policy snapshot and distributes it to the data plane. When performing a memory recall operation, the data plane directly loads the local snapshot without needing to remotely query the configuration center in real time. Every interaction event, state change record, and derived memory version generated in the system is forcibly bound to a corresponding policy snapshot identifier to ensure the traceability and version consistency of the computational logic.
[0235] In terms of computational performance, the time decay factor is dynamically calculated in real time during the query phase, avoiding batch updates to the entire data table; intensity increments are processed asynchronously after events are written to the message queue; the propagation update of derived memory only traverses the affected dependency subgraph, reducing computational overhead; complex contribution attribution calculations are only performed on the top N results of the final ranking; fact data and policy snapshots support multi-level caching to improve response efficiency.
[0236] Typical application scenarios of this embodiment include, but are not limited to: 1. Long-term personal assistant scenario: For personal information such as user preferences, address, occupation and plans that evolve over time, the system retains the historical effective time window of old facts, dynamically updates the current effective facts by confirming events and correcting events, and triggers partial invalidation and version isolation of old user profiles and summary memories.
[0237] 2. Enterprise Knowledge Intelligence Scenario: When enterprise policies, product configurations, or organizational structures change, the old version of knowledge is automatically removed from the current Q&A general recall scope, but is retained in the historical audit path; the successful feedback of Q&A interaction is only used to strengthen the use value of the memory (retention_state), and does not cover its official effective time (valid_from) and source credibility score.
[0238] 3. Tool-based and task-based intelligent agent scenarios: The system associates and binds tool call results with memory nodes involved in planning through execution traces. When a task is successfully executed, high-contribution experience memories are reinforced in a targeted manner; when a task fails, only relevant experience memories are de-reinforced and marked for inclusion in the review process, avoiding indiscriminate punishment of irrelevant context memories.
[0239] 4. Multi-agent shared memory scenario: The shared fact memory across agents maintains a unified validity state and evidence version chain, with the usage intensity index of each agent being calculated independently. High-frequency access by a single agent will not unconditionally improve the recall ranking of that fact in the views of other agents, but fact-level correction or invalidation events will be synchronously propagated to all legitimate shared copies according to the sharing strategy.
[0240] 5. Compliance and Verifiable Forgotten Scenarios: Upon responding to a user's deletion request, the target fact and its derived memory nodes are immediately removed from the normal recall index. After the recovery window configured by the strategy, the system triggers a cross-index physical cleanup process. The system uses tombstone marking and deletion receipt mechanisms to prevent the accidental reconstruction or revival of deleted data. Subject to compliance requirements, audit logs can retain only irreversible hash digests and operation metadata to achieve a balance between privacy protection and audit traceability.
[0241] See also Figure 5 , Figure 5 This is a schematic diagram of an application scenario 500 of the agent memory state determination method according to this embodiment. The agent 501 is correspondingly provided with a memory set 502. For the memories in the memory set, the validity of the memory is determined by the determination method corresponding to the memory type; according to the event type of the memory usage event in the agent's request processing link, the retention strength and confidence of the target memory involved in the generation process of the request processing result are determined; based on the validity, retention strength and confidence, the retention heat state of the target memory is determined.
[0242] In this embodiment, for memories in the memory set, the validity of the memory is determined by the memory type. Based on the event type of the memory usage event in the agent's request processing chain, the retention strength and confidence of the target memory involved in the generation of the request processing result are determined. Based on the validity, retention strength, and confidence, the retention heat state of the target memory is determined. Thus, the retention heat state of the memory is transferred by combining the validity, retention strength, and confidence. This solves the problems of false reinforcement and fact expiration that occur in the long-term accumulation of agent memory, realizes hierarchical management of memory, improves the accuracy and reliability of memory, and helps to improve the accuracy of agent processing results.
[0243] Continue to refer to Figure 6 The illustration shows a schematic flow 600 of yet another embodiment of the method for determining the state of an agent's memory according to the present disclosure. Flow 600 includes the following steps: Step 601: For memory versions in the memory set, determine the validity of the memory version by using the method corresponding to the memory type of the memory version.
[0244] Step 602: Based on the time window, aggregate the memories of the target memory version involved in the generation of the request processing result by the agent using events to obtain an event set.
[0245] Step 603: Determine and update the retention strength and confidence of the target memory version based on the event type of the memory use event in the event set.
[0246] Step 604: Determine the retention heat status of the target memory version based on validity, retention strength, confidence level, and at least one reference parameter from the set of reference parameters.
[0247] The reference parameter set includes usage interval, sensitivity strategy, and memory capacity pressure. The usage interval represents the difference between the last time the target memory version was used and the current time, and the sensitivity strategy represents the control conditions for the retention heat status of the target memory version.
[0248] Step 605: Identify recall memories from the memory set based on validity, retention strength, confidence, and the visibility of lifecycle states by the query pattern of the query request.
[0249] The lifecycle status includes the status corresponding to effectiveness and the status of retention popularity.
[0250] Step 606: Based on the recall memory, generate the request processing result for the query request.
[0251] The process 600 of the agent memory state determination method in this embodiment, compared with the above process 200, specifically describes the process of determining the retention heat state of the memory version. Based on the memory retrieval and request processing process of the retention heat state, the accuracy and reliability of the request processing results are improved.
[0252] Continue to refer to Figure 7 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a state determination device for intelligent agent memory, which is similar to... Figure 2 Corresponding to the method embodiments shown, the system can be specifically applied to various electronic devices.
[0253] like Figure 7As shown, the agent memory state determination device 700 includes: an validity determination unit 701, configured to determine the validity of a memory by using a determination method corresponding to the memory type in the memory set; a parameter determination unit 702, configured to determine the retention strength and confidence of the target memory involved in the generation process of the request processing result by the agent according to the event type of the memory usage event in the agent's request processing link; and a state determination unit 703, configured to determine the retention heat state of the target memory based on the validity, retention strength, and confidence.
[0254] In some optional implementations of this embodiment, the validity determination unit 701 is further configured to: in response to the memory being an atomic fact memory, determine the validity of the atomic fact memory based on the fact validity time interval of the atomic fact memory and the system perception time interval.
[0255] In some optional implementations of this embodiment, the validity determination unit 701 is further configured to: determine the validity of the atomic fact memory based on the fact validity time interval of the atomic fact memory, the system perception time interval, and the determination result of the atomic fact memory based on the fact establishment conditions.
[0256] In some optional implementations of this embodiment, the validity determination unit 701 is further configured to: in response to a change in the atomic fact memory upon which the memory depends, determine the actual generation context of the derived memory based on the current generation environment of the derived memory and the set of atomic fact memories upon which the derived memory currently depends; and in response to a discrepancy between the actual generation context and the generation context of the record corresponding to the derived memory in the database, determine the validity of the derived memory based on the set of atomic fact memories.
[0257] In some optional implementations of this embodiment, the atomic fact memory includes at least one fact memory version, the derived memory includes at least one derived memory version, and the validity determination unit 701 is further configured to: in response to a change in the derived memory version upon which the memory depends, determine the actual generation context of the derived memory version based on the current generation environment of the derived memory version and the atomic fact memory set composed of the fact memory versions upon which the derived memory version currently depends; in response to a discrepancy between the actual generation context and the record generation context corresponding to the derived memory version in the database, and the atomic fact memory set being a non-empty set, generate a new derived memory version based on the atomic fact memory set, and determine the validity of the new derived memory version.
[0258] In some optional implementations of this embodiment, the generation environment includes a generation strategy and a generation algorithm, and the validity determination unit 701 is further configured to: adopt the generation strategy and the generation algorithm to generate a new derived memory version of the derived memory based on the atomic fact memory set; and also includes: an update unit (not shown in the figure), configured to: store the actual generation context as the record generation context corresponding to the new derived memory version in the database.
[0259] In some optional implementations of this embodiment, the parameter determination unit 702 is further configured to: determine the confidence level of the new derived memory version based on the confidence level and source credibility of the fact memory version in the atomic fact memory set, as well as its contribution to the new derived memory version.
[0260] In some optional implementations of this embodiment, the memory includes at least one memory version; and the parameter determination unit 702 is further configured to: aggregate memory usage events of the target memory version involved in the generation process according to a time window to obtain an event set; and determine and update the retention strength and confidence of the target memory version according to the event type of the memory usage events in the event set.
[0261] In some optional implementations of this embodiment, the parameter determination unit 702 is further configured to: determine the retention strength and confidence of the target memory version according to the event type of the memory usage event in the event set; in response to the fact that the concurrency control version number of the target memory version carried in the update request is consistent with the concurrency control version number of the target memory version in the database, update the original retention strength and original confidence of the target memory version to retention strength and confidence respectively; and the update unit is further configured to: update the concurrency control version number of the target memory version in the database.
[0262] In some optional implementations of this embodiment, the parameter determination unit 702 is further configured to: determine the intensity change amount according to the intensity weight corresponding to the event type of the memory use event in the event set; determine the attenuated intensity by combining the original retention intensity of the target memory version and the time decay coefficient, wherein the time decay coefficient is determined according to the memory type and importance of the target memory version; and determine the current retention intensity of the target memory version according to the attenuated intensity and the intensity change amount.
[0263] In some optional implementations of this embodiment, the parameter determination unit 702 is further configured to: determine the positive intensity change amount according to the intensity weight corresponding to the event type of each positive event in the event set; determine the negative intensity change amount according to the intensity weight corresponding to the event type of each negative event in the event set; and determine the retention intensity of the target memory version according to the attenuated intensity, the positive intensity change amount, and the negative intensity change amount.
[0264] In some optional implementations of this embodiment, the parameter determination unit 702 is further configured to: determine the effective weight of the memory usage event based on the source credibility and event type of the memory usage event in the event set to the contribution to the request processing result; and determine the confidence level of the target memory version based on the degree of influence and effective weight of each memory usage event in the event set on the confidence level.
[0265] In some optional implementations of this embodiment, the parameter determination unit 702 is further configured to: determine the amount of positive evidence based on the degree of influence of each positive event in the event set on the confidence level and the effective weight of the positive events; determine the amount of negative evidence based on the degree of influence of each negative event in the event set on the confidence level and the effective weight of the negative events; and determine the confidence level of the target memory version based on the amount of positive evidence and the amount of negative evidence.
[0266] In some optional implementations of this embodiment, the parameter determination unit 702 is further configured to: decompose the historical confidence of the target memory version into historical positive evidence and historical negative evidence based on the prior strength of the target memory version; combine the historical positive evidence and positive evidence to obtain the current positive evidence; combine the historical negative evidence and negative evidence to obtain the current negative evidence; and determine the confidence of the target memory version based on the current positive evidence and current negative evidence.
[0267] In some optional implementations of this embodiment, the state determination unit 703 is further configured to: determine the retention heat status of the target memory version based on validity, retention strength, and confidence.
[0268] In some optional implementations of this embodiment, the state determination unit 703 is further configured to: determine the retention heat status of the target memory version based on at least one of the following reference parameters: validity, retention strength, confidence level, and a set of reference parameters. The set of reference parameters includes usage interval, sensitivity policy, and memory capacity pressure. The usage interval characterizes the difference between the last time the target memory version was used and the current time. The sensitivity policy characterizes the control conditions for the retention heat status of the target memory version.
[0269] In some optional implementations of this embodiment, the atomic fact memory in memory is generated and updated in the following manner: atomic facts representing the fact values of entities in the attribute dimension are extracted from the evidence data source; in response to the existence of a target atomic fact memory in the memory set that is consistent with the entity and attribute dimension of the atomic facts, and the fact value of the target atomic fact memory is different from the fact value of the atomic facts, the conflict resolution result of the target atomic fact memory and the atomic facts is determined according to the fact validity time interval, source credibility, and preset conflict resolution rules of the target atomic fact memory and the atomic facts; and a new fact memory version of the target atomic fact memory is determined according to the conflict resolution result.
[0270] In some optional implementations of this embodiment, the method further includes: in response to the existence of a target atomic fact memory consistent with the atomic fact in the memory set, adding supporting evidence for the target atomic fact memory and updating the confidence level of the target atomic fact memory.
[0271] In some optional implementations of this embodiment, a request processing unit (not shown in the figure) is further included, configured to: determine recall memories from the memory set based on the visibility of lifecycle states according to validity, retention strength, confidence and query pattern of the query request, wherein the lifecycle states include the state corresponding to validity and the retention heat state; and generate the request processing result of the query request based on the recall memories.
[0272] In some optional implementations of this embodiment, the request processing unit is further configured to: determine the recalled memory from the memory set based on validity, retention strength, confidence, query pattern of the query request, visibility of the lifecycle state, source credibility, and evidence gain, wherein evidence gain characterizes the number of mutually consistent independent supporting evidence on which the memory depends.
[0273] This embodiment provides a device for determining the state of an agent's memory. The validity determination unit determines the validity of a memory by using a method corresponding to the memory type. The parameter determination unit determines the retention strength and confidence of the target memory involved in the generation of the request processing result by the agent based on the event type of the memory usage event in the agent's request processing chain. The state determination unit determines the retention heat state of the target memory based on validity, retention strength, and confidence. This combines validity, retention strength, and confidence to transfer the retention heat state of the memory, solving problems such as false reinforcement and fact expiration that occur in the long-term accumulation of agent memories. It achieves hierarchical management of memories, improves the accuracy and reliability of memories, and helps improve the accuracy of agent processing results.
[0274] According to embodiments of this disclosure, this disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to implement the state determination method of the intelligent agent memory described in any of the above embodiments.
[0275] According to embodiments of this disclosure, this disclosure also provides a readable storage medium storing computer instructions that, when executed by a computer, enable the intelligent agent memory state determination method described in any of the above embodiments.
[0276] This disclosure provides a computer program product that, when executed by a processor, can implement the method for determining the state of an agent's memory as described in any of the above embodiments.
[0277] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0278] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0279] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0280] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the agent memory state determination method. For example, in some embodiments, the agent memory state determination method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the agent memory state determination method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the agent memory state determination method by any other suitable means (e.g., by means of firmware).
[0281] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0282] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable intelligent agent memory state determination device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0283] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0284] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0285] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0286] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are hosting products within the cloud computing service system to address the management difficulties and weak business scalability inherent in traditional physical hosts and Virtual Private Servers (VPS) services; they can also be servers for distributed systems or servers incorporating blockchain technology.
[0287] According to the technical solution of this disclosure, a method and apparatus for determining the state of an agent's memory are provided. For memories in a memory set, the validity of the memory is determined by using a method corresponding to the memory type. Based on the event type of the memory usage event in the agent's request processing chain, the retention strength and confidence of the target memory involved in the generation of the request processing result are determined. Based on the validity, retention strength, and confidence, the retention heat state of the target memory is determined. Thus, the retention heat state of the memory is transferred by combining the validity, retention strength, and confidence. This solves the problems of false reinforcement and fact expiration that occur in the long-term accumulation of agent memories, realizes hierarchical management of memories, improves the accuracy and reliability of memories, and helps to improve the accuracy of agent processing results.
[0288] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution provided in this disclosure can be achieved, and this is not limited herein.
[0289] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for determining the state of an intelligent agent's memory, comprising: For each memory in the memory set, the validity of the memory is determined by the method corresponding to the memory type. Based on the event type of memory usage events in the agent's request processing chain, determine the retention strength and confidence of the target memory involved in the generation of the request processing result by the agent; The retention heat status of the target memory is determined based on the effectiveness, the retention strength, and the confidence level.
2. The method according to claim 1, wherein, The determination of the validity of the memory by using the method corresponding to the memory type includes: In response to the memory being an atomic fact memory, the validity of the atomic fact memory is determined based on the fact validity time interval of the atomic fact memory and the system perception time interval.
3. The method according to claim 2, wherein, The determination of the validity of the atomic fact memory based on the fact validity time interval and the system perception time interval includes: The validity of the atomic fact memory is determined based on the fact validity time interval, the system perception time interval, and the judgment result of the atomic fact memory based on the fact establishment conditions.
4. The method according to claim 1, wherein, The method for determining the validity of a memory by using the memory type corresponding to the memory further includes: In response to a change in the atomic fact memory upon which the memory depends, the actual generation context of the derived memory is determined based on the current generation environment of the derived memory and the set of atomic fact memories upon which the derived memory currently depends. In response to the inconsistency between the actual generation context and the record generation context corresponding to the derived memory in the database, the validity of the derived memory is determined based on the atomic fact memory set.
5. The method according to claim 4, wherein, The atomic fact memory includes at least one version of fact memory, and the derived memory includes at least one version of derived memory. The derived memory, which responds to a change in the atomic fact memory upon which the memory depends, determines the actual generation context of the derived memory based on the current generation environment of the derived memory and the set of atomic fact memories upon which the derived memory currently depends, including: In response to the memory being a derived memory version whose dependent fact memory version has changed, the actual generation context of the derived memory version is determined based on the current generation environment of the derived memory version and the set of atomic fact memories constituted by the fact memory versions currently dependent on by the derived memory version; and The step of determining the validity of the derived memory based on the atomic fact memory set in response to the inconsistency between the actual generation context and the record generation context corresponding to the derived memory version in the database, includes: generating a new derived memory version of the derived memory based on the atomic fact memory set in response to the inconsistency between the actual generation context and the record generation context corresponding to the derived memory version in the database, and determining the validity of the new derived memory version.
6. The method according to claim 5, wherein, The generation environment includes generation strategies and generation algorithms, and Based on the atomic fact memory set, a new derived memory version of the derived memory is generated, including: Using a generation strategy and algorithm, a new version of the derived memory is generated based on the atomic fact memory set; and Also includes: The actual generation context is stored as the record generation context corresponding to the new derived memory version in the database.
7. The method according to claim 5, wherein, Also includes: The confidence level of the new derived memory version is determined based on the confidence level and source credibility of the fact memory versions in the atomic fact memory set, as well as their contribution to the new derived memory version.
8. The method according to claim 1, wherein, The memory includes at least one version of the memory; as well as The step of determining the retention strength and confidence of the target memory involved in the generation of the request processing result by the agent based on the event type of the memory usage event in the agent's request processing chain includes: Based on the time window, the memory usage events of the target memory version involved in the generation process are aggregated to obtain an event set; Based on the event type of the memory usage events in the event set, determine and update the retention strength and confidence of the target memory version.
9. The method according to claim 8, wherein, The step of determining and updating the retention strength and confidence of the target memory version based on the event type of the memory use events in the event set includes: Based on the event type of the memory usage events in the event set, determine the retention strength and confidence level of the target memory version; In response to the update request carrying a concurrency control version number for the target memory version that matches the concurrency control version number for the target memory version in the database, the original retention strength and original confidence level of the target memory version are updated to the retention strength and the confidence level, respectively; and Also includes: Update the concurrency control version number of the target memory version in the database.
10. The method according to claim 9, wherein, Determining the retention strength of the target memory version based on the event type of the memory usage events in the event set includes: The intensity change is determined based on the intensity weight corresponding to the event type of the memory in the event set; The original retention strength and time decay coefficient of the target memory version are combined to determine the decayed strength, wherein the time decay coefficient is determined according to the memory type and importance of the target memory version; The current retention strength of the target memory version is determined based on the attenuated strength and the amount of strength change.
11. The method according to claim 10, wherein, The step of determining the intensity change based on the intensity weight corresponding to the event type of the memory use event in the event set includes: The change in positive intensity is determined based on the intensity weight corresponding to the event type of each positive event in the event set. Based on the intensity weight corresponding to the event type of each negative event in the event set, the amount of negative intensity change is determined; and Determining the retention strength of the target memory version based on the attenuated strength and the amount of strength change includes: The retention strength of the target memory version is determined based on the attenuated strength, the positive strength change, and the negative strength change.
12. The method according to claim 9, wherein, Based on the event type of the memory usage events in the event set, the confidence level of the target memory version is determined, including: The effective weight of the memory usage event is determined based on the source credibility of the memory usage event in the event set and the contribution of the event type to the request processing result. The confidence level of the target memory version is determined based on the degree of influence and effective weight of each memory usage event in the event set on the confidence level.
13. The method according to claim 12, wherein, The step of determining the confidence level of the target memory version based on the degree of influence and effective weight of each memory usage event in the event set on the confidence level includes: The amount of positive evidence is determined based on the degree of influence of each positive event in the event set on the confidence level and the effective weight of the positive events. The amount of negative evidence is determined based on the degree of influence of each negative event in the event set on the confidence level and the effective weight of the negative events. The confidence level of the target memory version is determined based on the amount of positive evidence and the amount of negative evidence.
14. The method according to claim 13, wherein, Determining the confidence level of the target memory version based on the amount of positive evidence and the amount of negative evidence includes: Based on the prior strength of the target memory version, the historical confidence of the target memory version is divided into the amount of historical positive evidence and the amount of historical negative evidence; By combining the historical positive evidence quantity and the current positive evidence quantity, the current positive evidence quantity is obtained; By combining the historical negative evidence quantity and the current negative evidence quantity, the current negative evidence quantity is obtained; The confidence level of the target memory version is determined based on the current amount of positive evidence and the current amount of negative evidence.
15. The method according to any one of claims 9-14, wherein, Determining the retention heat status of the target memory based on the effectiveness, retention strength, and confidence level includes: The retention heat status of the target memory version is determined based on the effectiveness, retention strength, and confidence level.
16. The method according to claim 15, wherein, Determining the retention popularity status of the target memory version based on the validity, retention strength, and confidence level includes: The retention heat status of the target memory version is determined based on the effectiveness, the retention strength, the confidence level, and at least one reference parameter from the reference parameter set. The reference parameter set includes usage interval, sensitivity policy, and memory capacity pressure. The usage interval represents the difference between the last time the target memory version was used and the current time. The sensitivity policy represents the control conditions for the retention heat status of the target memory version.
17. The method according to any one of claims 1-16, wherein, The atomic fact memories in the memory are generated and updated in the following manner: Extract atomic facts that represent the fact values of entities in the attribute dimension from the evidence data source; In response to the existence of a target atomic fact memory in the memory set that has the same entity and attribute dimensions as the atomic fact, and the fact value of the target atomic fact memory is different from the fact value of the atomic fact, the conflict resolution result of the target atomic fact memory and the atomic fact is determined according to their respective fact validity time interval, source credibility, and preset conflict resolution rules. Based on the conflict resolution results, a new version of the fact memory for the target atomic fact memory is determined.
18. The method according to claim 17, wherein, Also includes: In response to the existence of a target atomic fact memory in the memory set that is consistent with the atomic fact, the supporting evidence for the target atomic fact memory is increased, and the confidence of the target atomic fact memory is updated.
19. The method according to any one of claims 1-18, wherein, Also includes: Based on the validity, retention strength, confidence level, and the visibility of the lifecycle state according to the query pattern of the query request, recall memories are determined from the memory set, wherein the lifecycle state includes the state corresponding to the validity and the retention heat state; Based on the recalled memory, the request processing result of the query request is generated.
20. The method according to claim 19, wherein, The step of determining the recalled memory from the memory set based on the visibility of the lifecycle state according to the validity, retention strength, confidence level, and query pattern of the query request includes: Based on the validity, retention strength, confidence level, query pattern of the query request, visibility of the lifecycle state, source credibility, and evidence gain, recalled memories are determined from the memory set, wherein the evidence gain characterizes the number of mutually consistent independent supporting evidence on which the memory depends.
21. A state determination device for an intelligent agent's memory, comprising: The validity determination unit is configured to determine the validity of a memory by using a determination method corresponding to the memory type in the memory set. The parameter determination unit is configured to determine the retention strength and confidence of the target memory involved in the generation of the request processing result by the agent based on the event type of the memory usage event in the agent's request processing chain. The state determination unit is configured to determine the retention heat state of the target memory based on the validity, the retention strength, and the confidence level.
22. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-20.
23. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-20.
24. A computer program product comprising: A computer program that, when executed by a processor, implements the method according to any one of claims 1-20.
