An agent memory promotion method and system based on evidence pedigree compression and memory type adaptation

CN122886818APending Publication Date: 2026-10-09ZHOUPU DATA TECH NANJING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611385603.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0002]智能体在执行任务过程中会产生大量行为证据记录,这些记录反映了智能体的操作过程、执行结果以及任务上下文;为了让智能体在后续任务中复用有效经验、避免重复错误,通常需要从这些行为证据中提取并固化形成长期记忆;现有方法多直接依据证据记录的数量、出现频率或简单规则判断是否将某条经验写入长期记忆;然而,智能体的单次任务或单次操作往往伴随多次重试、派生摘要等关联记录,这些记录在谱系上属于同一次行为尝试,若不加区分地作为独立证据进行计数,容易导致同一行为被重复统计,从而降低记忆晋升判定的准确性;

Benefits of technology

[0016]与现有技术相比,本发明通过证据谱系压缩和记忆类型适配,对证据记录进行来源校验和证据族归并,消除同一次行为尝试的重复统计,提高证据独立性;同时根据事实型、偏好型、过程型、策略型等不同记忆类型采用差异化的晋升条件和步骤匹配规则,确保长期记忆仅在充分且一致的证据支持下形成;此外,通过直接证据优先的裁决和增量处理机制,保证长期记忆在出现新证据时能够动态更新和追溯,从而整体上提升智能体记忆晋升的准确性、可靠性和可维护性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122886818A_ABST
    Figure CN122886818A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of agent memory management, and is an agent memory promotion method and system based on evidence pedigree compression and memory type adaptation. The specific method comprises: obtaining termination evidence records and matching or newly creating candidate memories, collecting associated evidence record sets for integrity verification; performing source verification on the associated evidence record sets to determine pedigree status, root type and root identification, classifying effective records into evidence families and selecting representative records to form independent evidence sets; checking the sufficiency and consistency of direct evidence and repeated evidence according to the candidate memory type to obtain a promotion decision; when the promotion decision is passed, writing into long-term memory and saving the mapping relationship, or performing incremental processing when the promotion decision is not passed or new evidence arrives. Through evidence pedigree compression and memory type adaptation, the present application eliminates repeated statistics, improves evidence independence, supports dynamic updating of long-term memory, and improves the accuracy and maintainability of memory promotion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent agent memory management technology, and more specifically, relates to an intelligent agent memory promotion method and system based on evidence spectrum compression and memory type adaptation. Background Technology

[0002] During task execution, intelligent agents generate a large number of behavioral evidence records, which reflect the agent's operation process, execution results, and task context. In order for the agent to reuse effective experience and avoid repeating mistakes in subsequent tasks, it is usually necessary to extract and solidify these behavioral evidences into long-term memory. Existing methods often directly determine whether to write a certain experience into long-term memory based on the number of evidence records, frequency of occurrence, or simple rules. However, a single task or operation of an agent is often accompanied by multiple retries, derived summaries, and other related records. These records belong to the same behavioral attempt in the genealogy. If they are counted as independent evidence without distinction, the same behavior may be counted repeatedly, thereby reducing the accuracy of memory promotion judgment. Furthermore, different types of memories have different formation conditions and evidence requirements. For example, factual memories usually rely on a small number of certain results to be valid, preference-based memories require repeated selections across tasks for inference, and procedural memories emphasize the consistency of key steps, their order, and states. Existing methods generally do not differentiate between memory types and often use a uniform threshold for the amount of evidence to make judgments, leading to premature promotion or excessive caution of certain types of memories, affecting the quality and credibility of long-term memories. At the same time, existing technologies lack a systematic verification of the genealogical relationships between records when merging evidence records. When parent records are missing, parent chains are cyclical, or root operation identifiers or root task identifiers conflict, related records may still be included in the statistics, causing evidence contamination. On the other hand, for content already written into long-term memories, when new supporting or opposing evidence appears, there is a lack of clear incremental update and tracing mechanisms, making it difficult to dynamically maintain long-term memories. Therefore, there is a need for an agent memory promotion method and system that can perform genealogical compression of behavioral evidence, adapt promotion conditions according to memory type, and support incremental maintenance. Summary of the Invention

[0003] To address the shortcomings of existing technologies, the present invention aims to overcome the aforementioned deficiencies and propose an agent memory promotion method and system based on evidence spectrum compression and memory type adaptation.

[0004] The present invention adopts the following technical solution; The first aspect of this invention discloses an agent memory promotion method based on evidence spectrum compression and memory type adaptation, as follows: Obtain termination evidence records, match or create candidate memories based on workspace identifiers, memory theme identifiers, and memory types, and collect a set of related evidence records; The source of the associated evidence record set is verified to determine the lineage status, root type and root identifier of each record. Records with valid lineage status are grouped into evidence families according to the same root identifier, and representative records are selected from each evidence family to form an independent evidence set. Based on an independent set of evidence, the sufficiency and consistency of direct and repeated evidence are examined according to the memory type of the candidate memory to obtain the promotion determination result. Based on the promotion determination result, when the promotion determination result is passed, the candidate memory content is written into the long-term memory, and the mapping relationship between the long-term memory and the evidence family and representative records is preserved.

[0005] Preferably, the collection of associated evidence records includes: starting from the termination evidence record, searching forward along the parent evidence identifier to find the parent record chain, and querying the derived record whose parent evidence identifier points to the current record and whose relationship type is derived, and using the parent record chain and the derived record together as the associated evidence record set.

[0006] Preferably, the source verification includes: tracing back along the parent evidence identifier for each evidence record to detect missing parent records and loops in the parent record chain; collecting root operation identifiers in the current record and its parent record chain; when all non-empty root operation identifiers have the same value, the value is used as the root identifier, the root type is recorded as the operation, and the lineage status is recorded as valid; when there are multiple different root operation identifiers, they are recorded as conflict; when there are no root operation identifiers, root task identifiers are collected and the root type and root identifier are determined according to the same rules.

[0007] Preferably, the step of grouping valid records of the genealogy status into evidence families according to the same root identifier includes: generating evidence family identifiers by performing a hash operation after concatenating the workspace identifier, memory topic identifier, root type and root identifier, and grouping valid records that share the same root identifier into the same evidence family.

[0008] Preferably, the step of selecting a representative record from each evidence family includes: prioritizing the record with a successful execution status and the latest occurrence time; if there is no successful record, then selecting the failed record with the latest occurrence time and no subsequent retry relationship; if only a derived summary exists, then selecting the derived summary and marking it as a derived representative, and when the derived representative does not contain an action sequence, backtracking along the parent evidence identifier to the most recent original execution record for process step matching.

[0009] Preferably, the sufficiency and consistency of checking direct evidence and duplicate evidence includes: obtaining currently valid direct evidence based on the memory subject identifier and scope of application of the candidate memory; checking its version, effective time, and scope of application; when valid direct evidence exists, marking the direct evidence channel as support, opposition, or conflict based on the consistency between the direct evidence and the candidate memory content; when no valid direct evidence exists, counting the number of supporters and opponents based on the minimum number of independent evidence families or the minimum number of independent tasks corresponding to the memory type, and marking the duplicate evidence channel as support, opposition, conflict, or insufficient evidence; and outputting the promotion determination result according to the direct evidence priority adjudication rule.

