An agent memory data processing method and electronic equipment

By distinguishing the memory data through the main path and branch paths of the tree structure, and using parent-child edges and associated edges to represent the semantic relationships of the memory data, the problem of the agent's memory data change process not being recorded is solved, thus improving the accuracy and stability of the agent's decision-making.

CN123050569APending Publication Date: 2026-11-06LENOVO SOFTWARE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611184358.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-05
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing methods for processing memory data in intelligent agents cannot effectively reflect the changes in memory data, leading to decision-making errors, and they cannot separate reliable and unverified memory data.

Method used

The memory data is stored in a structure tree. The main path stores the memory data that meets the trust conditions, and the branch paths store the memory data to be verified. The access path of the target data is determined by semantic relationships, and the semantic relationships and evolution process of the memory data are represented by parent-child edges and associated edges.

Benefits of technology

It enables the complete recording of the evolutionary process of memory data, improves the accuracy and interpretability of agent decision-making, and ensures the stability and credibility of decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123050569A_ABST
    Figure CN123050569A_ABST
Patent Text Reader

Abstract

This application discloses a method and electronic device for processing intelligent agent memory data. The method involves obtaining target data, which represents the memory data of the intelligent agent to be processed. Based on the target data, at least one associated memory node is determined on the main path of a structure tree. The structure tree includes a main path and branch paths. Memory nodes on the main path are used to store the memory data of intelligent agents that meet trust conditions, while memory nodes on the branch paths are used to store the memory data of intelligent agents to be verified. According to the semantic relationship between the target data and the memory data in at least one associated memory node, a memory data update operation is performed on the structure tree to connect the target memory node corresponding to the target data to the main path or branch path. The memory data in the main path serves as the basis for the intelligent agent to provide feedback on task request information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method for processing intelligent agent memory data and an electronic device. Background Technology

[0002] To ensure a good user experience, intelligent agents need to store long-term memory data such as user preferences, task status, environmental facts, and behavioral patterns. Currently, vector databases, structured storage, or knowledge graphs are commonly used to store intelligent agent memory data.

[0003] However, agent memory data is constantly changing. The same piece of memory data may undergo multiple changes such as addition, supplementation, and correction. If structured storage is used to store agent memory data, the relationships between different stored memory data cannot be reflected, and the process of memory data change cannot be presented. If vector databases or knowledge graphs are used to store agent memory data, only the final form of each piece of memory data can be presented, and the process of change of each piece of memory data cannot be reflected. This leads to a lack of information when the agent makes decisions based on stored memory data, resulting in errors in the decision-making process due to the lack of information on the process of memory data change. Summary of the Invention

[0004] In view of this, this application provides a method for processing intelligent agent memory data and an electronic device, the specific solution of which is as follows: A method for processing intelligent agent memory data, comprising: Obtain target data, which represents the memory data of the agent to be processed; Based on the target data, at least one associated memory node is determined on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of agents that meet the trust conditions, and the memory nodes on the branch paths are used to store the memory data of agents to be verified. Based on the semantic relationship between the target data and the memory data in the at least one associated memory node, a memory data update operation is performed on the structure tree to connect the target memory node corresponding to the target data to the main path or the branch path, wherein the memory data in the main path is used as the basis for the agent to provide feedback on task request information.

[0005] An electronic device, comprising: Memory, used to store computer programs; A processor is configured to execute the computer program to enable the electronic device to perform the following steps: Obtain target data, which represents the memory data of the agent to be processed; Based on the target data, at least one associated memory node is determined on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of agents that meet the trust conditions, and the memory nodes on the branch paths are used to store the memory data of agents to be verified. Based on the semantic relationship between the target data and the memory data in the at least one associated memory node, a memory data update operation is performed on the structure tree to connect the target memory node corresponding to the target data to the main path or the branch path, wherein the memory data in the main path is used as the basis for the agent to provide feedback on task request information. Attached Figure Description

[0006] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0007] Figure 1 This is a flowchart of an intelligent agent memory data processing method disclosed in an embodiment of this application; Figure 2 This is a flowchart of an intelligent agent memory data processing method disclosed in an embodiment of this application; Figure 3a This is a schematic diagram of the main path of a tree structure disclosed in an embodiment of this application; Figure 3b This is a schematic diagram of the main path of a tree structure for accessing a target memory node, as disclosed in an embodiment of this application. Figure 4 This is a flowchart of an intelligent agent memory data processing method disclosed in an embodiment of this application; Figure 5 This is a flowchart of an intelligent agent memory data processing method disclosed in an embodiment of this application; Figure 6 This is a flowchart of an intelligent agent memory data processing method disclosed in an embodiment of this application; Figure 7 This is a flowchart of an intelligent agent memory data processing method disclosed in an embodiment of this application; Figure 8a This is a schematic diagram illustrating the presence of erroneous data in a memory node along a path, as disclosed in an embodiment of this application. Figure 8b This is a schematic diagram illustrating the presence of erroneous data in a memory node along a path, as disclosed in an embodiment of this application. Figure 9 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of an intelligent agent memory data processing device disclosed in an embodiment of this application. Detailed Implementation

[0008] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0009] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0010] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0011] This application discloses a method for processing intelligent agent memory data, the flowchart of which is shown below. Figure 1 As shown, it includes: Step S11: Obtain target data, which represents the memory data of the agent to be processed; Step S12: Based on the target data, determine at least one related memory node on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of the agent that meets the trust conditions, and the memory nodes on the branch paths are used to store the memory data of the agent to be verified. Step S13: Based on the semantic relationship between the target data and the memory data in at least one associated memory node, perform a memory data update operation on the structure tree to connect the target memory node corresponding to the target data to the main path or branch path. The memory data in the main path is used as the basis for the agent to provide feedback on task request information.

[0012] If the memory data of an intelligent agent is stored in a vector database, structured storage, or knowledge graph, it can only present the final form of each memory data and cannot reflect the change process between different memory data. As a result, when making decisions based on the stored memory data, the lack of information due to the lack of the change process of the memory data may lead to errors in the decisions made by the intelligent agent.

[0013] A pre-constructed structure tree for storing the agent's memory data is used. This structure tree includes a main path and branch paths. Memory nodes on the main path store the agent's memory data that meets the trust criteria. The memory data on the main path serves as the primary basis for the agent's decision-making and response, ensuring the accuracy of the agent's decisions and responses. Memory data that meets the trust criteria refers to memory data that the system considers reliable and stable. Specifically, memory data that meets the trust criteria can be at least one of the following: reliable data source, high confidence level, and high certainty. Memory nodes on branch paths store the agent's memory data to be verified. The memory data on branch paths will not affect the agent's decisions and responses until verification is successful.

[0014] During the operation of the intelligent agent, target data is acquired. Target data represents the memory data of the intelligent agent to be processed; that is, target data is the memory data that needs to be stored in the structure tree. Target data can be obtained in different ways, such as: during the interaction between the user and the intelligent agent, if the user's input contains new information, the intelligent agent can extract information from the dialogue context during the interaction to obtain the target data. For example, if the user says "I have recently started learning the piano," the intelligent agent will obtain "The user has recently started learning the piano" based on this statement and use the obtained statement "The user has recently started learning the piano" as the target data. Alternatively, the target data can come from the intelligent agent's own reasoning results; that is, during the execution of the task, the intelligent agent generates new conclusions through reasoning, and these conclusions are then identified as target data. Furthermore, the target data can be provided by the results of tool calls or external environmental events; that is, the results obtained by the intelligent agent from calling external tools or the detected changes in the external environment can all serve as target data.

[0015] After obtaining the target data, at least one associated memory node related to the target data is determined from the main path of the structure tree. The target data can be compared or matched with the memory data stored in each memory node on the main path to determine whether there is a memory node related to the target data on the main path. If there is, the memory node related to the target data on the main path is determined as an associated memory node.

[0016] For example: There are 3 memory nodes on the main path, and the memory data corresponding to the 3 memory nodes are: the user likes coffee, the user works in algorithm research, and the user's residence is location 'a'. The target data is: the user recently started learning piano. Then, the target data is matched with the memory data in each memory node on the main path to determine that there is no associated memory node on the main path related to the target data. If the target data is: the user's current residence is location 'b', then the target data is matched with the memory data in each memory node on the main path to determine that there is an associated memory node on the main path related to the target data. The memory data corresponding to this associated memory node is: the user's residence is location 'a'.