[0010] Preferably, when the candidate memory is of process type, the method further includes: generating necessary step codes and required states according to the process rule table; performing ordered subsequence matching between the action sequence of each evidence family representative record and the necessary step codes; if all necessary steps can be found in the action sequence in order and the action codes and execution states are consistent, then the representative record is determined to support the candidate memory; otherwise, it is opposed.

[0011] Preferably, the number of supporters and opponents is counted based on the minimum number of independent evidence families or the minimum number of independent tasks corresponding to the memory type, including: for factual, procedural, and strategic memories, the number of evidence families for supporters and opponents is counted; for preference-based memories, the number of independent tasks for supporters and opponents is counted; when the number of supporters reaches the minimum number of evidence families or the minimum number of tasks for the corresponding type and the number of opponents is less than the threshold, it is marked as support; when the number of opponents reaches the threshold and the number of supporters is less than the threshold, it is marked as opposition; when both sides reach the threshold, it is marked as conflict; otherwise, it is marked as insufficient evidence.

[0012] Preferably, when new evidence arrives, if there is a pending candidate memory with the same content, the new evidence is added to the candidate memory and the source verification, evidence family division and promotion determination are re-executed; if there is a promoted candidate memory with the same content, when the new evidence supports the existing long-term memory, only the evidence family mapping is added; when the new evidence opposes the existing long-term memory, it is re-examined according to the ruling rule of priority of direct evidence, and a new version is retained, deactivated or generated according to the result.

[0013] The second aspect of this invention discloses an intelligent agent memory promotion system based on evidence spectrum compression and memory type adaptation, as follows: Candidate memory generation module, lineage compression module, promotion determination module, and long-term memory writing module; The candidate memory generation module is used to obtain termination evidence records, match or create candidate memories based on workspace identifier, memory topic identifier and memory type, and collect a set of related evidence records; The genealogy compression module is used to perform source verification on the set of related evidence records, determine the genealogy status, root type and root identifier of each record, classify records with valid genealogy status into evidence families according to the same root identifier, and select representative records from each evidence family to form an independent evidence set. The promotion determination module is based on an independent evidence set. It checks the sufficiency and consistency of direct and repeated evidence according to the memory type of the candidate memory to obtain the promotion determination result. The long-term memory writing module is based on the promotion determination result. When the promotion determination result is passed, the candidate memory content is written into the long-term memory, and the mapping relationship between the long-term memory and the evidence family and representative records is saved.

[0014] A third aspect of the present invention discloses a terminal, including a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the agent memory promotion method based on evidence genealogy compression and memory type adaptation as described in the first aspect.

[0015] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements the steps of the intelligent agent memory promotion method based on evidence spectrum compression and memory type adaptation described in the first aspect.

[0016] Compared with existing technologies, this invention improves the independence of evidence by compressing evidence genealogy and adapting memory types to perform source verification and evidence family merging on evidence records, eliminating duplicate statistics of the same behavior attempt. At the same time, it adopts differentiated promotion conditions and step matching rules according to different memory types such as factual, preference, process, and strategy, ensuring that long-term memory is formed only with sufficient and consistent evidence. In addition, through the adjudication of direct evidence priority and incremental processing mechanism, it ensures that long-term memory can be dynamically updated and traced when new evidence appears, thereby improving the accuracy, reliability, and maintainability of agent memory promotion as a whole. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a flowchart illustrating an agent memory promotion method based on evidence spectrum compression and memory type adaptation according to the present invention. Figure 2The main flowchart for the evidence genealogy compression and memory type adaptation promotion of this invention; Figure 3 This is a schematic diagram of the compressed genealogy of homologous evidence in this invention; Figure 4 This is a schematic diagram of the memory type and evidence qualification template of the present invention; Figure 5 This is a schematic diagram of the structure of an intelligent agent memory promotion system based on evidence spectrum compression and memory type adaptation according to the present invention. Detailed Implementation

[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0019] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0020] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0021] Example 1: To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to an embodiment of a code agent that runs unit tests before submitting code—a procedural memory. Specifically, the following will be included: In this embodiment, the scenario in which the code agent processes task A and task B sequentially in the workspace: workspace-code-01 is used as an example for illustration; where task A and task B are both task identifiers, which are triggered by different user requests.

[0022] Task A retried twice when calling the pre-commit check tool, generating four evidence records: Evidence Record E1, Evidence Record E2, Evidence Record E3, and Evidence Record E4. Evidence Record E1 records the initial execution failure; Evidence Record E2 records the first retry failure; Evidence Record E3 records the second retry success; and Evidence Record E4 is an execution summary generated from Evidence Record E3. The workspace identifier for Evidence Records E1 to E4 is Workspace-Code-01; the operation type is Code Commit; the memory topic identifier is Procedure: Pre-commit Unit Test; the root task identifier is Task-A; and the root operation identifier is Operation-A. Evidence Record E2 points to Evidence Record E1 through a retry relationship; Evidence Record E3 points to Evidence Record E2 through a retry relationship; and Evidence Record E4 points to Evidence Record E3 through a derivation relationship. Evidence Record E3 also stores the action sequence for this successful execution, which includes: running unit tests, checking test results, and committing code.

[0023] Task B calls the pre-commit check tool only once and completes successfully, generating evidence record E5, indicating that the code commit operation was executed successfully. Evidence record E5 has the workspace identifier "Workspace-Code-01"; the operation type "Code Commit"; the memory topic identifier "Procedure: Pre-commit Unit Test"; the root task identifier "Task-B"; and the root operation identifier "Operation-B". Evidence record E5 also stores the successfully executed action sequence, which includes: running unit tests, checking test results, and committing code. Evidence record E5 has no parent-child relationship with the records in Task A, and does not share the root operation identifier or root task identifier.

[0024] In this embodiment, data objects include evidence records, candidate memories, evidence families, long-term memories, process rules, and type rules. To facilitate understanding of the technical solution of this embodiment, these data objects are described below: The evidence records are used to store the original behavioral information generated during the execution of operations by the intelligent agent. Each evidence record stores at least the following fields: evidence identifier, workspace identifier, operation type, memory topic identifier, content, execution status, root operation identifier, root task identifier, parent evidence identifier, relationship type, action sequence, genealogy status, and occurrence time. Among these, the evidence identifier is the unique identifier of the current evidence record; the workspace identifier indicates the specific workspace to which the evidence belongs; the operation type indicates the type of operation that generated the evidence; the memory topic identifier indicates the memory topic corresponding to the evidence, used for filtering candidate evidence; the content indicates the specific content of the evidence record; and the execution status indicates the execution status of the current operation. The record status includes: in progress, successful, and failed; the root operation identifier indicates the root operation identifier that generated the record, and multiple retries of the same operation use the same identifier; the root task identifier indicates the complete task identifier that triggered the operation, and a task can contain multiple operations; the parent evidence identifier indicates the identifier of the previous record that the current record directly depends on, and is empty if there is no previous record; the relation type indicates the relationship between the current record and the previous record, including: retry and derivation; the action sequence indicates the list of steps saved in sequence during termination of execution; the genealogy status indicates the verification status of the direct root identifier and the parent chain tracing result, including: valid, conflicting, and invalid; the occurrence time indicates the time when the evidence record was generated; The candidate memories are used to store content to be written into long-term memory; each candidate memory stores at least the following fields: candidate identifier, memory topic identifier, memory type, content, scope of application, workspace identifier, evidence identifier list, necessary step code, required status, candidate status, reason for failure, and most recent evaluation time; wherein, the candidate identifier is a unique identifier for the candidate memory; the memory topic identifier indicates the memory topic, and the same topic uses the same identifier; the memory type indicates the type of candidate memory, including: factual, preference, process, and strategy; the content indicates the content to be written into long-term memory; the scope of application indicates the scope of application of the memory, including: user, workspace, and global; the workspace... The field identifier indicates the specific workspace to which the candidate belongs; this field is required when the scope of application is workspace. The evidence identifier list indicates the list of evidence identifiers supporting the candidate memory. The necessary step codes indicate the key steps that a process-type candidate must take in sequence. The required status indicates the list of execution states that each necessary step in the process-type candidate memory should reach, corresponding one-to-one with the necessary step codes. The candidate status indicates the current status of the candidate memory, including: pending (indicating waiting for new evidence), promoted (indicating it has been written into long-term memory), and invalid (indicating the candidate memory itself has incomplete data). The reason for failure indicates the reason for the most recent failure to pass the check. The most recent evaluation time indicates the time of the most recent promotion decision. The evidence family is used to group records that share the same lineage root into an independent evidence unit; each evidence family stores at least the following fields: family identifier, root type, root identifier, member identifier list, representative identifier, and task identifier; wherein, the family identifier is the unique identifier of the evidence family; the root type indicates the root type used when generating the evidence family, including: operation and task; the root identifier indicates the normalized root identifier corresponding to the root type; the member identifier list indicates all record identifiers contained in the same evidence family; the representative identifier indicates the representative record identifier selected from the evidence family; and the root task identifier indicates the root task identifier corresponding to the evidence family, used for cross-task independence judgment of procedural memory; The long-term memory is used to store memory content that has passed the promotion determination and been written to persistent storage; the long-term memory stores at least the following fields: family identifier list and representative identifier list; wherein, the family identifier list represents the list of evidence family identifiers supporting the long-term memory; the representative identifier list represents the list of identifiers of each evidence family representative record; Long-term memory should also store at least the following fields: long-term memory identifier, memory topic identifier, memory type, content, scope of application, workspace identifier, status, and version; among which, the long-term memory identifier is the unique identifier of the long-term memory; the status indicates whether the long-term memory is currently valid, including valid and deactivated; the version is used to distinguish the versions of content written at different times under the same memory topic; The process rules are used to store the key steps that must be executed in procedural memory, as well as their sequence and status requirements. Each process rule stores at least the following fields: rule identifier, memory subject identifier, step number, action code, and requirement status. Among them, the rule identifier is a unique identifier for the procedural memory rule; the memory subject identifier indicates the memory subject to which the rule applies; the step number indicates the sequential number of the key steps in the rule; the action code indicates the standardized action code; and the requirement status indicates the execution status that the key steps are required to achieve. The type rules are used to store the minimum number of independent evidence requirements corresponding to different memory types. The type rules include at least the following fields: minimum number of evidence families for factual memories, minimum number of tasks for preference-based memories, minimum number of evidence families for procedural memories, and minimum number of evidence families for strategic memories. Specifically, the minimum number of evidence families for factual memories represents the minimum number of independent evidence families required for factual memories; the minimum number of tasks for preference-based memories represents the minimum number of independent tasks required when inferring behavioral preferences; the minimum number of evidence families for procedural memories represents the minimum number of independent evidence families required when using repeated evidence conditions; and the minimum number of evidence families for strategic memories represents the minimum number of independent evidence families required for strategic memories. It should be noted that in this embodiment, all the above parameters are positive integers and can be configured differently according to the actual application scenario. like Figure 1As shown, and in conjunction with the above description of the scenarios and data objects, an agent memory promotion method based on evidence spectrum compression and memory type adaptation according to an embodiment of the present invention specifically includes the following: S1. When a task or root operation enters the termination state, read the workspace identifier, memory subject identifier and memory type in the termination evidence record. Based on this, search for matching items in the existing candidate memories or create new candidate memories. And perform integrity verification on the necessary fields and necessary step codes of the candidate memories based on the evidence identifier list and process rules, so as to obtain the candidate memories to be judged that have complete fields and have a set of related evidence records. S101. Based on the workspace identifier, memory theme identifier, and memory type of the termination evidence record, search for or create a candidate memory, and include the related evidence record generated in this task into the evidence identifier list of the candidate memory. Specifically, in this embodiment, when a task is completed or a root operation enters a successful or failed termination state, the workspace identifier and memory topic identifier in the termination evidence record are read, and a search is performed in the existing candidates according to the combination of workspace identifier, memory topic identifier, memory type, and applicable scope. If no matching combination exists, a new candidate memory is created; if a matching combination exists, the candidate memory is updated. The memory topic identifier is copied as the memory topic identifier of the candidate memory, and the memory type is determined based on the type prefix in the memory topic identifier. For example, when the memory topic identifier is "Procedure: Unit Test Before Submission," the process prefix is ​​identified, and the memory type is determined to be procedural. Simultaneously, starting from the termination evidence record, the parent record chain is searched forward along its parent evidence identifier, and derived records whose parent evidence identifier points to the current record and whose relationship type is derived are queried. The parent record chain and derived records are combined as the set of associated evidence records generated by this task or root operation. In this embodiment, when task A ends and its root operation, operation-A, enters the terminated state, the final success record E3 is read, and records with the same workspace identifier, memory topic identifier, and root operation identifier as E3 are searched. Following the parent evidence identifier of E3 forward, retry records E2 and E1 are obtained. Then, records whose parent evidence identifier points to E3 and whose relationship type is derived are queried, resulting in derived record E4. Thus, evidence records E1 to E4 are obtained, and candidate memories are generated based on the execution content and action sequence of evidence record E3. The candidate identifier of this candidate memory is denoted as candidate-1. When task B ends, the termination evidence record E5 is read. Since evidence record E5 and candidate-1 have the same workspace identifier, memory topic identifier, and memory type, evidence record E5 is added to the evidence identifier list referenced by candidate-1. The content field of candidate memories can be extracted from the content of termination evidence records or representative records; when there are no successful records, it can be temporarily empty, pending the supplementation of subsequent valid evidence.