[0017] Among them, the associated memory node related to the target data determined on the main path of the structure tree can be one or more.

[0018] After identifying the associated memory nodes, the memory data of the structure tree is updated based on the semantic relationship between the target data and the memory data in at least one associated memory node, so as to connect the target memory node corresponding to the target data to the main path or branch path. Here, semantic relationship refers to the association between the semantic content of the target data and the semantic content of the memory data in the associated memory node. The semantic relationship can be determined in various ways, such as by calculating the semantic similarity between the target data and the memory data in the associated memory node, or by using a large language model to perform semantic understanding and relationship classification on the target data and the memory data of the associated memory node to determine the semantic relationship. Of course, other methods can also be used to determine the semantic relationship, and no specific limitations are made here.

[0019] Depending on the semantic relationship, the target memory node corresponding to the target data can be connected to different positions in the structure tree.

[0020] If, based on semantic relationships, the target data is determined to be reliable memory data relative to the memory data in the associated memory nodes, then the target memory node corresponding to the target data is connected to the main path of the structure tree; if, based on semantic relationships, the target data is determined to be unverified memory data relative to the memory data in the associated memory nodes, then the target memory node corresponding to the target data is connected to the branch path of the structure tree.

[0021] The agent memory data processing method disclosed in this embodiment uses a structure tree that includes a main path and branch paths. Memory nodes on the main path store the memory data of agents that meet the trust conditions, while memory nodes on the branch paths store the memory data of agents to be verified. After obtaining the target data, associated memory nodes related to the target data are determined on the main path of the structure tree. Based on the semantic relationship between the target data and the memory data in the associated memory nodes, the target memory node corresponding to the target data is connected to the main path or branch path. Based on the path-oriented and hierarchical characteristics of the structure tree, when a target memory node is connected, the connection position reflects the semantic relationship and trust status between the target data and existing memory data, and can present the change process of the memory data through the connection relationships in the structure tree. Furthermore, when the agent makes decisions based on the memory data stored in the structure tree, it can trace the source based on the structure tree, improving the accuracy and interpretability of the agent's decisions.

[0022] In addition, by distinguishing between the main path and the branch path, the isolation between the memory data that meets the trust conditions and the memory data to be verified is achieved. When the agent provides feedback on task request information, it does so based on the memory data in the main path, which ensures the stability and trustworthiness of the agent's response.

[0023] Furthermore, in the intelligent agent memory data processing method disclosed in this embodiment, the intelligent agent's memory data is stored through a structure tree. In addition to the main path and branch paths, the structure tree also includes: edges connecting memory nodes. The edges include parent-child edges and associated edges. Parent-child edges are used to characterize the semantic relationship between memory data in memory nodes with parent-child evolutionary relationship. Associated edges are used to characterize the semantic relationship between memory data in memory nodes with associated relationship. Associated edges are different from parent-child edges.

[0024] The structure tree consists of nodes and edges. Edges include parent-child edges and associative edges. Associative edges differ from parent-child edges. Parent-child edges and associative edges represent different semantic relationships between memory data in different memory nodes within the structure tree. Specifically, the parent-child evolutionary relationship between memory data in different memory nodes can be represented by parent-child edges. This parent-child evolutionary relationship refers to a semantic change between the memory data in the parent node and the memory data in the child node. For example, the memory data in one memory node might represent a temporal progression, semantic refinement, logical coexistence, or semantic substitution of the memory data in another memory node. In such cases, parent-child edges can connect the two memory nodes. Regarding the relationship between memory data in different memory nodes... Associations can be represented by association edges. An association refers to a semantic relationship between memory data in two memory nodes, where the semantic relationship does not belong to a parent-child evolution relationship, or it has not yet been verified whether it belongs to a parent-child evolution relationship. For example, there is an uncertain association between the memory data to be verified on the branch path and the memory data in the associated memory node on the main path. In this case, an association edge can be used to connect the memory node corresponding to the memory data to be verified and the associated memory node. Alternatively, there may be a rollback association between the memory data in two memory nodes, that is, the memory data in one memory node can be undone by the memory data in the other memory node. In this case, an association edge can be used to connect the two memory nodes.

[0025] The evolutionary relationship between father and son can include: temporal evolution, scope refinement, no conflict, and direct contradiction.

[0026] In this context, temporal evolution refers to two sets of memory data describing the same fact or theme at different points in time. In this case, the two sets of memory data represent a parent-child evolutionary relationship in terms of temporal evolution. For example, memory data 1 states that the user usually drinks coffee in the afternoon, while memory data 2 states that the user recently changed to drinking coffee only in the morning due to sleep reasons. Memory data 1 and memory data 2 describe when coffee is drunk, and there is a temporal progression between memory data 1 and memory data 2. Therefore, memory data 1 and memory data 2 represent a parent-child evolutionary relationship in terms of temporal evolution. Scope refinement refers to the further limitation, refinement, or specification of one piece of memory data by another. Scope refinement can include adding more specific information such as objects, scenarios, conditions, time, and degree of preference within the semantic scope of one piece of memory data to make the expression of the memory data more precise and specific. For example, memory data 3 states that the user likes sports, and memory data 4 states that the user likes running and swimming. Both memory data 3 and memory data 4 express the user's preference for sports. However, memory data 4 refines sports to running and swimming, so memory data 4 is a refinement of memory data 3. The relationship between memory data 3 and memory data 4 is a scope refinement in a parent-child evolutionary relationship. Conflict-free means that two memory data are not semantically exclusive and can coexist logically. This can be two memory data involving the same or related topics, but describing different dimensions. Logically, they can both be true and do not exclude each other. For example, memory data 5 is: the user likes coffee, and memory data 6 is: the user avoids consuming caffeine at night. Both memory data 5 and memory data 6 involve the user drinking coffee, but they do not conflict and can coexist. Therefore, memory data 5 and memory data 6 are in a conflict-free parent-child evolutionary relationship. A direct contradiction is when two pieces of memory data are logically mutually exclusive and cannot be true at the same time. For example, the statement that a user likes coffee and the statement that a user dislikes coffee are contradictory and cannot be true at the same time. Therefore, these two pieces of memory data represent a direct contradiction in the parent-child evolutionary relationship.

[0027] Relationships can include: uncertain relationships, rollback relationships, and source reference relationships.

[0028] Among them, uncertain associations, that is, the relationship between two memory data has not been verified, that is, it is uncertain whether the relationship between the two memory data is a parent-child evolutionary relationship, a rollback relationship, or a source reference relationship. For example, memory data 7 is: the user likes coffee, and memory data 8 is: the user may have recently reduced his coffee intake. There is a semantic relationship between memory data 7 and memory data 8, but memory data 8 contains the uncertain word "maybe". Therefore, the relationship between memory data 8 and memory data 7 still needs to be verified and is an uncertain association. The rollback association is the process of reversing one piece of memory data through another. For example, if memory data 9 states that the user does not like coffee, and it is later determined that memory data 9 is incorrect, then a rollback node is generated. The data in this rollback node is used to reverse the impact of memory data 9. The relationship between the data in the rollback node and memory data 9 is the rollback association. This embodiment uses parent-child edges to accurately represent the parent-child evolution relationship between memory data in memory nodes. Parent-child edges clarify the progression between two memory nodes connected by the parent-child edge, that is, there is a parent-to-child relationship between the memory data in the parent node and the memory data in the child node. This allows the memory nodes on the main path of the tree structure to be connected sequentially according to the parent-child relationship, forming a complete evolution process from the root node to the current end node. When the agent traces along the main path, it can obtain the complete evolution process of the memory data from the initial state to the current state. This provides the agent with a complete evolution process of the memory data to provide feedback on task request information, avoiding the problem of abnormal feedback on task request information due to the lack of memory data change process.

[0029] This embodiment discloses a method for processing intelligent agent memory data, the flowchart of which is as follows: Figure 2 As shown, it includes: Step S21: Obtain target data, which represents the memory data of the agent to be processed; Step S22: Based on the target data, determine at least one related memory node on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of the agent that meets the trust conditions, and the memory nodes on the branch paths are used to store the memory data of the agent to be verified. Step S23: In response to the semantic relation representation that there is a parent-child evolution relationship between the target data and the memory data in at least one associated memory node, the target memory node corresponding to the target data is connected to the tail position of at least one associated memory node through parent-child edges. The parent-child evolution relationship includes at least one of the following: time evolution, range refinement, no conflict, and direct contradiction. Step S24: Mark the state of the target memory node as a parent-child evolution type, and record at least one of the following information: parent node, change content, trigger source, and timestamp.

[0030] After determining at least one associated memory node related to the target data on the main path of the tree structure, it is necessary to determine the semantic relationship between the target data and the memory data in at least one associated memory node in order to perform the memory data update operation corresponding to the semantic relationship.

[0031] The determination of semantic relationships can be achieved by calculating the semantic similarity between the target data and the memory data in the associated memory nodes, and determining whether there is a parent-child evolutionary relationship between the target data and the memory data in the associated memory nodes based on the numerical range of the semantic similarity; alternatively, a large language model can be used to perform semantic understanding and relationship classification on the target data and the memory data in the associated memory nodes, thereby determining the semantic relationship between the target data and the memory data in the associated memory nodes. This is only an example of the possible ways to determine semantic relationships and is not intended to limit the scope of the discussion.

[0032] When the semantic relationship represents a parent-child evolutionary relationship between the target data and the memory data in the associated memory node, the target memory node corresponding to the target data is connected to the tail position of the associated memory node through the parent-child edge.

[0033] Specifically, we can first determine the position of the associated memory node in the structure tree. The associated memory node is a memory node on the main path. It may be located at the end of the main path or at a non-end position of the main path, that is, there are other child nodes after this node. The tail position of the associated memory node refers to the tail position extending along the parent-child edge after the associated memory node. Therefore, after determining the position of the associated memory node, we can determine the tail position of the associated memory node.

[0034] After determining the tail position of the associated memory node, the target memory node corresponding to the target data is connected to the tail position, and the target memory node and the associated memory node are connected by a parent-child edge, so that the associated memory node is the parent node and the target memory node is the child node, to represent that there is a parent-child evolutionary relationship between the target data in the target memory node and the memory data in the associated memory node.

[0035] Since the parent-child evolution relationship includes time evolution, scope refinement, no conflict, and direct contradiction, in addition to representing the parent-child evolution relationship between the target data and the memory data in the associated memory node through parent-child edges, the state of the target memory node can also be set, and the state of the target memory node can be marked as the parent-child evolution type. This parent-child evolution type indicates that the target memory node is connected to the tree structure through the parent-child evolution relationship.

[0036] Each memory node needs to be marked with its state when it is connected to the structure tree. The state of each memory node can be stored in the data structure of that memory node as an attribute field of that memory node.

[0037] In addition, for target memory nodes with a parent-child evolutionary state, it is also necessary to record at least one of the following information: parent node, changed content, trigger source, and timestamp, so that the source of the target data can be traced.

[0038] The system records the parent node of the target memory node to trace its origin and evolution path. For example, node a's parent node is node b, node b's parent node is node c, and node c's parent node is node d. By recording the parent node of each node, the source of the memory data in that node is clear and explicit. The change content refers to the changes in the target data relative to the memory data in its parent node, preserving the parent-child evolution process between the two nodes. When it is necessary to understand how a piece of memory data changed from the previous state, specific information can be obtained through the change content. For example, if the target data is a supplement to the memory data in the parent node, the change content can be recorded as "supplement," or the change content can be recorded as the specific supplementary content of the target data relative to the memory data in the parent node. The trigger source is the reason or source that caused this memory data update operation, such as user input, agent inference results, tool call results, or external environmental events. Recording the trigger source can also be used to trace the source of the memory data. The timestamp refers to the time when this memory data update operation occurred, used to trace the time information of the memory data.

[0039] You can set corresponding fields in the data structure of the target memory node to record at least one of the following information: parent node, changed content, trigger source, and timestamp. For example, you can set a parent node identifier field, a changed content field, a trigger source field, and a timestamp field.

[0040] like Figure 3a The diagram shows a schematic of the main path of a tree structure, including memory node A, which is the parent node and has two child nodes, B1 and B2. Memory node B1 is the parent node and has one child node, C1. Memory node B2 has two child nodes, C2 and C3. Memory node C1 has two child nodes, D1 and D2. Memory node C3 has one child node, D3. The target data is: users prefer Americano coffee. Based on this target data, relevant associated memory nodes are determined from the main path of the tree structure. The memory data in memory node D3 is: users like coffee. The semantic relationship between the target data and the memory data in memory D3 is determined to be a parent-child evolutionary relationship. To refine the scope of the parent-child evolutionary relationship, memory node D3 can be used as the parent node, and the target memory node E1 corresponding to the target data can be connected to the tail position of memory node D3 through a parent-child edge. Figure 3b The diagram shows the main path of the tree structure for accessing the target memory node. The state of the target memory node E1 is marked as the parent-child evolution type, and at least one of the following information is recorded: parent node: memory node D3, change content: range refinement, trigger source: user input, timestamp is the current time, such as: 10:23 on March 15, 2026.

[0041] The intelligent agent memory data processing method disclosed in this embodiment, when there is a parent-child evolution relationship between the target data representing the semantic relationship and the memory data in at least one associated memory node, connects the target memory node corresponding to the target data to the tail position of at least one associated memory node through the parent-child edge, marks the state of the target memory node as the parent-child evolution type, and records at least one piece of information among the parent node, the changed content, the trigger source, and the timestamp. This scheme clarifies the parent-child evolutionary relationship between the target memory node and at least one associated memory node in the structure tree through parent-child edges. This ensures that each parent-child edge on the main path of the structure tree represents a parent-child evolutionary relationship between two adjacent memory nodes via the parent-child edge. This guarantees that when the agent responds to task request information, it can obtain the complete semantic evolution process of the relevant memory data along the parent-child edges on the main path, avoiding the problem of abnormal feedback of task request information due to the evolution process not being recorded. In addition, by marking the parent-child evolution type of the memory node by state, it is realized that the memory node is accessed into the structure tree based on the parent-child evolutionary relationship through the state. Furthermore, by recording at least one piece of information among the parent node, changed content, trigger source, and timestamp, the memory data in each memory node in the structure tree can be traced through the recorded information, further ensuring the recording of the evolution process of the memory data.

[0042] This embodiment discloses a method for processing intelligent agent memory data, such as Figure 4 As shown, it includes: Step S41: Obtain target data, which represents the memory data of the agent to be processed; Step S42: Based on the target data, determine at least one related memory node on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of the agent that meets the trust conditions, and the memory nodes on the branch paths are used to store the memory data of the agent to be verified. Step S43: In response to the semantic relation representation that there is an uncertain association between the target data and the memory data in at least one associated memory node, the target memory node corresponding to the target data is connected to the branch path of at least one associated memory node through the associated edge; Step S44: Mark the state of the target memory node as a type to be verified, and record at least one piece of information from the trigger source and timestamp.

[0043] Semantic relationships include parent-child evolutionary relationships and association relationships. Association relationships include various types, one of which is an indeterminate association relationship. That is, it can be determined that two target data are related, but the specific type of relationship cannot be determined. Therefore, it can be identified as an indeterminate association relationship.

[0044] Among these, uncertain associations can be categorized as follows: when semantic similarity calculations or large language models are used to classify the relationship between the target data and the memory data in the associated memory nodes, and the output cannot be clearly classified as a parent-child evolutionary relationship, then it is judged as an uncertain association; or, when the target data contains words indicating uncertainty, such as: possibly, probably, seems, appears, perhaps, etc., indicating that the credibility of the target data itself is low or needs further confirmation, then it is judged that there is an uncertain association between the target data and the memory data of the associated memory nodes; or, when the target data comes from a low-credibility source, such as: from unverified external information, from unreliable sources... When there is a call result or an inference result from an agent with low confidence, it is determined that there is an uncertain association between the target data and the memory data of the associated memory node; or, when there is a potential contradiction or conflict between the target data and the memory data in the associated memory node in semantics, but the confidence of the target data is insufficient to support it as a basis for replacing or correcting existing memories, it is determined to be an uncertain association; or, for the update of experimental memory data based on a certain hypothesis, the update of the experimental memory data is to verify whether the hypothesis is valid, therefore, the experimental memory data is also determined to have an uncertain association with the memory data in the associated memory node.