[0025] It should be noted that if a record is unrelated to the memory topic or does not belong to the root operation mentioned above, it will not be added to candidate -1. S102. Perform field missing checks and process rule integrity checks on candidate memories. If a field or process rule requirement of a candidate memory is incomplete, stop the current processing and record the missing field; if the field is complete, continue to execute subsequent steps. More specifically, the workspace identifier, memory theme identifier, memory type, content, scope of application, and evidence identifier list of candidate memories are checked item by item to determine whether any fields are missing; When the memory type is process-based, the process rule table is queried according to the memory topic identifier of the candidate memory, the necessary step codes and required status are generated by sorting by step number, and written into the necessary step code field of the candidate memory. The completeness of the necessary step codes is then checked. It should be noted that the currently valid rule identifier is first determined based on the memory topic identifier, then the step record is queried based on the rule identifier, and sorted according to the step number to obtain the necessary step code; In this embodiment, the rule of running unit tests before submitting code is saved as shown in Table 1: Table 1 is a process rule table used to store the key steps that must be executed in a process-oriented memory, as well as their sequence and state requirements;

[0026] Therefore, the necessary steps to obtain candidate-1 are encoded as: [run unit tests, check test results, submit code], and all of the above steps require a successful status. Since all the necessary fields of candidate-1 are complete, the subsequent steps are executed.

[0027] S103. Integrate the complete candidate memory and the set of evidence records associated with the candidate memory to form a unified set of candidate memories and associated evidence records for output. It should be noted that, in this embodiment, the candidate memory includes at least: candidate identifier, workspace identifier, scope of application, memory subject identifier, memory type, content, evidence identifier list, and necessary step code; each evidence record in the evidence record set retains its original fields, including: evidence identifier, parent evidence identifier, root operation identifier, root task identifier, execution status, and action sequence.

[0028] In this embodiment, the workspace identifier for candidate-1 is workspace-code-01; the applicable scope is the workspace; the memory topic identifier is process: unit test before submission; the memory type is procedural; the content is running unit tests before submitting code; the evidence identifier list is [E1, E2, E3, E4, E5]; the necessary steps are encoded as [run unit tests, check test results, submit code]; at the same time, the output candidate memory and associated evidence record set is [E1, E2, E3, E4, E5], and each evidence record retains its original fields.

[0029] S2. Based on the candidate memory and associated evidence record set, for each evidence record in the set, trace back the parent record chain level by level along the parent evidence identifier, and determine the lineage status, root type and root identifier for each record according to the occurrence of the root operation identifier and the root task identifier in the parent record chain, in order of priority of root operation identifier first and root task identifier later, to obtain the source relationship verification result of the evidence record and the root identifier used for evidence family division. S201. For each evidence record in the candidate memory and associated evidence record set, search for the parent record level by level along the parent evidence identifier, construct the parent record chain and detect missing parent records and loops in the parent record chain. Specifically, for evidence records whose parent evidence identifier is not empty, the parent record is searched level by level according to the parent evidence identifier until the starting record with an empty parent evidence identifier is found; during the search process, the evidence identifiers that have been accessed are saved. It should be noted that when the record pointed to by the parent evidence identifier does not exist, the search stops and the genealogical status of the evidence record is marked as invalid, indicating that the parent record is missing; when the same evidence identifier is encountered again, the search stops and the genealogical status of the evidence record is marked as invalid, indicating that there is a cycle in the parent record chain; after the parent record chain search is completed, the root operation identifiers in the current record and its parent record chain are collected.

[0030] In this embodiment, the parent evidence identifier of evidence record E1 is empty; evidence record E2 points to E1 through a retry relationship; evidence record E3 points to E2 through a retry relationship; evidence record E4 points to E3 through a derivation relationship; therefore, evidence records E1, E2, E3 and E4 form the same parent record chain; the root operation identifier of the four records is operation-A, and no other root operation identifier appears; the parent evidence identifier of evidence record E5 is empty, and the root operation identifier is operation-B, thus forming a separate parent record chain.

[0031] S202. Collect the root operation identifier and root task identifier in the current record and its parent record chain, group them differently and mark them. When a unique root operation identifier or root task identifier can be determined in the parent record chain, the identifier is determined as the root identifier of the record and the lineage status is marked as valid. When multiple different identifiers appear or the identifier cannot be determined, it is marked as conflict or invalid. Specifically, first collect the root operation identifiers of the current record and its parent record chain, and then determine the grouping criteria according to the following rules: If there is at least one non-empty root operation identifier in the current record and its parent record chain, and all non-empty root operation identifiers have the same value, it means that these records point to the same root operation. In this case, the lineage state is recorded as valid, the root type is recorded as operation, and the unique value of the root operation identifier is recorded as the root identifier. When two or more different root operation identifiers appear in the current record and its parent record chain, it indicates that the root operation identifier directly stored in the record is inconsistent with the relationship of the parent record. The lineage state is recorded as a conflict, and no one is arbitrarily selected from multiple root operation identifiers as the basis for grouping. Only when neither the current record nor its parent record chain has a root operation identifier is the root task identifier used to determine the grouping basis.

[0032] In addition, collect the root task identifiers of the current record and its parent record chain, and determine the grouping criteria according to the following rules: If there is at least one non-empty root task identifier in the current record and its parent record chain, and all non-empty root task identifiers have the same value, the lineage state is recorded as valid, the root type is recorded as task, and the unique value of the root task identifier is recorded as the root identifier. If the current record does not have a root task identifier, but a unique root task identifier can be determined in the parent record chain, the lineage status is recorded as valid, the root type is recorded as task, and the unique value of the root task identifier in the parent record chain is recorded as the root identifier. When two or more different root task identifiers appear, it indicates that there is a conflict in the root task identifiers, and the lineage state is recorded as a conflict.

[0033] When neither the root operation identifier nor the root task identifier can be determined, it indicates that the record lacks a usable root identifier, and the lineage status is recorded as invalid.

[0034] Therefore, the root operation identifier and the root task identifier are not directly compared, but the root operation identifier is used first; the root task identifier is used only when neither the current record nor its parent record chain has a root operation identifier; the root identifier type used this time is saved as the root type, and the corresponding identifier value is saved as the root identifier.

[0035] In this embodiment, the root operation identifiers of evidence records E1 to E4 are all operation-A. Therefore, the lineage status of evidence records E1 to E4 is recorded as valid, the root type is recorded as an operation, and the root identifier is recorded as operation-A. The root operation identifier of evidence record E5 is operation-B. Therefore, its lineage status is also recorded as valid, the root type is recorded as an operation, and the root identifier is recorded as operation-B. S203. Exclude records with conflicting or invalid genealogical status from the evidence family division, preserve the reasons for the anomalies, and only allow records with valid genealogical status to proceed to the next step of evidence family division. The candidate memory evidence identifier list retains all related evidence records for auditing and tracing; however, only representative records whose lineage status is valid and which are selected into the evidence family are involved in the promotion judgment; invalid or conflicting records are still retained in the evidence identifier list, but do not participate in the evidence family division and promotion qualification determination.