[0045] Specifically, after obtaining the target data, it is determined that there is at least one associated memory node related to the target data on the main path of the structure tree. Then, the semantic relationship between the target data and the memory data in the at least one associated memory node is determined. If the semantic relationship indicates that there is an uncertain association between the target data and the memory data in the at least one associated memory node, the target memory node corresponding to the target data is connected to the branch path of the at least one associated memory node through the associated edge.

[0046] A branch path is a path derived from a memory node in the main path and used to store memory data to be verified. The difference between a branch path and the main path is that the memory nodes in the main path are used to store memory data that meets the trust conditions, while the memory nodes in the branch path are used to store memory data to be verified. The memory data in the branch path will not affect the retrieval results of the main path and the decision basis of the agent until the verification is passed, thereby avoiding the impact of uncertain information on the agent's feedback task request information.

[0047] A branch path is a secondary path derived from an associated memory node. Therefore, the root node of a branch path is connected to the associated memory node via an associated edge. This associated edge represents the semantic relationship between memory data in associated memory nodes. This associated edge differs from a parent-child edge; the associated edge between the root node of the branch path and the associated memory node represents the parent-child evolution relationship to be verified. The target memory node corresponding to the target data is then connected to this branch path. Specifically, if there is only a target memory node corresponding to the target data on the branch path, the target memory node is directly connected to at least one associated memory node on the branch path via an associated edge. If there are multiple memory nodes on the branch path, these multiple memory nodes are connected via associated edges. All multiple memory nodes on the branch path are memory nodes related to the associated memory nodes, and the memory data to be verified is from these nodes.

[0048] The state of the target memory node is marked as pending verification. Pending verification indicates that the memory data in the memory node has not yet been verified and must wait for verification before it can be determined whether the target data in the target memory node can be stored on the main path of the structure tree.

[0049] The state of a memory node can be stored in the data structure of that memory node as an attribute field of that memory node.

[0050] In addition, for target memory nodes in the "Unverified" state, at least one of the trigger source and timestamp needs to be recorded to ensure the traceability of the target data's origin. The trigger source is the reason or source that initiates this memory data update operation, such as user input, agent inference results, tool call results, or external environmental events. Recording the trigger source can also be used to trace the origin of the memory data. The timestamp refers to the time when this memory data update operation occurred, used to trace the time information of the memory data.

[0051] By setting corresponding fields in the data structure of the target memory node, at least one of the trigger source and timestamp information can be recorded, such as setting a trigger source field and a timestamp field. It should be noted that for target memory nodes in the "to be verified" state, only at least one of the trigger source and timestamp can be recorded when recording information. For the parent node and changed content, since the target memory node in the "to be verified" state is connected to other nodes through associated edges, it does not have a parent node and therefore does not have changed content relative to the memory data in the parent node. Therefore, only at least one of the trigger source and timestamp can be recorded. Alternatively, at least one of the changed content, trigger source, and timestamp can be recorded. In this case, the changed content is not the change in the target data in the target memory node relative to the memory data in the parent node, but rather the change in the target data in the target memory node relative to the memory data in the associated memory node.

[0052] The agent memory data processing method disclosed in this embodiment, when there is an uncertain association between the semantic relationship representing the target data and the memory data of at least one associated memory node, connects the target memory node corresponding to the target data to the branch path of at least one associated memory node through the association edge, instead of connecting it to the main path. The memory data to be verified is stored through the memory nodes on the branch path, so that this memory data will not affect the agent's decision. The structural isolation between the main path and the branch path isolates the reliable memory data and the memory data to be verified, ensuring that the memory data on which the agent makes decisions based on the main path is reliable, thus guaranteeing the accuracy of the decision. The state of the target memory node is marked as the type to be verified, clarifying that the target data in the target memory node is currently in the state to be verified, so as to facilitate the management of memory data in different states. Record at least one piece of information from the trigger source and timestamp, so that the source of the memory data to be verified is traceable, providing data basis for the verification of the memory data to be verified.

[0053] This embodiment discloses a method for processing intelligent agent memory data, the flowchart of which is as follows: Figure 5 As shown, it includes: Step S51: Obtain target data, which represents the memory data of the agent to be processed; Step S52: Based on the target data, determine at least one related memory node on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of the agent that meets the trust conditions, and the memory nodes on the branch paths are used to store the memory data of the agent to be verified. Step S53: In response to the semantic relation representation that there is an uncertain association between the target data and the memory data in at least one associated memory node, the target memory node corresponding to the target data is connected to the branch path of at least one associated memory node through the associated edge; Step S54: Mark the state of the target memory node as a type to be verified, and record at least one piece of information from the trigger source and timestamp; Step S55: Verify the parent-child evolutionary relationship of the target data; Step S56: In response to the target data meeting the verification conditions, merge the target memory node corresponding to the target data into the main path where at least one associated memory node is located through parent-child edges; Step S57: Mark the state of the merged target memory node as the merge type, and record at least one of the following information: parent node, changed content, trigger source, and timestamp.

[0054] The target data in the target memory node of the type to be verified on the branch path needs to be verified. Only when the verification is successful can the target data in the target memory node be stored on the main path, and the target data can participate in the retrieval of the main path and the decision-making of the agent.

[0055] During the verification process, the parent-child evolution relationship of the target data needs to be verified. The parent-child evolution relationship verification is to determine whether the target data meets the conditions for being stored in the main path, that is, to verify whether there is a parent-child evolution relationship between the target data and the memory data on the main path, and whether the confidence level of the target data reaches the condition of being credible.

[0056] The verification process of target data can be completed based on explicit user confirmation. That is, after the target memory node corresponding to the target data is connected to the branch path of at least one associated memory node, when the user interacts with the agent, if the information entered by the user explicitly indicates whether the target data is credible or untrustworthy, then it can be determined whether there is a parent-child evolutionary relationship between the target data and the memory data in at least one associated memory node. For example, if the target data is: "The user may have recently reduced his coffee intake", and in the subsequent interaction between the user and the agent, the user enters: "Yes, I have indeed been drinking less coffee recently", then the subsequent user input confirms the target data. At this time, it can be determined that the target data meets the verification conditions, indicating that there is a parent-child evolutionary relationship between the target data and the memory data in at least one associated memory node. Alternatively, it can be: the target data is verified based on the matching degree between the subsequently obtained factual data and the target data. If the same factual data as the target data is obtained in the subsequent interaction process, it indicates that the target data is credible. Based on this, it can be determined that there is a parent-child evolutionary relationship between the target data and the memory data in at least one associated memory node. Here, the factual data can be: memory data obtained by the agent from the outside to describe objective states, events or information. The facts can come from user input, agent reasoning results, data returned by tool calls or events perceived by the external environment, etc. Alternatively, it can be: based on the memory data that repeatedly appears and matches the target data in subsequent interactions, it is determined that the target data meets the verification conditions. When the same memory data is repeatedly extracted or confirmed in multiple interactions, it can be determined that the target data meets the verification conditions, and there is a parent-child evolution relationship between it and the memory data in at least one associated memory node. Alternatively, it can be: when the cumulative confidence of the target data reaches a certain threshold, it is determined that the target data meets the verification conditions. Each memory data has its own confidence. When the target data is accessed through the branch path, it carries a confidence data. Each time information related to the target data is obtained, the confidence data will increase. When the confidence data increases to reach a certain threshold, it is determined that the target data meets the verification conditions. Alternatively, the verification can be accomplished through external tools or databases. The agent can call external tools to verify the memory data in the branch path, and the verification results returned by the external tools can be used as the basis for verification. These external tools can be search engines, database queries, API calls, etc.

[0057] After successful verification, the target data is confirmed to meet the verification conditions. The target data can then be stored on the main path. Specifically, the target memory node corresponding to the target data is merged into the main path containing at least one associated memory node through parent-child edges. The parent-child evolution relationship between the merged target memory node and at least one associated memory node is clarified through the parent-child edges. The state of the merged target memory node is marked as the merge type, which clarifies that the merged target memory node was obtained by merging from the target memory node on the branch path. At least one piece of information, including the parent node, the changed content, the trigger source, and the timestamp, is recorded to make the source of the memory data in the merged target memory node traceable.