[0036] Specifically, the causes of the anomaly include at least: missing parent record, circular parent record chain, root operation identifier conflict, root task identifier conflict, and missing root identifier; In this embodiment, two valid root operations are obtained according to S202: operation-A and operation-B; evidence records E1 to E4 are assigned to the same evidence family according to operation-A; evidence record E5 is assigned to another evidence family according to operation-B.

[0037] The lineage status, root type, and root identifier of each evidence record are appended to the evidence record as derived fields, or a lineage mapping table is generated as input for the S3 evidence family division. S3. For records with valid genealogical status and their root type and root identifier, generate evidence family identifiers by combining workspace identifier, memory subject identifier, root type and root identifier. Records sharing the same root identifier are grouped into the same evidence family. Within each evidence family, a representative record is selected according to the execution termination status and time sequence, thereby obtaining an independent evidence set composed of representative records. S301. Generate evidence family identifiers based on workspace identifiers, memory subject identifiers, root types, and root identifiers, and group valid records that share the same root identifier into the same evidence family. Specifically, the steps for generating an evidence family identifier are as follows: The workspace identifier, memory subject identifier, root type, and root identifier corresponding to the same evidence record are concatenated end to end in the order of workspace identifier, memory subject identifier, root type, and root identifier to obtain a concatenated string; a hash operation is performed on the concatenated string, and the result is used as the family identifier of the evidence family, i.e., the evidence family identifier.

[0038] Records sharing the same root identifier will be grouped into the same evidence family. The member identifier list in an evidence family stores all the evidence record identifiers contained in that family; the representative identifier stores the representative record identifier selected from that evidence family. Other records within the family are not deleted and continue to be stored in the member identifier list.

[0039] In this embodiment, the root type of evidence records E1 to E4 is "operation," and the root identifier is "operation-A," which are merged into evidence family-A. The root type of evidence record E5 is "operation," and the root identifier is "operation-B," forming a separate evidence family-B. For evidence family-A, the workspace identifier (i.e., workspace-code-01), memory topic identifier (i.e., process: pre-commit unit test), root type (i.e., operation), and root identifier (i.e., operation-A) are concatenated sequentially in the order of workspace identifier, memory topic identifier, root type, and root identifier. A hash operation is then performed on the concatenated string, and the result of the hash operation is used as the evidence family identifier for evidence family-A. Evidence family-B is generated according to the same rules. Even if evidence records E3 and E5 have the same text, they are considered two separate pieces of evidence because of their different root identifiers.

[0040] S302. Within each family of evidence, select a representative record according to the principle of success priority, last success priority, and last failure as a fallback. Specifically, for each evidence family, a representative record is selected based on the execution status and occurrence time of the member records. The selection rules are as follows: when there are records with a successful execution status in the family, the latest successful record is selected as the representative record; when there are no successful records in the family but there are records with a failed execution status, the latest failed record with no subsequent retry relationship is selected as the representative record; when there are only non-original execution records such as derived summaries in the family, the derived summary is selected as the representative record and marked as a derived representative in the representative identifier. Other records in the family are not deleted and continue to be stored in the member identifier list.

[0041] In an alternative implementation, when multiple success records exist within a family, a representative record can be selected based on the record's occurrence time, confidence level, or execution completion rate. For example, the success record with the latest occurrence time, highest confidence level, or highest execution completion rate can be preferentially selected.

[0042] For example, in this embodiment, evidence family-A contains a successful record E3 and no later successful records, so evidence record E3 is selected as the representative record, and evidence records E1, E2, and E4 are retained as members; evidence family-B contains only a successful record E5, so evidence record E5 is selected as the representative record. The original five evidence records are counted as only two pieces of evidence after merging.

[0043] If the representative record is a derived representative and does not contain an action sequence, then trace back along its parent evidence identifier to the most recent original execution record and perform procedural step matching using the action sequence of that original execution record; if the original action sequence cannot be obtained, then determine that the evidence family does not meet the procedural step requirements.

[0044] S303. Based on the previous steps, output an independent set of evidence consisting of representative records of each evidence family. This independent set of evidence includes a set of evidence families and a list of representative identifiers. It should be noted that, in this embodiment, each evidence family in the independent evidence set carries, in addition to the family identifier, the root task identifier of the record it represents, which is used for cross-task independence judgment of procedural memory; in the independent evidence set, each evidence family contributes at most one independent support unit in a promotion judgment.

[0045] In this embodiment, the evidence family set of the independent evidence set is [Evidence Family-A, Evidence Family-B], and the representative identifier list is [E3, E5]. The root task identifier of Evidence Family-A is Task-A, and the root task identifier of Evidence Family-B is Task-B. They come from different tasks, which satisfies the requirement of the number of independent tasks for subsequent procedural memory.

[0046] S4. Based on the independent evidence set, according to the memory type of the candidate memory, read the corresponding evidence quantity threshold and necessary steps, and conduct evidence sufficiency and consistency checks on the direct evidence channel and the repeated evidence channel respectively. In accordance with the ruling rule of direct evidence priority, output the check results of support, opposition, insufficient evidence or conflict, so as to determine whether the candidate memory meets the conditions for being written into long-term memory.

[0047] S401. Based on the memory theme identifier and scope of application of the candidate memory, obtain currently valid direct evidence from the direct evidence database; the direct evidence includes: administrator settings, user-expressed persistent selections, system-determined values, and officially released operating specifications; for each piece of direct evidence, check its version, effective time, and scope of application; invalid, expired, or inapplicable direct evidence is not included in the judgment; When valid direct evidence exists, the results of the direct evidence pathway are marked as supportive, opposing, or conflicting based on the consistency between the direct evidence and the candidate memory content; when no valid direct evidence exists, it is marked as insufficient evidence. Specifically, the first step is to check whether the source of the direct evidence is legal, whether it is still valid, and whether its scope of application is consistent with the candidate memory. If the evidence has expired or is not applicable to the current scope, it will not be included in the judgment. Direct evidence is evidence that can directly determine the content of the memory. In this embodiment, direct evidence includes, for example, administrator settings, explicit user statements, system-determined values, or officially released operating specifications.

[0048] It should be noted that, for direct evidence of factual memories, the definitive results returned by the tool, the system's definitive values, or administrator settings can be used; for direct evidence of preference-based memories, the persistent choices explicitly expressed by the user can be used; for direct evidence of procedural memories, the operational procedures issued and confirmed as valid by authorized personnel can be used; and for direct evidence of strategic memories, administrator settings or current workspace policies can be used.

[0049] When valid direct evidence only supports candidate memory, the check result of the direct evidence channel is marked as supportive; when valid direct evidence only supports the opposite content, it is marked as opposed; when there is no valid direct evidence, it is marked as insufficient evidence; when there is direct evidence with opposite content, the currently valid evidence is first determined according to the version and effective time; when it is still impossible to determine, the check result is marked as conflicting.

[0050] In this embodiment, candidate memory: Candidate-1 belongs to process memory, and there is no valid operating procedure issued by the administrator or confirmed by manual review. Therefore, there is no valid direct evidence, and the direct evidence channel check result is insufficient evidence.

[0051] S402. When the direct evidence channel check result is insufficient evidence, based on the minimum number of independent evidence families or the minimum number of independent tasks corresponding to the memory type, count the number of evidence families or independent tasks for the supporting and opposing sides according to the memory type; for biased memories, count the number of independent tasks; for other types, count the number of evidence families, and mark the check result of the repeated evidence channel as supporting, opposing, conflicting, or insufficient evidence accordingly. Before counting the number of evidence families for the supporting and opposing sides, we first determine whether to support or oppose the representative record of each evidence family based on the memory type of the candidate memories: For factual memories, if the content of the representative record is consistent with the content of the candidate memory, then the evidence family is in support; if the content is opposite, then it is in opposition. For preference-based memories, if the user's choice corresponding to the representative record is consistent with the preference in the candidate memory, then the evidence family is in support; otherwise, it is in opposition. For strategic memories, if the strategy identifiers represented by the record are consistent with the strategy of the candidate memory, then the evidence family is in favor; otherwise, it is in opposition. For procedural memories, the action sequence matching results of S403 are used to determine whether the memory is supported or opposed; a successful match indicates support, while a failed match indicates opposition. Specifically, when there is no valid direct evidence, judgment is made based on evidence generated from multiple independent tasks, as follows: For factual memories, at least... Each independent family of evidence yields the same result; for biased memories, at least [number missing] are required. The same choice appears in multiple independent tasks; for procedural memory, at least... Each instance of evidence must be an independent family of evidence from a different root task identifier, and each execution must be successful, with key steps and their order meeting the requirements; for strategy-based memory, at least Each independent family of evidence supports the same strategy, and the scope of application of the evidence is consistent with the scope of application of the candidate memory. in, The minimum number of evidence families required for factual cases; Minimum number of tasks for preference-based tasks; The minimum number of evidence families required for a procedural case; For strategic minimum number of evidence families; , , , All are positive integers and can be pre-configured according to the actual application scenario. In this embodiment, for example, You can choose 2, 3, or higher; You can choose 1 or 2; You can choose 2 or 3; You can choose 2 or 3.

[0052] Let the number of supporting evidence families be . The number of opposing evidence families is For procedural memory, when and When, the results of the repeated evidence pathway inspection are marked as supportive; when and When, it is marked as opposed; when and If the evidence is insufficient, it is marked as conflict; otherwise, it is marked as insufficient evidence. For factual, preference, and strategic memories, the thresholds in the above criteria are... Replace with , and The statistical objects are replaced with the number of independent evidence families or the number of independent tasks.

[0053] S403. When the memory type of the candidate memory is process-oriented, match each action sequence representing evidence with the necessary step codes in an ordered subsequence and determine whether the sequence and state requirements are met. Specifically, each representative piece of evidence stores the actual execution steps through an action sequence; each step includes: a step number (indicating the execution order), an action code (indicating the action performed), and an execution state (indicating the execution result). Candidate memories store the necessary steps through necessary step codes and the states that these steps should reach through required states.

[0054] More specifically, the necessary steps encoded in the candidate memory are arranged sequentially according to a prescribed execution order, denoted as the 1st necessary step, the 2nd necessary step, ..., the kth necessary step; each necessary step corresponds to a required state, representing the execution result that the step should achieve. The sequence of actions representing evidence is arranged sequentially according to the actual execution order, denoted as the 1st actual step, the 2nd actual step, ..., the mth actual step; each actual step has an execution state.

[0055] When a candidate memory is procedural, if all necessary steps can be found sequentially from the action sequence of the representative evidence according to the order specified by the candidate memory, and the action code of each found actual step matches the corresponding necessary step code, and the execution state of the actual step matches the corresponding required state, then the representative evidence is deemed to meet the step requirements of procedural memory; otherwise, the representative evidence is deemed not to meet the step requirements of procedural memory. In other words, the actual action sequence may contain other non-essential steps, but the order of the necessary steps must not be changed, and the necessary steps themselves must not be missing.

[0056] In this embodiment, the necessary step encoding sequence for candidate memory: Candidate-1 is [run unit test, check test results, submit code], requiring all states to be successful. Evidence E3, the representative evidence of evidence family-A, comes from task-A, and evidence E5, the representative evidence of evidence family-B, comes from task-B. The actual action sequence for evidence records E3 and E5 is both [run unit test, check test results, submit code], and the execution state of all three steps is successful. Therefore, both evidence family-A and evidence family-B satisfy the step requirements for procedural memory.

[0057] S404. Based on the inspection results of the direct evidence channel and the duplicate evidence channel, the final judgment result shall be output in accordance with the ruling rule of priority of direct evidence. Specifically, in this embodiment, the following rules are used to determine whether a candidate memory passes the check, thereby obtaining the check result: When valid direct evidence supports a candidate memory, the candidate memory passes the check. Even if duplicate evidence supports the opposite, the direct evidence prevails, and the opposing evidence family is recorded. When valid direct evidence opposes a candidate memory, the candidate memory fails the check. When there is no valid direct evidence, the check is made based on duplicate evidence: when duplicate evidence supports the candidate memory, the check passes; otherwise, the check fails. When there is an irreconcilable conflict between direct evidence, the candidate memory fails the check, and the conflicting evidence is retained until the version, effective date, or scope of application is revised and re-checked.

[0058] It should be noted that direct evidence has a higher priority because it typically comes from explicit settings, explicit expressions, or formal operating procedures; duplicate evidence is merely a summary result obtained from multiple task executions. In another embodiment, for example, a currently valid administrator setting supports content A, but three independent tasks support content contrary to A. In this case, the administrator setting is followed, allowing content A to pass the check, while the three contradictory evidence families are recorded. If the administrator setting is invalid or no longer applicable to the current scope, it is no longer considered direct evidence, and content A fails the check based on the results of the three independent tasks.

[0059] In this embodiment, candidate memory -1 lacks valid direct evidence, therefore repeated evidence is used for judgment. Evidence family -A and evidence family -B come from two different tasks, both meeting the step requirements of procedural memory, and the number of independent evidence families reaches [number missing]. Therefore, candidate -1 passes the check and can be written into long-term memory.

[0060] S5. Based on the final judgment result, when the judgment result is passed, the candidate memory content is written into the long-term memory, and the mapping relationship between the long-term memory and the evidence family identifier and the representative evidence identifier is saved; when the judgment result is failed or new evidence arrives, incremental processing such as pending maintenance, re-judgment or supplementary mapping is performed according to the current state of the candidate memory and the evidence family affiliation, so as to maintain the traceability relationship between the long-term memory and the original evidence.