[0058] Specifically, merging the target memory node corresponding to the target data into the main path of at least one associated memory node can be done as follows: Based on the parent-child evolution relationship, a merging strategy is determined for the target data and the memory data of at least one associated memory node. The merging strategy includes at least one of the following: time evolution merging, range refinement merging, conditional coexistence merging, and coverage merging. After merging the target data and the memory data of at least one associated memory node according to the merging strategy, the merged data is obtained. The target memory node corresponding to the merged data is connected to the tail position of at least one associated memory node through parent-child edges.

[0059] The target data is stored in the branch path, and then the target data is verified. If the target data meets the verification conditions, it needs to be merged into the main path. During the merging process, the corresponding merging strategy needs to be determined based on the parent-child evolution relationship between the target data and the memory data in the associated memory node.

[0060] Different parent-child evolutionary relationships correspond to different merging strategies. These relationships can include: temporal evolution, scope refinement, no conflict, and direct contradiction. Correspondingly, the merging strategies can include: temporal evolution merging, scope refinement merging, conditional coexistence merging, and overlay merging. Specifically, temporal evolution corresponds to temporal evolution merging, scope refinement corresponds to scope refinement merging, no conflict corresponds to conditional coexistence merging, and direct contradiction corresponds to overlay merging. If the parent-child evolutionary relationship between the target data and the memory data in the associated memory node is only one type, then the determined merging strategy is also one type. If the parent-child evolutionary relationship between the target data and the memory data in the associated memory node is at least two types, then the determined merging strategy is also at least two types.

[0061] For time-evolutionary merging, the parent-child evolutionary relationship between the target data and the memory data in the associated memory node is time-evolutionary. The memory data in the associated memory node is valid in a certain time period, while the target data is valid in a subsequent time period, which is the period after the certain time period. The target data and the memory data in the associated memory node describe the same fact in different states at different points in time. After merging, the merged data is obtained. In the merged data, the memory data in the associated memory node is retained as historical data, and the target data is stored as current data in the main path. At the same time, the temporal relationship between the two is recorded.

[0062] For example, if the memory data in the associated memory node is: the user usually drinks coffee in the afternoon, and the target data is: the user recently changed to only drinking coffee in the morning due to sleep reasons, then according to the time evolution merging, after merging the target data with the memory data in the associated memory node, the merged data is: the user used to usually drink coffee in the afternoon; recently, due to sleep reasons, the user has adjusted to only drinking coffee in the morning and avoids consuming caffeine in the afternoon.

[0063] For range-refined merging, the parent-child evolution relationship between the target data and the memory data in the associated memory nodes is range-refined. In range-refined merging, the memory data in the associated memory nodes are still valid, but the target data provides more specific objects, scenarios, conditions, or degree of preference. During merging, the old memory is used as the basis, and the refined information or limiting conditions in the new memory are superimposed, so that the merging result retains the broad expression of the old memory and includes the specific limitations of the new memory, thereby determining the merged data.

[0064] For example, the memory data in the associated memory node is: the user likes coffee, and the target data is: the user prefers Americano coffee in the morning. By merging the target data with the memory data in the associated memory node according to the range refinement, the merged data is: the user likes coffee, and prefers Americano coffee in the morning scenario.

[0065] For conditional coexistence merging, the parent-child evolution relationship between the target data and the memory data in the associated memory node is conflict-free. At this time, there is no direct contradiction between the two memories, nor is it a simple range refinement or time evolution relationship. Instead, they are valid under different conditions. In conditional coexistence merging, merged data with conditional constraints is generated, allowing multiple memories to coexist in different contexts. During merging, the validity of each memory is preserved, and corresponding conditional constraints are added to them.

[0066] For example, the memory data in the associated memory node is: the user likes coffee, and the target data is: the user avoids consuming caffeine at night. By merging the target data with the memory data in the associated memory node according to the conditional coexistence method, the merged data is: the user may prefer coffee in the morning or during working hours, but avoids consuming caffeine at night.

[0067] For overlay merging, the parent-child evolution relationship between the target data and the memory data in the associated memory node is directly contradictory. In this case, the target data does not refine the scope, evolve the time, or supplement the conditions of the memory data in the associated memory node, but rather explicitly negates or replaces the memory data in the associated memory node. In overlay merging, the target data directly replaces the memory data in the associated memory node to become the currently valid memory data, i.e., merged data. During merging, the associated memory node is not directly deleted, but the original associated memory node is retained, and a new memory node is created. That is, the target memory node corresponding to the merged data is directly connected to the tail position of the associated memory node.

[0068] For example: The memory data in the associated memory node is: The user wants all technical documents to be in English. The target data is: The user explicitly states that the patent technical documents should be in Chinese. After merging the target data with the memory data in the associated memory node according to the overriding merging method, the merged data is: In the patent technical document scenario, the user prefers to use Chinese. The generalized expression "all technical documents are in English" in the memory data of the associated memory node is marked as corrected.

[0069] After generating the merged data, the target memory node corresponding to the merged data is connected to the tail position of the associated memory node through parent and child nodes, so that the target memory node corresponding to the merged data becomes a node on the main path, thereby completing the merging process.

[0070] In addition, after the merging is completed, the target memory nodes on the branch path can be directly deleted to reduce the amount of information on the branch path; or, the target memory nodes on the branch path can be retained, but the state of the target memory nodes on the branch path needs to be modified to mark them as target memory nodes that have been merged into the main path. In addition, the target memory nodes on the branch path and the target memory nodes on the main path can be connected by an association edge, which indicates that the target memory nodes on the main path were merged from the target memory nodes on the branch path.

[0071] The agent memory data processing method disclosed in this embodiment verifies the parent-child evolution relationship of the target memory node of the type to be verified, ensuring that only verified memory data can be stored on the main path of the structure tree, thereby ensuring the reliability of the memory data stored on the main path and avoiding the influence of unverified memory data on the agent's decision-making. In addition, when the target data meets the verification conditions, the target memory node corresponding to the target data is merged into the main path of at least one associated memory node through parent-child edges, clarifying the parent-child evolution relationship between the target data in the merged target memory node and the memory data in the associated memory nodes on the main path, and improving the evolution process of memory data on the main path. Secondly, by marking the state as a merge type and recording at least one of the following information: parent node, changed content, trigger source, and timestamp, the source of the memory data to be verified is traceable.

[0072] This embodiment discloses a method for processing intelligent agent memory data, the flowchart of which is as follows: Figure 6 As shown, it includes: Step S61: Obtain target data, which represents the memory data of the agent to be processed; Step S62: Based on the target data, determine that there are no memory nodes related to the target data on the main path of the structure tree, and connect the target memory node corresponding to the target data to the end position of the main path of the structure tree. Step S63: Mark the state of the target memory node as a new type and record at least one piece of information from the trigger source and timestamp.

[0073] After obtaining the target data, it is necessary to determine whether there are any associated memory nodes related to the target data on the main path of the structure tree. Determining associated memory nodes can be specifically done by: semantically matching the target data with the memory data stored in each memory node on the main path to determine whether there are any memory nodes on the main path that are semantically related to the target data. If, after semantically matching the target data with the memory data of each memory node on the main path, no memory nodes semantically related to the target data are found, or if the semantic similarity between all memory nodes on the main path and the target data is lower than a preset threshold, then it can be determined that there are no associated memory nodes related to the target data on the main path of the structure tree. Therefore, it can be determined that the agent has not previously stored memory data that is semantically related to the target data, and the target data is a completely new set of memory data unrelated to the memory data on the main path.

[0074] For example, the memory data stored on the main path of the tree structure includes: the user likes coffee, the user uses the Python programming language, the user is engaged in algorithm research, etc. The target data is: the user recently started learning the piano. After semantically matching the target data with the memory data on the main path, it is found that there is no memory data related to learning the piano on the main path. Therefore, it is determined that there are no associated memory nodes related to the target data on the main path of the tree structure.

[0075] When it is determined that there are no associated memory nodes related to the target data on the main path, the target memory node corresponding to the target data is connected to the end position of the main path of the structure tree. First, the end position of the main path of the structure tree is determined. The main path is a backbone link formed by the memory nodes connected sequentially through parent and child edges, starting from the root node and extending to the latest memory node. The end position of the main path refers to the position after the last memory node on the main path, that is, the position where the main path can be expanded at present. Then, the target memory node corresponding to the target data is connected to this end position, and the state of the target memory node is marked as a new type. The new type indicates that the target data in the target memory node is not related to the memory data in other memory nodes.