[0061] S501. When a candidate memory passes the S4 check, its contents are written into the long-term memory, and the candidate status is updated to "promoted." Simultaneously, a list of evidence family identifiers and a list of representative identifiers supporting the long-term memory are saved. All evidence records within the evidence family can be retrieved using these identifiers.

[0062] In this embodiment, the memory topic identifier is the process: pre-submission unit test; the content is the long-term memory of running the unit test before submitting the code, and the family identifier list is saved as [Evidence Family-A, Evidence Family-B], and the representative identifier list is [E3, E5]. Evidence records E1 to E5 can be found through these identifiers.

[0063] S502. When a candidate memory fails the promotion decision but the fields are complete, the candidate status is kept as pending and the reason for failure is recorded; when a candidate memory field is missing, the candidate status is marked as invalid and no automatic check is performed. Specifically, when a candidate memory fails the check due to insufficient independent evidence, evidence conflicts, or non-compliance with execution procedures, it is temporarily not written into long-term memory, but is not deleted. The candidate status is marked as pending, and the reason for the failure and the list of associated evidence identifiers are saved. When new relevant evidence emerges later, the candidate memory can be re-evaluated. When a candidate memory lacks necessary fields such as memory subject identifier, memory type, and scope of application, its status is marked as invalid. Such candidate memories are not automatically checked until the fields are corrected. The original evidence identifier list of the candidate memory continues to save the associated evidence identifiers. When re-examining a candidate memory, the evidence records and corresponding evidence families are read from the evidence identifier list; it is not necessary to regenerate the candidate content.

[0064] S503. When new evidence arrives and there is a pending candidate memory with the same content, the new evidence is added to the candidate memory and the source verification, family division and promotion determination are re-executed; when there is a promoted candidate memory with the same content, only the evidence family mapping is updated or the long-term memory is re-examined according to the adjudication rules. Specifically, after new evidence arrives, candidate memories or long-term memories with the same content are searched based on workspace identifiers, memory theme identifiers, memory types, and applicable scopes, including two cases: candidate memories that have not yet been written into long-term memories and candidate memories that have already been written into long-term memories. It should be noted that when a candidate memory has not yet been written into long-term memory, the following procedures are performed: When a candidate memory with a pending status is found, the evidence identifier of the new evidence is added to the evidence identifier list of that candidate memory. After the new evidence completes source verification, evidence family division, and representative record selection, S4 is re-executed. If the re-examination passes, S501 is executed to write the candidate memory into long-term memory and update the candidate status to "promoted"; if the re-examination still fails, the pending status remains, and the reason for failure and the most recent evaluation time are updated.

[0065] When a candidate memory has already been written into long-term memory, the following steps are taken: If a candidate memory whose candidate state has been promoted is found, it indicates that the corresponding content has already been written into long-term memory; in this case, new evidence is not used to re-promote the candidate memory; when new evidence supports existing long-term memory, only the correspondence between the long-term memory and the new evidence family is added. When new evidence opposes existing long-term memory or conflicts with existing evidence, the long-term memory is re-examined according to the adjudication rules in step S4, and based on the examination results, it is retained, deactivated, or a new version of the memory is generated.

[0066] In this embodiment, at time 1, candidate-1 has only one independent evidence family, evidence family-A, which does not meet the requirement. The requirements are as follows: therefore, candidate-1 is not written into long-term memory, the candidate state is recorded as pending, the reason for failure is recorded as insufficient number of independent evidence families, and the evidence identifier corresponding to evidence family-A is retained. When the number of valid evidence families opposing an existing long-term memory reaches the minimum evidence family threshold for the corresponding type, the long-term memory state is marked as deactivated; if a new supporting evidence family also reaches the threshold, a new long-term memory version is generated; otherwise, only conflicting evidence is recorded without changing the original long-term memory state.

[0067] At time 2, task C generates new evidence E7. Evidence record E7 shares the same workspace identifier, memory topic identifier, memory type, and scope of application as candidate-1. Therefore, candidate-1, which is in a pending state, is found, and evidence record E7 is added to the evidence identifier list of candidate-1. After processing through S2 to S4, evidence record E7 forms a new evidence family-C. S4 is re-executed. At this point, evidence families-A and-C originate from different root task identifiers and both meet the step requirements of procedural memory, reaching the required number of independent evidence families. Therefore, candidate-1 is checked, written into long-term memory, and its candidate state is updated to "promoted".

[0068] It should be noted that if candidate-1 has already been written into long-term memory before evidence record E7 arrives, then evidence record E7 is only added to that long-term memory as new supplementary evidence and does not belong to the automatic re-judgment of candidates that have failed.

[0069] It should also be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. For example, in an alternative embodiment, the minimum number of evidence families or the minimum number of tasks in each type of rule can be set to different values ​​according to the actual application scenario. You can choose 1, 2, or 3; You can choose 2, 3, or 5; You can choose 2, 3, or higher; Two or three values ​​can be selected. In another alternative implementation, the normalization of root operation identifiers and root task identifiers can be achieved by removing leading and trailing whitespace, standardizing capitalization, and using standardized encoding to improve the stability of root identifier matching. In yet another alternative implementation, the action code matching of procedural memory can establish a synonymous action mapping table, mapping action names with the same semantics but different spellings to the same action code. In yet another alternative implementation, the selection of the representative record of the evidence family can be based on the latest occurrence time or the highest confidence level when multiple successful records exist. In yet another alternative implementation, the timeliness of direct evidence can be set with an expiration threshold; direct evidence exceeding the expiration date automatically becomes invalid and no longer participates in the direct evidence channel judgment. In yet another alternative implementation, records with conflicting or invalid genealogical status can also be retained in the evidence set for auditing, but they do not participate in evidence family division and promotion qualification determination.

[0070] Example 2: like Figure 2 As shown in the figure, an agent memory promotion system based on evidence spectrum compression and memory type adaptation according to an embodiment of the present invention includes the following: Candidate memory generation module, lineage compression module, promotion determination module, and long-term memory writing module; The candidate memory generation module is used to obtain termination evidence records, match or create candidate memories based on workspace identifier, memory topic identifier and memory type, and collect a set of related evidence records; The genealogy compression module is used to perform source verification on the set of related evidence records, determine the genealogy status, root type and root identifier of each record, classify records with valid genealogy status into evidence families according to the same root identifier, and select representative records from each evidence family to form an independent evidence set. The promotion determination module is based on an independent evidence set. It checks the sufficiency and consistency of direct and repeated evidence according to the memory type of the candidate memory to obtain the promotion determination result. The long-term memory writing module is based on the promotion determination result. When the promotion determination result is passed, the candidate memory content is written into the long-term memory, and the mapping relationship between the long-term memory and the evidence family and representative records is saved.

[0071] Example 3: This embodiment provides an electronic device, including: a processor and a memory, wherein the memory stores a computer program that can be called by the processor; The processor executes the aforementioned agent memory promotion method based on evidence spectrum compression and memory type adaptation by calling computer programs stored in memory.