[0076] Since the target data is newly added and unrelated to the memory data in other memory nodes, it has no parent node or changed content. Therefore, only at least one piece of information from the origin and timestamp of the target data is recorded. Correspondingly, because parent-child edges represent the semantic relationships between memory data in memory nodes with parent-child evolutionary relationships, and associative edges represent the semantic relationships between memory data in memory nodes with associative relationships, and the target data is also associated with other memory data on the main path, it is not necessary to connect the target memory node to any memory node on the main path through an edge.

[0077] The intelligent agent memory data processing method disclosed in this embodiment, when there is no associated memory node on the main path that is semantically related to the target data, connects the target memory node corresponding to the target data to the end position of the main path of the structure tree, so that the target data is stored as a new independent memory in the main path. In this way, the main path of the structure tree can be continuously expanded to store newly added independent memory data, while ensuring the structural integrity between existing memory nodes on the main path; the state of the target memory node is marked as a new type to indicate that the node is a memory node that is unrelated to existing memory nodes on the main path.

[0078] This embodiment discloses a method for processing intelligent agent memory data, the flowchart of which is as follows: Figure 7 As shown, it includes: Step S71: Obtain target data, which represents the memory data of the agent to be processed; Step S72: Based on the target data, determine at least one related memory node on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of the agent that meets the trust conditions, and the memory nodes on the branch paths are used to store the memory data of the agent to be verified. Step S73: Based on the semantic relationship between the target data and the memory data in at least one associated memory node, perform a memory data update operation on the structure tree to connect the target memory node corresponding to the target data to the main path or branch path. The memory data in the main path is used as the basis for the agent to provide feedback on task request information. Step S74: In response to determining that the memory data in the first memory node on the structure tree is erroneous data, a reverse change operation is determined based on the change between the memory data in the first memory node and the memory data in the second memory node. The second memory node is the parent node of the first memory node on the structure tree that is connected to the first memory node through a parent-child edge. Step S75: Connect the rollback node corresponding to the reverse change operation to the end of the main path where the first memory node is located through the associated edge; Step S76: Mark the state of the rollback node as a directed rollback type, wherein the reverse change operation in the rollback node can perform at least one of the following operations on the memory data in the first memory node: deletion, recovery, correction, and revocation.

[0079] Erroneous data refers to memory data that is inconsistent with the facts or incorrect due to certain reasons. The determination of erroneous memory can be as follows: It can be determined through user feedback, where the user actively reports to the agent that the memory data is incorrect when they find that the agent's feedback based on a certain memory data is inconsistent with the facts; it can also be determined by the agent's self-check, where the agent may find that a certain memory data in the tree structure contradicts other reliable memory data or is inconsistent with information in an external knowledge base, thus determining that the memory data is erroneous; or it can be determined based on external verification results, where the agent calls external tools or databases to verify a certain memory data, and the verification results returned by the external tools indicate that the memory data is incorrect, thus determining that the memory data is erroneous.

[0080] When the memory data in the first memory node of the structure tree is determined to be erroneous, the position of the first memory node in the structure tree is determined, and based on the position of the first memory node in the structure tree, the parent node of the first memory node is determined, that is, the second memory node is determined. Erroneous memory data may appear on the main path or on the branch path. This embodiment mainly focuses on processing erroneous data on the main path.

[0081] After determining the first memory node and the second memory node, the changes in the memory data in the first memory node relative to the memory data in the second memory node are obtained. Based on these changes, it can be determined what kind of changes have occurred in the memory data in the first memory node relative to the memory data in the second memory node. For example, changing "like coffee" to "dislike coffee", or adding a time condition such as "morning".

[0082] The reverse change operation is determined based on the content of the change. This is the inverse operation on the changed content, used to undo the changes introduced by the first memory node and restore the memory data on that path to the state corresponding to the second memory node. Different operation types of the first memory node will result in different types of reverse change operations. Specifically, if the operation type of the first memory node is merge (meaning the first memory node is merged into the main path's merge node after branch verification), the reverse change operation is to undo the merge result, i.e., to undo the memory data changes introduced by the merge node. If the operation type of the first memory node is modify (meaning the memory data in the first memory node modifies the memory data in the parent node), the reverse change operation is to restore the memory data in the first memory node to the memory data in the parent node. If the operation type of the first memory node is delete (meaning the memory data in the first memory node is a deletion operation on the memory data in the parent node), the reverse change operation is to restore the deleted memory data. If the operation type of the first memory node is add (meaning the memory data in the first memory node is independent information added based on the parent node), the reverse change operation is to delete that memory data.

[0083] The rollback node corresponding to the reverse change operation is connected to the end of the main path where the first memory node is located through the associated edge. By connecting the rollback node to the end of the main path, the rollback node becomes part of the main path. When the agent searches along the main path, the reverse change operation instruction in the rollback node will be executed, thereby logically canceling the erroneous change introduced by the first memory node and restoring the effective state of the main path to the state before the first memory node.

[0084] In addition, in the scheme disclosed in this embodiment, the reverse change operation can also be: the memory data of the second memory node, that is, the memory data of the second memory node is directly stored at the rollback node, which can also eliminate the impact of erroneous data.

[0085] It should be noted that, in this embodiment, determining erroneous data can be achieved as follows: whenever memory data is stored on the main path of the structure tree, it is determined whether the stored memory data is erroneous. This ensures that when erroneous data is present, it can be rolled back in a timely manner, thereby guaranteeing the accuracy of the data stored on the main path of the structure tree and preventing feedback errors when the agent provides feedback based on the main path of the structure tree. In this case, the first memory node is usually the end node of the path where the first memory node is located, and thus, the first memory node is the parent node of the rollback node. If the erroneous data includes not only the first memory node but also its parent node, i.e., the second memory node, and the parent node of the second memory node does not contain erroneous data, then the reverse change operation is jointly determined based on the change content 1 between the memory data in the parent node of the second memory node and the memory data of the second memory node, and the change content 2 between the memory data of the second memory node and the memory data of the first memory node. For example: Figure 8a As shown, it is determined that the memory data in memory nodes N3 and N2 is erroneous. The path of memory nodes N3 and N2 is: memory node N1 → memory node N2 → memory node N3. Then, the change content 1 of memory node N2 → memory node N3 is determined, and the change content 2 of memory node N1 → memory node N2 is determined. Based on change content 1 and change content 2, a reverse change operation is determined, and a rollback node is connected after memory node N3. The rollback node contains the reverse change operation. Through this path, when passing through the rollback node, the memory data returns to be the same as the memory data in memory node N1. Furthermore, if, during agent interaction, it is determined that the data in a memory node on the main path of the tree structure is erroneous, and this memory node is not the end node on that path, then it is necessary to determine the changes of the node corresponding to the erroneous data relative to its parent node. Simultaneously, for each node after the node corresponding to the erroneous data, it is also necessary to determine the changes of each node relative to its respective parent node. Based on these determined changes, a reverse change operation is determined to perform the reverse change operation on all nodes starting from the node corresponding to the erroneous data and continuing to all nodes thereafter. For example: Figure 8bAs shown, the path is: memory node N1 → memory node N2 → memory node N3 → memory node N4 → memory node N5. The data in memory node N3 is erroneous. The change content 1 of N3 relative to N2 is determined, the change content 2 of N4 relative to N3 is determined, and the change content 3 of N5 relative to N4 is determined. The reverse change operation is: undo change content 1, change content 2, and change content 3, and connect the rollback node corresponding to the reverse change operation to the end of memory node N5. Alternatively, it can be: determine the change content 1 of N3 relative to N2, determine the change content 2 of N4 relative to N3, determine the change content 3 of N5 relative to N4, then determine the change content 4 of N5 relative to N2 based on change content 1, change content 2, and change content 3, determine the reverse change operation based on change content 4, and connect the rollback node corresponding to the reverse change operation to the end of memory node N5.

[0086] The intelligent agent memory data processing method disclosed in this embodiment, when it is determined that the memory data stored in a memory node on the structure tree is erroneous, does not directly delete the erroneous node. Instead, it generates a reverse change operation based on the changes of the node relative to its parent node, and connects the rollback node corresponding to the reverse change operation to the end position of the main path through an associated edge. In this way, the impact of the erroneous data is undone, while the erroneous node itself and its historical records are preserved. Compared with the method of directly deleting the erroneous node, the rollback mechanism of this embodiment preserves complete historical data, which is convenient for subsequent tracing. In addition, by connecting the rollback node to the end position of the main path where the first memory node is located through an associated edge, the rollback node becomes part of the main path, so that all historical nodes on the main path are preserved, and the effective state of the main path is logically restored to the state before the erroneous data through the reverse change operation in the rollback node.

[0087] Furthermore, the intelligent agent memory data processing method disclosed in this embodiment may also include: Obtain task request information input to the agent; in response to the task request information, search in the materialized view corresponding to the main path to obtain target memory data, the materialized view is generated based on the memory data in the memory nodes on the main path; feed back task request information based on the target memory data; wherein, at least one of the following factors—length of the main path where the target memory data is located, trigger source, and timestamp information—influences the weight of the target memory data.

[0088] Task request information is a request from a user to an intelligent agent that requires the agent to process and provide feedback based on its stored memory data. It can originate from: dialogue between the user and the intelligent agent, where the user makes the request via text or voice input; it can also originate from an application system embedded within the intelligent agent, where the application system can send task request information to the intelligent agent, requesting it to perform a specific task based on its stored memory data; or it can be triggered proactively by the intelligent agent, where the agent can actively generate task request information under specific conditions, requesting the retrieval and analysis of its own stored memory data.

[0089] After obtaining the task request information, the agent needs to retrieve relevant memory data from the structure tree based on the task request information in order to generate feedback on the task request information. Specifically, since the structure tree includes the main path and branch paths, and the main path stores the memory data of agents that meet the trust conditions, while the branch paths store the memory data of agents to be verified, the memory data to be retrieved is the memory data on the main path.

[0090] Specifically, a materialized view can be formed by retrieval indexes generated from memory data in memory nodes along the main path. The materialized view differs from the structure tree itself. While the structure tree stores complete memory nodes and their evolutionary relationships, the materialized view is a data structure specifically designed for fast retrieval, generated after extracting memory data from the main path of the structure tree. The materialized view may include a vector index, which is an index structure formed by vectorizing the memory data in each memory node along the main path. It supports semantic retrieval based on vector similarity. When an agent needs to retrieve memory data related to task request information, it can convert the task request information into a query vector, and then perform similarity matching in the vector index to quickly recall target memory data semantically related to the task request information.

[0091] After obtaining the target memory data, the task request information is fed back based on the target memory data. The target memory data is used as the basis for generating the feedback content. Response data for the task request information is generated based on the target memory data and then output to the user or caller.

[0092] In this embodiment, when the agent obtains task request information, it performs a retrieval in the materialized view corresponding to the main path. This allows for the rapid retrieval of target memory data semantically related to the task request information. The materialized view is a retrieval index pre-generated based on the memory data in the memory nodes on the main path, which improves retrieval efficiency and significantly shortens the agent's response time. Furthermore, since the materialized view is generated only based on the memory data on the main path, the retrieval results only come from memory data that meets the trust conditions, avoiding interference from memory data to be verified on branch paths and ensuring the accuracy of the retrieval results.

[0093] In addition, the length of the main path where the target memory data is located, the trigger source, and the timestamp information are all factors that influence the weight of the target memory data.

[0094] The length of the main path refers to the number of nodes traversed from the root node of the tree structure to the target memory node. The longer the main path, the more evolutionary steps the target memory data has undergone, and its credibility and stability may be higher. Therefore, target memory data with a longer main path may have a higher reliance weight. The trigger source refers to the source from which the target memory data is generated. Different trigger sources have different credibility. For example, memory data from explicit user statements usually has high credibility, memory data from agent inference results has lower credibility, and the credibility of memory data from external tool calls depends on the reliability of the tool. The timestamp information refers to the generation time or most recent update time of the target memory data. Timestamp information can reflect the timeliness of memory data. For certain types of task requests, newer memory data may be more valuable than older memory data. For example, when a user asks where they currently live, the latest location information is more valuable than earlier location information. Therefore, the reliance weight of memory data with timestamps closer to the current time is greater than that of memory data with timestamps farther from the current time.

[0095] In practical applications, the length of the main path, the trigger source, and the timestamp information can be used individually or in combination to jointly affect the weight of the target memory data. For example, weight coefficients can be set for the length of the main path, the trigger source, and the timestamp information respectively, and the final weight of the target memory data can be calculated by comprehensively calculating them.

[0096] In the scheme disclosed in this embodiment, at least one of the following factors—the length of the main path containing the target memory data, the trigger source, and the timestamp information—influences the weight of the basis for the target memory data. The length of the main path reflects the number of evolutionary steps the memory data has undergone; a longer main path usually means that the memory data has undergone more verification and evolution, and its stability is higher. The trigger source reflects the origin of the memory data; different sources have different levels of credibility. The timestamp information reflects the timeliness of the memory data; newer memory data is more valuable in certain scenarios. By comprehensively considering the above factors and adjusting the basis weights, the agent can prioritize the use of more credible, stable, and timely memory data when providing feedback, thereby further improving the accuracy and reliability of the feedback.

[0097] This embodiment discloses an electronic device, the structural schematic diagram of which is shown below. Figure 9 As shown, it includes: Memory 91 and processor 92.

[0098] Among them, memory 91 is used to store computer programs; Processor 92 is used to execute computer programs to enable the electronic device to perform the following steps: Obtain target data, which represents the memory data of the agent to be processed; Based on the target data, at least one related memory node is identified on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of the agent that meets the trust conditions, and the memory nodes on the branch paths are used to store the memory data of the agent to be verified. Based on the semantic relationship between the target data and the memory data in at least one associated memory node, a memory data update operation is performed on the structure tree to connect the target memory node corresponding to the target data to the main path or branch path. The memory data in the main path is used as the basis for the agent to provide feedback on task request information.

[0099] The electronic device disclosed in this embodiment is implemented based on the intelligent agent memory data processing method disclosed in the above embodiments, and will not be described again here.

[0100] The electronic device disclosed in this embodiment stores the agent's memory data through memory nodes on a structure tree. Each newly added memory node in the structure tree is connected based on the semantic relationship between the memory data and the memory data in the existing associated memory nodes on the main path. This realizes the manifestation of the relationship between different memory data. Based on the path-oriented and hierarchical features of the structure tree, it can also present the change process between the interconnected memory data, rather than directly presenting the final form of the memory data. This allows the agent to trace the source when making decisions based on the memory data stored through the structure tree, thus improving the accuracy of the decision.

[0101] In addition, the structure tree includes a main path and branch paths. Memory nodes on the main path are used to store the memory data of agents that meet the trust conditions, while memory nodes on the branch paths are used to store the memory data of agents to be verified. This achieves isolation between the memory data that meets the trust conditions and the memory data to be verified. When an agent provides feedback on a task request, it does so based on the memory data in the main path, ensuring the stability and trustworthiness of the agent's response.

[0102] This embodiment discloses an intelligent agent memory data processing device, the structural schematic diagram of which is shown below. Figure 10 As shown, it includes: The data acquisition unit 101, the determination unit 102, and the data update unit 103 are all included.

[0103] The obtaining unit 101 is used to obtain target data, which represents the memory data of the agent to be processed; The determining unit 102 is used to determine at least one related memory node on the main path of the structure tree based on the target data. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of the agent that meets the trust condition, and the memory nodes on the branch paths are used to store the memory data of the agent to be verified. The data update unit 103 is used to perform a memory data update operation on the structure tree according to the semantic relationship between the target data and the memory data in the at least one associated memory node, so as to connect the target memory node corresponding to the target data to the main path or the branch path, wherein the memory data in the main path is used as the basis for the agent to provide feedback on task request information.

[0104] Furthermore, in the intelligent agent memory data processing device disclosed in this embodiment, the structure tree also includes edges connecting memory nodes. The edges include parent-child edges and associated edges. Parent-child edges are used to characterize the semantic relationship between memory data in memory nodes with parent-child evolutionary relationship, and associated edges are used to characterize the semantic relationship between memory data in memory nodes with associated relationship. Associated edges are different from parent-child edges.

[0105] Furthermore, the data update unit is used for: In response to the semantic relationship representing that there is a parent-child evolution relationship between the target data and the memory data in at least one associated memory node, the target memory node corresponding to the target data is connected to the tail position of at least one associated memory node through parent-child edges. The parent-child evolution relationship includes at least one of the following: time evolution, range refinement, no conflict, and direct contradiction. The state of the target memory node is marked as the parent-child evolution type, and at least one of the following information is recorded: parent node, change content, trigger source, and timestamp.

[0106] Furthermore, the data update unit is used for: In response to the semantic relationship representing that there is an uncertain association between the target data and the memory data of at least one associated memory node, the target memory node corresponding to the target data is connected to the branch path of at least one associated memory node through the association edge; the state of the target memory node is marked as a type to be verified, and at least one piece of information from the trigger source and timestamp is recorded.

[0107] Furthermore, the data update unit is also used for: Verify the parent-child evolution relationship of the target data; in response to the target data meeting the verification conditions, merge the target memory node corresponding to the target data into the main path of at least one associated memory node through parent-child edges; mark the state of the merged target memory node as the merge type, and record at least one of the following information: parent node, changed content, trigger source, and timestamp.

[0108] Furthermore, the data update unit is also used for: Based on the parent-child evolution relationship, a merging strategy is determined for the target data and the memory data of at least one associated memory node. The merging strategy includes at least one of the following: time evolution merging, range refinement merging, conditional coexistence merging, and coverage merging. After merging the target data and the memory data of at least one associated memory node according to the merging strategy, the merged data is obtained. The target memory node corresponding to the merged data is connected to the tail position of at least one associated memory node through parent-child edges.

[0109] Furthermore, the data update unit is also used for: If there is no associated memory node related to the target data on the main path of the tree structure, connect the target memory node corresponding to the target data to the end of the main path of the tree structure; mark the status of the target memory node as a new type, and record at least one of the trigger source and timestamp.

[0110] Furthermore, the intelligent agent memory data processing device disclosed in this embodiment may further include: A rollback unit is used to respond to determining that the memory data in the first memory node on the structure tree is erroneous data, and to determine a reverse change operation based on the changes between the memory data in the first memory node and the memory data in the second memory node, where the second memory node is the parent node of the first memory node connected to the first memory node on the structure tree via a parent-child edge; to connect the rollback node corresponding to the reverse change operation to the end position of the main path where the first memory node is located via an associated edge; and to mark the state of the rollback node as a directed rollback type, wherein the reverse change operation in the rollback node can perform at least one of the following operations on the memory data in the first memory node: deletion, restoration, correction, and reversal.

[0111] Furthermore, the intelligent agent memory data processing device disclosed in this embodiment may further include: The retrieval unit is used to obtain task request information input to the agent; in response to the task request information, it performs a retrieval in the materialized view corresponding to the main path to obtain target memory data, the materialized view being generated based on the memory data in the memory nodes on the main path; and it feeds back the task request information based on the target memory data; wherein, at least one of the following factors—the length of the main path where the target memory data is located, the trigger source, and the timestamp information—influences the weight of the target memory data.

[0112] The intelligent agent memory data processing device disclosed in this embodiment is based on the intelligent agent memory data processing method disclosed in the above embodiment, and will not be described again here.

[0113] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0114] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0115] In the above embodiments, the implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, in the form of a computer program product.