[0072] The electronic device can vary considerably depending on its configuration or performance. It may include one or more Central Processing Units (CPUs) and one or more memories, wherein the memory stores at least one computer program, which is loaded and executed by the processor to implement the agent memory promotion method based on evidence lineage compression and memory type adaptation provided in the above-described embodiment. The electronic device may also include other components for implementing its functions; for example, it may have wired or wireless network interfaces and input / output interfaces for data input and output. Details will not be elaborated upon in this embodiment.

[0073] Example 4: This embodiment proposes a computer-readable storage medium on which an erasable and rewritable computer program is stored. When a computer program runs on a computer device, it causes the computer device to execute the aforementioned agent memory promotion method based on evidence spectrum compression and memory type adaptation.

[0074] For example, computer-readable storage media can be read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage devices.

[0075] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0076] It should be understood that determining B based on A does not mean determining B solely based on A; it also means determining B based on A and / or other information.

[0077] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0078] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for agent memory promotion based on evidence spectrum compression and memory type adaptation, characterized in that, The method includes the following: Obtain termination evidence records, match or create candidate memories based on workspace identifiers, memory theme identifiers, and memory types, and collect a set of related evidence records; The source of the associated evidence record set is verified to determine the lineage status, root type and root identifier of each record. Records with valid lineage status are grouped into evidence families according to the same root identifier, and representative records are selected from each evidence family to form an independent evidence set. Based on an independent set of evidence, the sufficiency and consistency of direct and repeated evidence are examined according to the memory type of the candidate memory to obtain the promotion determination result. Based on the promotion determination result, when the promotion determination result is passed, the candidate memory content is written into the long-term memory, and the mapping relationship between the long-term memory and the evidence family and representative records is preserved.

2. The agent memory promotion method based on evidence spectrum compression and memory type adaptation according to claim 1, characterized in that, The collection of related evidence records includes: starting from the termination evidence record, searching forward along the parent evidence identifier to find the parent record chain, and querying the derived record whose parent evidence identifier points to the current record and whose relationship type is derived, and using the parent record chain and the derived record together as the related evidence record set.

3. The agent memory promotion method based on evidence spectrum compression and memory type adaptation according to claim 2, characterized in that, The source verification includes: tracing back each evidence record along its parent evidence identifier level by level to detect missing parent records and loops in the parent record chain; collecting root operation identifiers in the current record and its parent record chain; when all non-empty root operation identifiers have the same value, the value is used as the root identifier, the root type is recorded as the operation, and the lineage status is recorded as valid; when there are multiple different root operation identifiers, they are recorded as conflict; when there are no root operation identifiers, root task identifiers are collected and the root type and root identifier are determined according to the same rules.

4. The agent memory promotion method based on evidence spectrum compression and memory type adaptation according to claim 3, characterized in that, The step of grouping valid records of the genealogy status into evidence families according to the same root identifier includes: generating evidence family identifiers by performing a hash operation after concatenating the workspace identifier, memory topic identifier, root type and root identifier, and grouping valid records that share the same root identifier into the same evidence family.

5. The agent memory promotion method based on evidence spectrum compression and memory type adaptation according to claim 4, characterized in that, The selection of representative records from each evidence family includes: prioritizing the record with a successful execution status and the latest occurrence time; if there is no successful record, selecting the failed record with the latest occurrence time and no subsequent retry relationship; if only a derived summary exists, selecting the derived summary and marking it as a derived representative, and when the derived representative does not contain an action sequence, tracing back along the parent evidence identifier to the most recent original execution record for process step matching.

6. The agent memory promotion method based on evidence spectrum compression and memory type adaptation according to claim 5, characterized in that, The process of checking the sufficiency and consistency of direct and duplicate evidence includes: obtaining currently valid direct evidence based on the memory subject identifier and scope of application of the candidate memory; checking its version, effective time, and scope of application; when valid direct evidence exists, marking the direct evidence channel as support, opposition, or conflict based on the consistency between the direct evidence and the candidate memory content; when no valid direct evidence exists, counting the number of supporters and opponents based on the minimum number of independent evidence families or the minimum number of independent tasks corresponding to the memory type, and marking the duplicate evidence channel as support, opposition, conflict, or insufficient evidence; and outputting the promotion determination result according to the direct evidence priority adjudication rule.

7. The agent memory promotion method based on evidence spectrum compression and memory type adaptation according to claim 6, characterized in that, When the candidate memory is of process type, the process also includes: generating necessary step codes and required states according to the process rule table; performing ordered subsequence matching between the action sequence of each evidence family representative record and the necessary step codes; if all necessary steps can be found in the action sequence in order and the action codes and execution states are consistent, then the representative record is determined to support the candidate memory, otherwise it is opposed.

8. The agent memory promotion method based on evidence spectrum compression and memory type adaptation according to claim 6, characterized in that, The number of supporters and opponents is counted based on the minimum number of independent evidence families or the minimum number of independent tasks corresponding to the memory type. This includes: for factual, procedural, and strategic memories, the number of evidence families for supporters and opponents is counted; for preference-based memories, the number of independent tasks for supporters and opponents is counted. When the number of supporters reaches the minimum number of evidence families or the minimum number of tasks for the corresponding type and the number of opponents is less than the threshold, it is marked as support; when the number of opponents reaches the threshold and the number of supporters is less than the threshold, it is marked as opposition; when both sides reach the threshold, it is marked as conflict; otherwise, it is marked as insufficient evidence.

9. The agent memory promotion method based on evidence spectrum compression and memory type adaptation according to claim 8, characterized in that, When new evidence arrives, if there is an existing pending candidate memory with the same content, the new evidence will be added to that candidate memory and the source verification, evidence family division, and promotion determination will be re-executed. If there is an existing promoted candidate memory with the same content, when the new evidence supports the existing long-term memory, only the evidence family mapping will be added. When the new evidence opposes the existing long-term memory, it will be re-examined according to the ruling rule of priority of direct evidence, and a new version will be retained, deactivated, or generated based on the result.

10. An agent memory promotion system based on evidence spectrum compression and memory type adaptation, used to implement the agent memory promotion method based on evidence spectrum compression and memory type adaptation as described in any one of claims 1-9, characterized in that, The system includes the following modules: Candidate memory generation module, lineage compression module, promotion determination module, and long-term memory writing module; The candidate memory generation module is used to obtain termination evidence records, match or create candidate memories based on workspace identifier, memory topic identifier and memory type, and collect a set of related evidence records; The genealogy compression module is used to perform source verification on the set of related evidence records, determine the genealogy status, root type and root identifier of each record, classify records with valid genealogy status into evidence families according to the same root identifier, and select representative records from each evidence family to form an independent evidence set. The promotion determination module is based on an independent evidence set. It checks the sufficiency and consistency of direct and repeated evidence according to the memory type of the candidate memory to obtain the promotion determination result. The long-term memory writing module is based on the promotion determination result. When the promotion determination result is passed, the candidate memory content is written into the long-term memory, and the mapping relationship between the long-term memory and the evidence family and representative records is saved.