[0116] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A method for processing intelligent agent memory data, comprising: Obtain target data, which represents the memory data of the agent to be processed; Based on the target data, at least one associated memory node is determined on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of agents that meet the trust conditions, and the memory nodes on the branch paths are used to store the memory data of agents to be verified. Based on the semantic relationship between the target data and the memory data in the at least one associated memory node, a memory data update operation is performed on the structure tree to connect the target memory node corresponding to the target data to the main path or the branch path, wherein the memory data in the main path is used as the basis for the agent to provide feedback on task request information.

2. The method according to claim 1, wherein the structure tree further includes edges connecting memory nodes, the edges including parent-child edges and associated edges, the parent-child edges being used to characterize the semantic relationship between memory data in memory nodes with parent-child evolutionary relationship, the associated edges being used to characterize the semantic relationship between memory data in memory nodes with associated relationship, and the associated edges being different from the parent-child edges.

3. The method according to claim 1 or 2, wherein updating the memory data of the structure tree based on the semantic relationship between the target data and the memory data in the at least one associated memory node includes: In response to the semantic relationship characterizing that there is a parent-child evolutionary relationship between the target data and the memory data in the at least one associated memory node, the target memory node corresponding to the target data is connected to the tail position of the at least one associated memory node through parent-child edges. The parent-child evolutionary relationship includes at least one of the following: time evolution, range refinement, no conflict, and direct contradiction. The state of the target memory node is marked as a parent-child evolution type, and at least one of the following information is recorded: parent node, change content, trigger source, and timestamp.

4. The method according to claim 1 or 2, wherein updating the memory data of the structure tree based on the semantic relationship between the target data and the memory data in the at least one associated memory node comprises: In response to the semantic relationship indicating that there is an uncertain association between the target data and the memory data of the at least one associated memory node, the target memory node corresponding to the target data is connected to the branch path of the at least one associated memory node through the associated edge; The state of the target memory node is marked as a type to be verified, and at least one piece of information from the trigger source and timestamp is recorded.

5. The method according to claim 4, further comprising: Verify the parent-child evolutionary relationship of the target data; In response to the target data meeting the verification conditions, the target memory node corresponding to the target data is merged into the main path where the at least one associated memory node is located through parent-child edges; The state of the merged target memory node is marked as the merge type, and at least one of the following information is recorded: parent node, changed content, trigger source, and timestamp.

6. The method according to claim 5, wherein merging the target memory node corresponding to the target data into the main path where the at least one associated memory node is located via parent-child edges comprises: Based on the parent-child evolutionary relationship, a merging strategy is determined for the target data and the memory data of the at least one associated memory node. The merging strategy includes at least one of the following: time-evolutionary merging, range-refining merging, conditional coexistence merging, and coverage merging. After merging the target data and the memory data of at least one associated memory node according to the merging strategy, merged data is obtained; The target memory node corresponding to the merged data is connected to the tail position of the at least one associated memory node through parent-child edges.

7. The method according to claim 1, wherein if there is no associated memory node related to the target data on the main path of the structure tree, a memory data update operation is performed on the structure tree, comprising: Connect the target memory node corresponding to the target data to the end of the main path of the structure tree; The state of the target memory node is marked as a new type, and at least one piece of information, including the trigger source and timestamp, is recorded.

8. The method according to claim 1 or 2, further comprising: In response to determining that the memory data in the first memory node on the structure tree is erroneous data, a reverse change operation is determined based on the change between the memory data in the first memory node and the memory data in the second memory node, where the second memory node is the parent node of the first memory node on the structure tree that is connected to the first memory node through a parent-child edge. The rollback node corresponding to the reverse change operation is connected to the end of the main path where the first memory node is located via an associated edge; The state of the rollback node is marked as a directed rollback type, wherein the reverse change operation in the rollback node can perform at least one of the following: deletion, recovery, correction, and revocation on the memory data in the first memory node.

9. The method according to claim 1, further comprising: Obtain the task request information input to the intelligent agent; In response to the task request information, the target memory data is retrieved by searching the materialized view corresponding to the main path. The materialized view is generated based on the memory data in the memory nodes on the main path. The task request information is fed back based on the target memory data; The length of the main path where the target memory data is located, the trigger source, and the timestamp information are all considered as factors influencing the weight of the target memory data.

10. An electronic device, comprising: Memory, used to store computer programs; A processor is configured to execute the computer program to enable the electronic device to perform the following steps: Obtain target data, which represents the memory data of the agent to be processed; Based on the target data, at least one associated memory node is determined on the main path of the structure tree. The structure tree includes the main path and branch paths. The memory nodes on the main path are used to store the memory data of agents that meet the trust conditions, and the memory nodes on the branch paths are used to store the memory data of agents to be verified. Based on the semantic relationship between the target data and the memory data in the at least one associated memory node, a memory data update operation is performed on the structure tree to connect the target memory node corresponding to the target data to the main path or the branch path, wherein the memory data in the main path is used as the basis for the agent to provide feedback on task request information.