Methods, apparatus, and equipment for processing intelligent agent data based on knowledge graphs

By employing a knowledge graph-based agent data processing method, which utilizes memory graphs to store and update agent memory data, the problem of limited dialogue turns for agents is solved, thereby achieving accuracy and effectiveness in long-term agent memory and task planning.

CN120975116BActive Publication Date: 2026-03-06BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511503153.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-03-06
Estimated Expiration
2045-10-20

AI Technical Summary

Technical Problem

Existing intelligent agent frameworks rely on concatenating prompt text for data reasoning, resulting in a limited number of dialogue turns and an inability to scale effectively.

Method used

By employing a knowledge graph-based agent data processing method, memory graphs are used to store agent memory data. The memory graphs are updated through nodes to support long-term memory and fast retrieval. Nodes corresponding to tasks are generated to update the memory graphs, thereby improving the accuracy and effectiveness of task planning.

Benefits of technology

It enables agents to have long-term memory capabilities, expands the number of dialogue rounds in multi-turn dialogues, and improves the accuracy and effectiveness of task planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120975116B_ABST
    Figure CN120975116B_ABST
Patent Text Reader

Abstract

A method, apparatus, and device for processing agent data based on a knowledge graph are disclosed, relating to the fields of large models, agents, artificial intelligence, and knowledge graphs. The method includes: determining a target plan corresponding to the requirement text based on a requirement text, an agent, and a memory graph of the agent; obtaining execution process information and execution results of the task by having the agent invoke a target tool corresponding to the task; generating nodes corresponding to the task based on the execution process information and execution results; and updating the memory graph based on the nodes corresponding to the task. Thus, the agent's memory data can be stored in the form of a knowledge graph, enabling the agent to possess long-term memory capabilities to support rapid retrieval of the memory data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of large models, intelligent agents, artificial intelligence, and knowledge graph technology. Specifically, it relates to a method, apparatus, and device for processing intelligent agent data based on knowledge graphs. Background Technology

[0002] With the widespread application of Large Language Models (LLMs) in fields such as intelligent question answering, dialogue systems, code generation, and data analysis, more and more research and application systems are trying to use them to build intelligent agents capable of autonomous planning and task execution.

[0003] In related technologies, the agent framework mainly relies on concatenating prompt text to preserve context so that the agent can perform subsequent data reasoning and obtain reasoning results, but it can only handle a limited number of dialogue rounds. Summary of the Invention

[0004] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, this disclosure provides a method for processing agent data based on knowledge graphs, the method comprising:

[0006] Based on the demand text, the agent, and the agent's memory graph, a target plan corresponding to the demand text is determined. The target plan includes at least one task. The memory graph is a knowledge graph formed based on the agent's memory data. The memory graph includes the nodes corresponding to the memory data and the relationships between the nodes.

[0007] Based on the intelligent agent's invocation of the target tool corresponding to the task, the execution process information and execution result of the task are obtained;

[0008] Based on the execution process information and execution result of the task, a node corresponding to the task is generated;

[0009] The memory map is updated based on the nodes corresponding to the tasks.

[0010] Secondly, this disclosure provides a processing device for intelligent agent data based on knowledge graphs, the processing device comprising:

[0011] The first determining module is used to determine the target plan corresponding to the demand text based on the demand text, the agent, and the memory graph of the agent. The target plan includes at least one task, and the memory graph is a knowledge graph formed based on the memory data of the agent. The memory graph includes the nodes corresponding to the memory data and the relationships between the nodes.

[0012] The second determining module is used to obtain the execution process information and execution result of the task by calling the target tool corresponding to the task based on the intelligent agent;

[0013] The first generation module is used to generate a node corresponding to the task based on the execution process information and the execution result of the task;

[0014] The first update module is used to update the memory graph based on the nodes corresponding to the task.

[0015] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.

[0016] Fourthly, this disclosure provides an electronic device, comprising:

[0017] A storage device on which computer programs are stored;

[0018] A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect.

[0019] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.

[0020] In the above technical solution, the agent's memory data can be stored in the form of a knowledge graph, enabling the agent to possess long-term memory capabilities. Furthermore, this memory graph supports rapid retrieval of memory data, allowing the agent's context to operate without relying on the concatenation of prompt text. This ensures that the agent's multi-turn dialogues can incorporate memory data while significantly expanding the number of dialogue turns the agent can perform. Additionally, the memory graph can be updated based on nodes generated from the agent's task execution process and results, allowing the agent to plan based on previously executed tasks, improving the accuracy and effectiveness of task planning.

[0021] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0022] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:

[0023] Figure 1 This is a flowchart of a knowledge graph-based intelligent agent data processing method according to one embodiment of the present disclosure;

[0024] Figure 2 This is a schematic diagram of a knowledge graph provided according to another embodiment of this disclosure;

[0025] Figure 3 This is a flowchart of a knowledge graph-based intelligent agent data processing method according to another embodiment of the present disclosure;

[0026] Figure 4 This is an interaction sequence diagram of a knowledge graph-based intelligent agent data processing method provided according to one embodiment of the present disclosure;

[0027] Figure 5 A block diagram of a knowledge graph-based intelligent agent data processing apparatus provided according to one embodiment of the present disclosure;

[0028] Figure 6 A schematic diagram of the structure of an electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation

[0029] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0030] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0031] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0032] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0033] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0034] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0035] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0036] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0037] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0038] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0039] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0040] Figure 1 The diagram shown is a flowchart of a knowledge graph-based agent data processing method according to one embodiment of this disclosure. Figure 1 As shown, the method may include:

[0041] In step 11, based on the requirement text, the agent, and the agent's memory graph, the target plan corresponding to the requirement text is determined. The target plan includes at least one task, and the memory graph is a knowledge graph formed based on the agent's memory data. The memory graph includes the nodes corresponding to the memory data and the relationships between the nodes.

[0042] The requirement text can be written by the user based on their actual needs. It can be input through dialogue. That is, in this round of dialogue, the user can input the requirement text of the task they want the agent to perform so that the agent can perform data reasoning.

[0043] The agent's memory data can include input data, intermediate processing data, and output data from historical dialogue rounds. In this embodiment, memory data is represented by nodes, and relationships between different nodes are constructed to represent the associations between different memory data of the agent, thereby building a memory graph of the agent's memory data. This achieves structured storage of the agent's memory data, facilitating its maintenance and expansion. As an example, the memory graph can be represented using triples, such as <entity, relation, entity> or <entity, relation, attribute>. For example, an entity represents an object with a unique semantic identifier, which can include business concepts, data entities, metrics, dimensions, ETL (Extract-Transform-Load) processes, reports, etc. An entity can contain metadata such as type, attribute tags, context tags, and the data domain it belongs to, such as {"id": "entity_order","name": "order", "entityType": "BusinessEntity", "tags": ["transaction domain", "core entity"]}. Entities are connected by semantic relationship edges. Relation types can include dimensional associations, metric calculations, data lineage, dependencies, aggregations, ETL transformations, etc., such as {"from": "entity_order", "to": "entity_customer", "relationType": "belongsTo", "confidence": 0.9}. Attributes are used to represent the entity's own features or attribute fields. As an example, the following is a model triple representation of the graph:

[0044] A [Metric: Monthly Active Users] --> |Dependency| B [Field: Active User Tag]

[0045] B -->|Source| C[Table: User Behavior Details]

[0046] A -->|Used for| D[Plan: User Profile Building]

[0047] D -->|Feedback| E[Event: Field Scope Inconsistency]

[0048] The memory map constructed based on the above triples is as follows: Figure 2 As shown.

[0049] Accordingly, in this step, a prompt text can be constructed based on the requirement text and the corresponding prompt word used by the agent to determine the plan. This prompt text is then input into the agent, which combines the prompt text with its memory map to perform data reasoning and generate the target plan. After generating the target plan, each task can be executed sequentially according to the order of tasks in the target plan.

[0050] In step 12, the agent invokes the target tool corresponding to the task to obtain the task's execution process information and execution results.

[0051] The tools that can be invoked by intelligent agents can be pre-encapsulated based on actual application scenarios. For example, external capabilities such as API (Application Programming Interface) calls, searches, function execution, and database operations can be encapsulated to obtain callable tools. Intelligent agents can implement corresponding capabilities by invoking the appropriate tools. For instance, an intelligent agent can invoke a function execution tool to execute a corresponding function.

[0052] Therefore, in this embodiment, the agent can execute each task sequentially according to the task order in the target plan. For example, the agent can obtain the target tool corresponding to the task by matching the task information with the callable tools, and can generate calling parameters for calling the target tool without manual intervention. Then, the target tool is called to obtain the execution result. For example, a request body for calling the target tool can be constructed based on the calling parameters, and then the target tool can be called based on the request body.

[0053] The task execution process information is used to represent the information generated by the task during the execution process. It may include tool call logs and execution environment, as well as timestamps of the task execution time and execution status. It can be preset based on the actual application scenario.

[0054] As an example, the agent can determine whether a task has been completed based on the result of the invocation of the target tool. If the task has not been completed, it determines that a new tool needs to be invoked, and then invokes the new tool, repeating the above process until the task's execution result is obtained.

[0055] In step 13, nodes corresponding to the task are generated based on the task's execution process information and execution results.

[0056] In this embodiment, the node corresponding to the task can be represented by an event-type entity node. This event-type entity node can be used to represent semantic events perceived by the agent, such as requirement changes, data anomalies, user feedback, and report usage records. In this example, the attributes and methods in the structure of the event-type entity node can be predefined. Then, in this step, the structure definition of the event-type entity node can be obtained. Subsequently, based on the task's execution process information and execution results, the values ​​of each attribute in the structure are determined, thereby obtaining the node corresponding to the task.

[0057] As an example, if the execution result indicates that the execution failed, the agent can analyze the task information and execution process information of the task to obtain the experience information of the task. This experience information may include the cause of failure, the scope of impact, and adjustment suggestions, and the experience information is added to the structure of the node corresponding to the task for storage.

[0058] In step 14, the memory graph is updated based on the nodes corresponding to the task. For example, the nodes corresponding to the task can be added to the memory graph.

[0059] In the above technical solution, the agent's memory data can be stored in the form of a knowledge graph, enabling the agent to possess long-term memory capabilities. Furthermore, this memory graph supports rapid retrieval of memory data, allowing the agent's context to operate without relying on the concatenation of prompt text. This ensures that the agent's multi-turn dialogues can incorporate memory data while significantly expanding the number of dialogue turns the agent can perform. Additionally, the memory graph can be updated based on nodes generated from the agent's task execution process and results, allowing the agent to plan based on previously executed tasks, improving the accuracy and effectiveness of task planning.

[0060] like Figure 3 The diagram shown is a flowchart of a knowledge graph-based agent data processing method according to one embodiment of this disclosure. Figure 3 As shown, users can input requirement text or the system can perceive requirement text. Then, an intelligent agent can generate a plan through reasoning, which can contain multiple tasks. During the agent's reasoning and plan generation process, memory retrieval can be performed using the agent's memory map to combine the recalled content for reasoning. Furthermore, the agent can bind tools to execute tasks in the plan, obtain and output task execution results, and write the task execution process information and results to a node after task execution. This node updates the agent's memory map, allowing subsequent reasoning by the agent to be based on the updated memory map. The experience of executing tasks in the current plan is then written into the memory map, providing a reference for the agent's subsequent reasoning process.

[0061] In some possible embodiments, the method may further include:

[0062] After each task in the target plan is completed, a reflection report corresponding to the target plan is generated based on the execution process information and execution results of the tasks in the target plan.

[0063] The status of tasks can be monitored using status flags. Initially, all tasks are in the "Not Executed" state. If an agent executes a task, its status flag is updated to "In Progress." After obtaining the execution result, if the result indicates success, the task's status flag is updated to "Success"; if the result indicates failure, the task's status flag is updated to "Failure." The target plan's initial status can be "Not Executed." When there are tasks in the target plan that are in progress, the target plan's status can be updated to "In Progress." When the status of each task in the target plan is either "Success" or "Failure," the target plan's status is determined to be "Completed."

[0064] As an example, prompt text can be constructed based on the execution process information and results of each task in the target plan and input into the agent. The agent then analyzes this information to obtain a reflection report. This reflection report may include one or more of the following: progress analysis, risk point information, and improvement suggestions corresponding to the target plan. The output format of the reflection report can be constrained by the prompt words corresponding to the agent.

[0065] Subsequently, the memory map is updated based on the reflection report.

[0066] As an example, a node can be generated based on the structure definition of the reflection report. The values ​​of the attributes in this node can be determined based on the data in the reflection report, thus obtaining the node of the reflection report. This node can then be associated with nodes in the memory graph to update the memory graph. For instance, if a node corresponding to the target plan exists in the memory graph, that node can be used as the associated node of the reflection report in the memory graph, and the association relationship can be reflection. If a node corresponding to the target plan does not exist in the memory graph, the node corresponding to the last task in the target plan can be used as the associated node of the reflection report in the memory graph.

[0067] Therefore, a reflection report on plan execution can be added to the memory graph. This allows the agent to provide a reflection report while recalling contextual information based on the memory graph, thus providing historical experience and reference for the agent's subsequent planning decisions. This improves the accuracy of the target plan determined by the agent and, to some extent, also enhances the stability and efficiency of the plan execution generated by the agent.

[0068] In some possible embodiments, determining the target plan corresponding to the demand text based on the demand text, the agent, and the agent's memory map may include:

[0069] Based on the intelligent agent and the requirement text, the execution target corresponding to the requirement text is determined, and based on the requirement text and the execution target, it is determined whether to obtain context information.

[0070] As an example, prompt text can be constructed based on the requirement text and the corresponding prompt words of the agent to be input into the agent, which then performs data reasoning to obtain the target plan.

[0071] As another example, to improve the executability of the target plan obtained by the agent, during the agent's data reasoning process, an execution target corresponding to the requirement text can be obtained based on the agent. This execution target represents the final result of the task indicated by the requirement text. Accordingly, during the agent's plan generation process, the execution target can be used to determine whether the current input information is sufficient for plan generation. If it is determined that the information in the current prompt text is insufficient for plan generation, then it is considered necessary to obtain the context. If it is determined that the information in the current prompt text is sufficient for plan generation, then the target plan can be directly generated based on the prompt text.

[0072] If it is determined that the context information is obtained, then based on the agent, the demand text, and the memory graph, the context information corresponding to the demand text is determined from the memory graph.

[0073] In this step, nodes and relationships related to the demand text can be retrieved from the memory graph based on the agent and the demand text to obtain the context information.

[0074] As an example, determining the context information corresponding to the demand text from the memory map based on the agent, the demand text, and the memory map includes at least one of the following:

[0075] The first method involves matching the demand text with the index information of nodes in the memory graph based on the intelligent agent, and determining the context information from the matched nodes in the memory graph, wherein each node is associated with at least one index information.

[0076] As an example, nodes in a memory graph can have their indexes pre-built. For instance, a node's index information can include an entity inverted index, a time-series index, and a high-dimensional space approximate nearest neighbor index based on the HNSW (Hierarchical Navigable Small World) algorithm. The construction methods for these indexes can be implemented using methods commonly used in this field, and will not be elaborated upon here.

[0077] Accordingly, this memory graph supports various recall methods. For example, it can be used to recall nodes by matching keywords and nodes, such as using Trie (prefix tree) and Aho-Corasick algorithms. Alternatively, it can be used to match nodes in the memory graph through fuzzy matching and fault-tolerant search, such as using Jaro-Winkler / Levenshtein distance, BK-tree (Burkhard-Keller) algorithm, and Soundex / Metaphone algorithm. Furthermore, it can also recall nodes in the memory graph using semantic vectors, such as using the HNSW algorithm to match the semantic vectors of the request text and the nodes in the memory graph. Additionally, it can combine these recall methods to achieve recall; for example, it can first obtain initial nodes by matching keywords and nodes, and then match the semantic vectors between the request text and the initial nodes to further refine the recalled nodes.

[0078] After recalling nodes using the above method, they can be sorted based on the weight of their ranking attributes. Then, the top N nodes can be selected as context information to avoid the impact of too many recalled nodes on subsequent data inference and to reduce data processing volume. The ranking attributes can be set based on the actual application scenario; for example, they can be time attributes, with later times receiving higher weights.

[0079] The second approach involves matching the request text with the nodes corresponding to the tasks in the memory graph based on the intelligent agent. If a node is matched, the context information is obtained based on the execution path of the plan to which the task corresponding to the matched node belongs.

[0080] As an example, the memory graph can be initialized and constructed based on the analysis of documents produced during the development and design phase, such as indicator definition documents and rule definition documents, serving as pre-configured knowledge memory for the agent. When the agent performs a task, the node corresponding to the task can be associated with a task type identifier when added to the memory graph, indicating that the node is generated based on the actual task execution. In this embodiment, the node associated with the task type identifier in the memory graph can be obtained as the node corresponding to the task, and then node matching can be performed using the recall method described above.

[0081] For example, a memory graph contains the execution path of plan A1, which includes tasks r1-r5. If a node corresponding to task r3 is matched, the execution path r1-r2-r3-r4-r5 of plan A1 to which task r3 belongs can be used as the context information. Similarly, the matched node in the execution path and the path following that node can be used as the context information, such as r3-r4-r5. Thus, context information can be obtained based on plans executed by the agent that are related to the requirement text, providing historical experience to the agent in determining the target plan corresponding to the requirement text, and providing effective data support for the generation of the target plan.

[0082] The third approach involves matching the index information of the nodes in the memory graph with the requested text by the intelligent agent, and then performing multi-hop reasoning based on the matched nodes in the memory data and the memory graph to obtain the context information.

[0083] In this embodiment, matching nodes can be obtained through the node recall method described in the first approach. Further multi-hop inference can be performed based on the matched nodes to obtain inference nodes associated with the matched nodes.

[0084] As an example, multi-hop inference can be performed using Breadth-First Search (BFS) or Depth-First Search (DFS). If the matched node is a node of index Z, multi-hop inference can be used to trace the lineage of index Z to which original data tables it depends on. For example, if the initial node is a node of index Z and the target node is a node of an original data table in the database, then a path search algorithm is used to determine the path search between the initial node and the target node, thus achieving multi-hop inference.

[0085] As another example, inference constraints can be imposed using the `maxHops` parameter. `maxHops` limits the maximum number of jumps in pathfinding algorithms to avoid unlimited traversal of the memory graph, reducing computational resource consumption. It also excludes excessively long paths, ensuring effective associations between inference nodes and matched nodes in multi-hop inference. For instance, in BFS, the current hop count is recorded during layer traversal; when the hop count exceeds `maxHops`, the search for that layer and subsequent layers is terminated. Similarly, in DFS recursion or iteration, the current path length is tracked, and backtracking occurs when `maxHops` is exceeded. Therefore, this method allows for association inference based on matched nodes, further enhancing the richness of information within the context.

[0086] As another example, after obtaining the context information in the above manner, the relevance between the context information and the requirement text can be further determined, and the top M can be selected as the context information corresponding to the requirement text based on the relevance.

[0087] As another example, context information can be determined based on the agent's current reasoning process. If the agent's current reasoning process is to determine a target plan, the context corresponding to the node generated during the initialization phase of the memory graph can be input. If the agent's current reasoning process is to execute a task, the context corresponding to the node identified by the task type in the memory graph can be input to achieve automatic injection of context information.

[0088] In some possible embodiments, the method may further include:

[0089] The agent performs hierarchical clustering on the nodes in the memory graph to obtain multiple clusters.

[0090] The number of hierarchical clustering levels can be set based on the actual application scenario, and the hierarchical clustering method can be implemented based on the hierarchical clustering algorithm commonly used in this field. This disclosure does not limit this.

[0091] For each cluster, based on the agent and the node information of the nodes in the cluster, the cluster index information corresponding to the cluster is determined.

[0092] After identifying multiple clusters, semantic summarization can be performed based on the node information within each cluster to obtain cluster index information. For example, if a cluster contains nodes corresponding to 10 similar tasks, prompt text can be constructed based on the node information and input into an agent. The agent can then summarize and generalize to obtain cluster index information, such as "detailed execution records of the past 10 similar tasks, task XXXX".

[0093] Accordingly, determining the context information corresponding to the demand text from the memory graph based on the agent, the demand text, and the memory graph may include:

[0094] Based on the intelligent agent, the demand text, and the clustering index information, determine the target cluster in the memory graph that corresponds to the demand text;

[0095] The context information is determined based on the intelligent agent, the requirement text, and the nodes in the target cluster.

[0096] In this embodiment, the intelligent agent and the demand text can be matched with the clustering index information to obtain the target cluster associated with the demand text. Then, the nodes that match the demand text can be further determined from the nodes in the target cluster to obtain context information. Thus, multi-level retrieval can be performed through the clustering index information to narrow the retrieval range at each level and improve retrieval efficiency.

[0097] In determining the nodes matching the required text using the first, second, and third methods mentioned above, multi-level matching based on clustering index information can be employed. Therefore, through this technical solution, multiple nodes in the memory graph can be summarized using clustering index information. By performing multi-level retrieval of nodes in the memory graph, the efficiency of node retrieval in the memory graph is improved, while simultaneously simplifying the complexity of the memory graph and facilitating its updating and maintenance.

[0098] Furthermore, a prompt text is determined based on the requirement text and the context information, so as to generate the target plan based on the prompt text and the agent.

[0099] After obtaining the context, prompt text can be further constructed based on the prompt words corresponding to the requirement text and context information, and then input into the agent so that the agent can analyze based on the context information and requirement text, providing more data references for the agent to determine the plan, thereby improving the feasibility and accuracy of the target plan to a certain extent.

[0100] In some possible embodiments, updating the memory graph based on the node corresponding to the task may include:

[0101] Determine the associated nodes of the node corresponding to the task in the memory graph and the association relationship between the node and the associated nodes.

[0102] In this process, the nodes to be associated with a task can be determined by matching the nodes corresponding to the task in the memory graph. For example, if the node corresponding to the task is "update order dimension table", then its associated nodes can include the node corresponding to "order" and the node corresponding to "dimensional table design specification", and the relationship between the nodes can be determined.

[0103] As an example, the execution trajectory of the plan is recorded in the memory graph in the form of a path. In this example, if the task is the first task in the target plan, the associated nodes of the node corresponding to the task in the memory graph also include the node corresponding to the target plan. If there is no node corresponding to the target plan, the associated nodes of the node corresponding to the task in the memory graph also include the node of the entity corresponding to the target plan. If the task is not the first task in the target plan, the associated nodes of the node corresponding to the task in the memory graph also include the node corresponding to the previous task of the task. The association relationship between the nodes can be a next-step relationship, thereby recording the execution paths of multiple tasks belonging to the same plan.

[0104] The node corresponding to the task is added to the memory graph, and associated with the associated node according to the relationship.

[0105] Accordingly, after determining the associated nodes and the relationships between them, the nodes corresponding to the task can be added to the memory graph according to the association, and new triples can be generated to store the association.

[0106] Therefore, through the above technical solution, the node corresponding to the task can be automatically associated with the node in the memory graph, ensuring the structured storage of the agent's memory, realizing the expansion and updating of the memory graph, while improving the diversity of data in the memory graph, providing parameters for the generation of subsequent plans and the execution of tasks, and enhancing the agent's self-feedback capability.

[0107] In some possible embodiments, the method may further include:

[0108] Conflict detection is performed on the nodes in the memory graph to identify conflicting nodes in the memory graph.

[0109] In real-world applications, different members of a collaborative team may use different names to define the same metric. For example, the metric "monthly active users" might be defined in different documents. Therefore, when analyzing different documents to obtain a memory graph, different nodes within that graph might contain different definitions of "monthly active users." Thus, in this embodiment, an intelligent agent can perform conflict detection on the node information in the memory graph to determine whether conflicts exist between the node information of different nodes.

[0110] Based on the conflict node, the memory map, and the agent, the conflict resolution strategy corresponding to the conflict node is determined.

[0111] After identifying conflicting nodes, their node information and memory graph can be input into the agent, allowing the agent to determine a unified description corresponding to multiple conflicting nodes. For example, the subgraph corresponding to the conflicting node in the memory graph can be obtained, and the subgraph and conflicting node can be input into the agent for analysis. The subgraph can be a subgraph formed by nodes and relationships centered on the conflicting node and following a path of n in the memory graph. For example, the conflict resolution strategy could be to retain only one node or to merge multiple nodes and record their definitions.

[0112] The memory map is updated based on the conflict nodes and the conflict resolution strategy.

[0113] Once a conflict resolution strategy is determined, the conflicting nodes can be operated on according to that strategy. For example, if the determined conflict resolution strategy is to retain one of the nodes, then one of the nodes can be retained based on that strategy, and the other conflicting nodes can be deleted.

[0114] Therefore, the above technical solution can update the memory graph, ensuring the accuracy of the nodes in the memory graph and the relationships between the nodes, thereby improving the accuracy of the agent's memory data and providing effective data support for the agent's subsequent data reasoning.

[0115] In some possible embodiments, the method may further include:

[0116] Similarity detection is performed on the nodes in the memory graph, and the nodes that need to be merged in the memory graph are determined based on the similarity between the nodes.

[0117] In this step, the similarity between different nodes in the memory graph can be calculated to identify similar nodes and avoid information duplication. As an example, similarity can be calculated directly based on node information. Another example is calculating similarity based on a single dimension in the node information, i.e., obtaining the value of that dimension in the node information and calculating the similarity between two nodes based on that value. For example, for each dimension, the node information can be vector-encoded to obtain the corresponding vector, allowing for similarity calculation. A similarity threshold can be set based on the actual application scenario, allowing nodes with similarity exceeding the threshold to be merged. As another example, nodes to be merged can be determined based on multiple dimensions in the node information. For example, after determining the nodes to be merged based on a single dimension, the union of the nodes to be merged across multiple dimensions can be used as the node to be merged under that combined dimension.

[0118] The nodes that need to be merged are merged to obtain the node information of the merged node.

[0119] As an example, multiple nodes that need to be merged can be merged into one node, and the node information of the nodes to be merged can be input into the agent so that the agent can summarize the information of the nodes to be merged and obtain the node information of the merged node, thereby realizing the compression of the memory data.

[0120] Next, the associated nodes of the merged node in the memory graph and the association relationship between the merged node and the associated nodes are determined.

[0121] Specifically, the nodes directly associated with the node to be merged in the memory graph can be used as the associated nodes of the merged node, and the association between the node to be merged and its directly associated nodes can be used as the association between the merged node and the associated nodes.

[0122] As an example, the nodes to be merged are J1, J2, and J3. J1's direct related nodes in the memory graph are G1 and G2, with the relationship between J1 and G1 being F1 and the relationship between J1 and G2 being F2. J2's direct related node in the memory graph is G3, with the relationship being F3. J3's direct related node in the memory graph is G4, with the relationship being F4. The merged node H is then defined as follows: G1, G2, G3, and G4 can be considered as related nodes of the merged node H. The relationship F1 is considered as the relationship between H and G1, the relationship F2 as the relationship between H and G2, the relationship F3 as the relationship between H and G3, and the relationship F4 as the relationship between H and G4.

[0123] The nodes that need to be merged are deleted from the memory graph, the merged nodes are added to the memory graph, and associated with the associated nodes according to the association relationship.

[0124] As an example, in this step, nodes J1, J2, and J3 can be deleted, and the merged node H can be associated with G1, G2, G3, and G4 to be added to the memory graph, and the association can be performed based on the above association relationships respectively.

[0125] Therefore, the above technical solution can aggregate similar nodes in the memory graph to avoid information duplication in the memory graph, and improve the efficiency and accuracy of memory retrieval based on the memory graph.

[0126] like Figure 4 The diagram shown is an interaction sequence diagram of a knowledge graph-based agent data processing method according to one embodiment of this disclosure. Figure 4As shown, the user can input a requirement text into the agent, which then retrieves the context information corresponding to the requirement text from the memory graph. Next, the agent can generate a target plan based on the requirement text and context information, and further invoke tools to execute the tasks in the target plan, obtaining the task execution results and process information. Furthermore, the task execution results and process information can be added to the memory graph, and the agent can generate a reflection report on the plan, updating the memory graph through similar node merging or conflict node handling. The specific implementation methods of the above steps have been detailed above and will not be repeated here.

[0127] In some possible embodiments, the method may further include:

[0128] The storage type of nodes in the memory graph is determined, wherein the storage type indicates the timeliness of the node's storage. For example, a node corresponding to a task performed by the agent may decay over time until it disappears. A metric or rule applied by the agent may decay over time but will not disappear.

[0129] Therefore, when constructing a memory graph, the storage type of a node can be determined based on the source of its node information. For example, a node corresponding to a task might have a first storage type, meaning it can be deleted; a node corresponding to a rule document might have a second storage type, meaning it won't be deleted. Alternatively, the storage type of a node can be pre-configured based on the actual application scenario.

[0130] For example, in a data warehouse scenario, nodes corresponding to business knowledge (such as business concepts and definitions) are stored as secondary storage type, and their weights decay less in the weight update strategy. Nodes corresponding to seasonal rules are also stored as secondary storage type, and their weight update strategy can instruct for automatic weight adjustment based on time during characteristic periods (such as promotional periods). As another example, nodes corresponding to tasks can be stored as primary storage type, so that new user requests can be recalled and correlated with similar historical requests, extracting reusable experience and potential risk points, while avoiding excessive storage space consumption by task-related nodes.

[0131] If the node is of the first storage type, based on the usage information of the node's node information, the node to be deleted is determined from the nodes of the first storage type and then deleted.

[0132] As an example, for nodes of the first storage type, the least recently used memory can be determined and deleted from the nodes of the first storage type based on the LRU (Least Recently Used) algorithm, thereby reducing the storage space occupied by memory data. Alternatively, nodes to be deleted can be determined from the nodes of the first storage type based on the recall rate of nodes in the memory graph; nodes whose recall rate is less than a preset threshold within a certain period after storage are considered as nodes to be deleted. The duration of the period and the preset threshold can be pre-set based on the actual application scenario. As an example, nodes to be deleted can be deleted using the node deletion methods commonly used in knowledge graphs in this disclosure; this disclosure does not limit this approach.

[0133] If the node is of the second storage type, the weight of the node is updated based on the weight update strategy corresponding to the node.

[0134] As an example, for nodes of the second storage type, these nodes are not deleted over time, but their weights may be updated based on the actual scenario. Therefore, the weight update strategy of the node can be pre-configured based on the actual application scenario. For example, in the data warehouse, the promotional activity rules will increase the weight during the promotion period and decrease the weight during the non-promotion period. The weight update of the node can be implemented based on the weight update strategy corresponding to the node and the current time.

[0135] Therefore, the above technical solution can realize the management of nodes in the memory graph, enabling the agent's memory data to simulate human memory characteristics, improve the effective management of the agent's memory data, and thus ensure the accuracy and effectiveness of the agent's memory data. At the same time, it can also avoid the impact of excessive memory data on the efficiency of memory retrieval.

[0136] In some possible embodiments, the method may further include:

[0137] In response to determining that the execution result of the task meets the triggering condition, the response plan triggered by the triggering condition is obtained.

[0138] The response plan is executed based on the agent.

[0139] The execution result of a task may be success or failure. A failure in the current task execution will affect the overall execution result of the target plan. Therefore, in this embodiment, trigger conditions can be pre-set based on the task execution result to handle scenarios where task execution fails. For example, if the trigger condition is "API A1 fails to call 3 times consecutively," and the response plan triggered by this trigger condition is a "health service check plan," then after the agent executes the task and obtains the execution result, it can determine whether the trigger condition is met based on the execution result. If the trigger condition is met, the agent can be triggered to execute the health service check plan to check the health status of API A1 and determine whether API A1 can continue to provide services.

[0140] For example, trigger conditions can also be setting monitoring thresholds for key metrics. When accumulated events reach this threshold, a response plan is triggered. For instance, a trigger condition could include "Negative user feedback on feature F1 reaches a monitoring threshold," and the response plan triggered by this condition would be a "user experience optimization plan." The monitoring threshold can be dynamically adjusted based on historical data, thus enabling automatic updates to the trigger conditions.

[0141] Therefore, after obtaining the execution result of the agent on the current task, it can be determined whether the triggering condition is met based on the execution result. If the triggering condition is met, the response plan triggered by the triggering condition is executed based on the agent, and the next task of the current task is executed after the response plan is completed.

[0142] Therefore, through the above technical solution, behaviors, anomalies, failures and other issues in task execution can be automatically captured based on the task execution results, so as to realize proactive task triggering for the intelligent agent. Without the need for user input, the response plan can be automatically triggered based on the task execution results of the intelligent agent, so as to build an intelligent agent that can react and learn on its own, thereby improving the accuracy and efficiency of intelligent agent task execution.

[0143] In some possible embodiments, the method may further include:

[0144] Based on the agent and the nodes corresponding to the tasks in the memory graph, a prediction plan is generated and displayed.

[0145] The memory graph contains nodes corresponding to each task in the plan executed by the agent. Since the execution of some plans follows specific patterns, in this embodiment, the agent can analyze the nodes corresponding to the tasks in the memory graph to generate a predictive plan in combination with the current state.

[0146] For example, by analyzing the nodes corresponding to tasks in the memory graph using an intelligent agent, it can be discovered that there is a surge in reporting demand at the end of the fiscal quarter, and users typically respond to this scenario with resource expansion plans. Therefore, predictive plans, such as resource expansion plans, can be generated based on the agent's analysis of historical data in the memory graph to address potential surges in reporting demand.

[0147] In response to receiving confirmation from the user regarding the prediction plan, the prediction plan is executed based on the agent.

[0148] As an example, the generated prediction plan can be displayed to the user so that they can confirm whether they need to execute it. If the user believes the prediction plan is feasible, they can trigger a confirmation action, after which the prediction plan can be executed based on the agent. The method of executing the prediction plan based on the agent is the same as the method of executing the target plan based on the agent. For example, each task in the prediction plan can be executed sequentially by the agent, and the execution result of each task can be written into the memory graph to further improve the memory graph and provide data reference for subsequent task execution by the agent.

[0149] Therefore, through the above technical solution, a predictive plan can be obtained by analyzing the nodes corresponding to the tasks in the memory graph by the intelligent agent. This allows the intelligent agent to predict potential problems in the future and generate a plan to deal with them, ensuring the stable operation of the intelligent agent, improving the self-learning ability of the intelligent agent, and thus expanding the application scenarios of the intelligent agent.

[0150] Based on the same inventive concept, this disclosure also provides a device for processing intelligent agent data based on knowledge graphs, such as... Figure 5 As shown, the processing device 10 includes:

[0151] The first determining module 100 is used to determine the target plan corresponding to the demand text based on the demand text, the agent, and the memory graph of the agent. The target plan includes at least one task, and the memory graph is a knowledge graph formed based on the memory data of the agent. The memory graph includes the nodes corresponding to the memory data and the relationships between the nodes.

[0152] The second determining module 200 is used to obtain the execution process information and execution result of the task by calling the target tool corresponding to the task based on the intelligent agent;

[0153] The first generation module 300 is used to generate a node corresponding to the task based on the execution process information and the execution result of the task;

[0154] The first update module 400 is used to update the memory map based on the node corresponding to the task.

[0155] Optionally, the first determining module 100 includes:

[0156] The first determining submodule is used to determine the execution target corresponding to the requirement text based on the intelligent agent and the requirement text, and to determine whether to obtain context information based on the requirement text and the execution target.

[0157] The second determining submodule is used to determine the context information corresponding to the demand text from the memory graph based on the agent, the demand text, and the memory graph if it is determined that the context information is obtained;

[0158] A generation submodule is used to generate the target plan based on the requirement text, the context information, and the agent.

[0159] Optionally, the second determining submodule includes at least one of the following:

[0160] The third determining submodule is used to match the index information of the nodes in the memory graph based on the intelligent agent's matching of the demand text and the nodes in the memory graph, and to determine the context information from the matched nodes in the memory graph, wherein the nodes are associated with at least one index information;

[0161] The fourth determination submodule is used to match the nodes corresponding to the task in the memory graph based on the intelligent agent. If a node is matched, the context information is obtained based on the execution path of the plan to which the task corresponding to the matched node belongs.

[0162] The fifth determining submodule is used to match the index information of the nodes in the memory graph with the request text based on the intelligent agent, and to perform multi-hop reasoning based on the matched nodes in the memory data and the memory graph to obtain the context information.

[0163] Optionally, the processing device 10 further includes:

[0164] The clustering module is used to perform hierarchical clustering of nodes in the memory graph based on the agent, and obtain multiple clusters;

[0165] The third determining module is used to determine the clustering index information corresponding to each cluster based on the node information of the intelligent agent and the nodes in the cluster.

[0166] The second determining submodule includes:

[0167] The sixth determining submodule is used to determine the target cluster in the memory graph corresponding to the demand text based on the intelligent agent, the demand text, and the clustering index information;

[0168] The seventh determination submodule is used to determine the context information based on the intelligent agent, the requirement text, and the nodes in the target cluster.

[0169] Optionally, the first update module 400 includes:

[0170] The eighth determination submodule is used to determine the associated nodes of the node corresponding to the task in the memory graph and the association relationship with the associated nodes;

[0171] The first processing submodule is used to add the node corresponding to the task to the memory graph and associate it with the associated node according to the association relationship.

[0172] Optionally, the processing device 10 further includes:

[0173] The fourth determination module is used to perform conflict detection on the nodes in the memory graph and determine the conflicting nodes in the memory graph.

[0174] The fifth determining module is used to determine the conflict resolution strategy corresponding to the conflict node based on the conflict node, the memory map, and the agent.

[0175] The second update module is used to update the memory map based on the conflict nodes and the conflict resolution strategy.

[0176] Optionally, the processing device 10 further includes:

[0177] The sixth determining module is used to determine the similarity between nodes in the memory graph, and to determine the nodes in the memory graph that need to be merged based on the similarity between nodes;

[0178] The merging module is used to merge the nodes that need to be merged and obtain the node information of the merged node.

[0179] The seventh determining module is used to determine the associated nodes of the merged node in the memory graph and the association relationship between the merged node and the associated nodes;

[0180] The third update module is used to delete the nodes that need to be merged from the memory graph, add the merged nodes to the memory graph, and associate them with the associated nodes according to the association relationship.

[0181] Optionally, the processing device 10 further includes:

[0182] The eighth determining module is used to determine the storage type of the nodes in the memory graph;

[0183] The fourth update module is used to determine and delete nodes to be deleted from the nodes of the first storage type based on the usage information of the node information if the node type is the first storage type.

[0184] The fifth update module is used to update the weight of the node based on the weight update strategy corresponding to the node if the node type is the second storage type.

[0185] Optionally, the processing device 10 further includes:

[0186] The acquisition module is used to acquire the response plan triggered by the triggering condition in response to determining that the execution result of the task meets the triggering condition;

[0187] The first processing module is used to execute the response plan based on the intelligent agent.

[0188] Optionally, the processing device 10 further includes:

[0189] The second processing module is used to generate and display a prediction plan based on the intelligent agent and the nodes corresponding to the tasks in the memory graph.

[0190] The third processing module is used to execute the prediction plan based on the agent in response to receiving a user's confirmation operation on the prediction plan.

[0191] Optionally, the processing device 10 further includes:

[0192] The second generation module is used to generate a reflection report corresponding to the target plan after each task in the target plan has been completed, based on the execution process information and execution results of the tasks in the target plan.

[0193] The sixth update module is used to update the memory map based on the reflection report.

[0194] The following is for reference. Figure 6 The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device or a server) 600 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0195] like Figure 6As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0196] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0197] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.

[0198] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0199] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0200] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0201] The aforementioned computer-readable medium carries one or more programs. When the electronic device executes the aforementioned one or more programs, the electronic device causes the electronic device to: determine a target plan corresponding to the requirement text based on the requirement text, the agent, and the agent's memory graph, wherein the target plan includes at least one task, the memory graph is a knowledge graph formed based on the agent's memory data, and the memory graph includes nodes corresponding to the memory data and relationships between nodes; obtain the execution process information and execution result of the task by invoking the target tool corresponding to the task based on the agent; generate nodes corresponding to the task based on the task's execution process information and the execution result; and update the memory graph based on the nodes corresponding to the task.

[0202] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0203] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0204] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules do not necessarily limit the module itself; for example, the first determining module can also be described as "a module that determines the target plan corresponding to the demand text based on the demand text, the agent, and the agent's memory map."

[0205] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0206] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0207] According to one or more embodiments of this disclosure, Example 1 provides a method for processing agent data based on knowledge graphs, the method comprising:

[0208] Based on the demand text, the agent, and the agent's memory graph, a target plan corresponding to the demand text is determined. The target plan includes at least one task. The memory graph is a knowledge graph formed based on the agent's memory data. The memory graph includes the nodes corresponding to the memory data and the relationships between the nodes.

[0209] Based on the intelligent agent's invocation of the target tool corresponding to the task, the execution process information and execution result of the task are obtained;

[0210] Based on the execution process information and execution result of the task, a node corresponding to the task is generated;

[0211] The memory map is updated based on the nodes corresponding to the tasks.

[0212] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, wherein determining the target plan corresponding to the demand text based on the demand text, the agent, and the memory map of the agent includes:

[0213] Based on the intelligent agent and the requirement text, determine the execution target corresponding to the requirement text, and determine whether to obtain context information based on the requirement text and the execution target;

[0214] If it is determined that the context information is obtained, then based on the agent, the demand text, and the memory graph, the context information corresponding to the demand text is determined from the memory graph;

[0215] The target plan is generated based on the requirement text, the context information, and the intelligent agent.

[0216] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 2, wherein determining the context information corresponding to the demand text from the memory map based on the agent, the demand text, and the memory map includes at least one of the following:

[0217] Based on the intelligent agent matching the index information of the nodes in the memory graph with the demand text, the context information is determined from the matched nodes in the memory graph, wherein the node is associated with at least one index information;

[0218] The agent matches the nodes corresponding to the task in the memory graph with the requirement text. If a node is matched, the context information is obtained based on the execution path of the plan to which the task corresponding to the matched node belongs.

[0219] The agent matches the index information of the nodes in the request text and the memory graph, and performs multi-hop reasoning based on the matched nodes in the memory data and the memory graph to obtain the context information.

[0220] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 2, the method further comprising:

[0221] Based on the intelligent agent, hierarchical clustering is performed on the nodes in the memory graph to obtain multiple clusters;

[0222] For each cluster, based on the intelligent agent and the node information of the nodes in the cluster, the cluster index information corresponding to the cluster is determined;

[0223] The step of determining the context information corresponding to the demand text from the memory graph based on the intelligent agent, the demand text, and the memory graph includes:

[0224] Based on the intelligent agent, the demand text, and the clustering index information, determine the target cluster in the memory graph that corresponds to the demand text;

[0225] The context information is determined based on the intelligent agent, the requirement text, and the nodes in the target cluster.

[0226] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 1, wherein updating the memory graph based on the node corresponding to the task includes:

[0227] Determine the associated nodes of the node corresponding to the task in the memory graph and the association relationship between the node and the associated nodes;

[0228] The node corresponding to the task is added to the memory graph, and associated with the associated node according to the relationship.

[0229] According to one or more embodiments of this disclosure, Example 6 provides the method of Example 1, the method further comprising:

[0230] Conflict detection is performed on the nodes in the memory graph to identify conflicting nodes in the memory graph;

[0231] Based on the conflict node, the memory map, and the agent, determine the conflict resolution strategy corresponding to the conflict node;

[0232] The memory map is updated based on the conflict nodes and the conflict resolution strategy.

[0233] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 1, the method further comprising:

[0234] Determine the similarity between nodes in the memory graph, and determine the nodes in the memory graph that need to be merged based on the similarity between nodes;

[0235] The nodes that need to be merged are merged to obtain the node information of the merged nodes;

[0236] Determine the associated nodes of the merged node in the memory graph and the association relationship between the merged node and the associated nodes;

[0237] The nodes that need to be merged are deleted from the memory graph, the merged nodes are added to the memory graph, and associated with the associated nodes according to the association relationship.

[0238] According to one or more embodiments of this disclosure, Example 8 provides the method of Example 1, the method further comprising:

[0239] Determine the storage type of the nodes in the memory graph;

[0240] If the node is of the first storage type, based on the usage information of the node's node information, determine the node to be deleted from the nodes of the first storage type and delete it;

[0241] If the node is of the second storage type, the weight of the node is updated based on the weight update strategy corresponding to the node.

[0242] According to one or more embodiments of this disclosure, Example 9 provides the method of Example 1, the method further comprising:

[0243] In response to determining that the execution result of the task meets the triggering condition, obtain the response plan triggered by the triggering condition;

[0244] The response plan is executed based on the agent.

[0245] According to one or more embodiments of this disclosure, Example 10 provides the method of Example 1, the method further comprising:

[0246] Based on the intelligent agent and the nodes corresponding to the tasks in the memory graph, a prediction plan is generated and displayed.

[0247] In response to receiving confirmation from the user regarding the prediction plan, the prediction plan is executed based on the agent.

[0248] According to one or more embodiments of this disclosure, Example 11 provides the method of Example 1, the method further comprising:

[0249] After each task in the target plan is completed, a reflection report corresponding to the target plan is generated based on the execution process information and execution results of the tasks in the target plan.

[0250] The memory map is updated based on the reflection report.

[0251] According to one or more embodiments of this disclosure, Example 12 provides a processing apparatus for intelligent agent data based on knowledge graphs, the processing apparatus comprising:

[0252] The first determining module is used to determine the target plan corresponding to the demand text based on the demand text, the agent, and the memory graph of the agent. The target plan includes at least one task, and the memory graph is a knowledge graph formed based on the memory data of the agent. The memory graph includes the nodes corresponding to the memory data and the relationships between the nodes.

[0253] The second determining module is used to obtain the execution process information and execution result of the task by calling the target tool corresponding to the task based on the intelligent agent;

[0254] The first generation module is used to generate a node corresponding to the task based on the execution process information and the execution result of the task;

[0255] The first update module is used to update the memory graph based on the nodes corresponding to the task.

[0256] According to one or more embodiments of the present disclosure, Example 13 provides a computer-readable medium having a computer program stored thereon that, when executed by a processing device, implements the steps of the method described in any one of Examples 1-11.

[0257] According to one or more embodiments of this disclosure, Example 14 provides an electronic device comprising:

[0258] A storage device on which computer programs are stored;

[0259] A processing device for executing the computer program in the storage device to implement the steps of any one of the methods in Examples 1-11.

[0260] According to one or more embodiments of the present disclosure, Example 15 provides a computer program product including a computer program that, when executed by a processor, implements the steps of the method described in any one of Examples 1-11.

[0261] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0262] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0263] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.

Claims

1. A method for processing agent data based on a knowledge graph, characterized in that, The method comprises: determining a target plan corresponding to the demand text based on the demand text, an agent and a memory graph of the agent, wherein the target plan comprises at least one task, the memory graph is a knowledge graph formed based on memory data of the agent, and the memory graph comprises nodes corresponding to the memory data and relationships between the nodes; obtaining execution process information and an execution result of the task based on the agent calling a target tool corresponding to the task, wherein the execution process information of the task is used to represent information generated in an execution process of the task; generating a node corresponding to the task based on the execution process information and the execution result of the task; updating the memory graph based on the node corresponding to the task; wherein the determining of the target plan corresponding to the demand text based on the demand text, the agent and the memory graph of the agent comprises: determining an execution target corresponding to the demand text based on the agent and the demand text, and determining whether to obtain context information based on the demand text and the execution target; if it is determined to obtain the context information, determining the context information corresponding to the demand text from the memory graph based on the agent, the demand text and the memory graph; generating the target plan based on the demand text, the context information and the agent.

2. The method of claim 1, wherein, The determining of the context information corresponding to the demand text from the memory graph based on the agent, the demand text and the memory graph comprises at least one of the following: matching index information of the demand text and nodes in the memory graph based on the agent, and determining the context information from the matched nodes in the memory graph, wherein the nodes are associated with at least one index information; matching nodes corresponding to tasks in the demand text and the memory graph based on the agent, and if a node is matched, obtaining the context information based on an execution path of a plan to which the matched node belongs; matching index information of the demand text and nodes in the memory graph based on the agent, and performing multi-hop reasoning based on the matched nodes in the memory data and the memory graph to obtain the context information.

3. The method of claim 1, wherein, The method further comprises: obtaining a plurality of clusters based on hierarchical clustering of nodes in the memory graph by the agent; for each cluster, determining cluster index information corresponding to the cluster based on node information of nodes in the cluster by the agent; The determining of the context information corresponding to the demand text from the memory graph based on the agent, the demand text and the memory graph comprises: determining a target cluster corresponding to the demand text in the memory graph based on the agent, the demand text and the cluster index information; determining the context information based on the agent, the demand text and nodes in the target cluster.

4. The method of claim 1, wherein, The updating of the memory graph based on the node corresponding to the task comprises: determine an associated node of the task corresponding node in the memory graph and an association relationship with the associated node; add the task corresponding node to the memory graph and associate the task corresponding node with the associated node in the association relationship.

5. The method of claim 1, wherein, The method further comprises: detecting a conflict of the nodes in the memory graph to determine a conflict node with a conflict in the memory graph; determining a conflict resolution strategy corresponding to the conflict node based on the conflict node, the memory graph and the agent; updating the memory graph based on the conflict node and the conflict resolution strategy.

6. The method of claim 1, wherein, The method further comprises: determining a similarity between the nodes in the memory graph and determining a node to be merged in the memory graph based on the similarity between the nodes; merging the node to be merged to obtain node information of a merged node after merging; determining an associated node of the merged node in the memory graph and an association relationship with the associated node; deleting the node to be merged from the memory graph, adding the merged node to the memory graph, and associating the merged node with the associated node in the association relationship.

7. The method of claim 1, wherein, The method further comprises: determining a storage type of the node in the memory graph; if the type of the node is a first storage type, determining a node to be deleted from the node of the first storage type based on usage information of node information of the node and deleting the node to be deleted; if the type of the node is a second storage type, updating a weight of the node based on a weight update strategy corresponding to the node.

8. The method of claim 1, wherein, The method further comprises: in response to determining that an execution result of the task meets a trigger condition, obtaining a response plan triggered by the trigger condition; executing the response plan based on the agent.

9. The method of claim 1, wherein, The method further comprises: generating a prediction plan based on the agent and the node corresponding to the task in the memory graph and displaying the prediction plan; in response to receiving a confirmation operation of the prediction plan by a user, executing the prediction plan based on the agent.

10. The method of claim 1, wherein, The method further comprises: after each task in the target plan is executed, generating a reflection report corresponding to the target plan based on the execution process information and the execution result of the task in the target plan; updating the memory graph based on the reflection report.

11. A device for processing intelligent agent data based on knowledge graphs, characterized in that, The processing device comprises: a first determination module configured to determine a target plan corresponding to a demand text based on the demand text, an agent and a memory graph of the agent, wherein the target plan comprises at least one task, the memory graph is a knowledge graph formed based on memory data of the agent, and the memory graph comprises nodes corresponding to the memory data and relationships between the nodes; a second determination module configured to call a target tool corresponding to the task based on the agent to obtain execution process information and an execution result of the task; a first generation module configured to generate a node corresponding to the task based on the execution process information and the execution result of the task; a first update module configured to update the memory graph based on the node corresponding to the task; and a second update module configured to update the memory graph based on the node corresponding to the task. The first determining module comprises: a first determining submodule, configured to determine an execution target corresponding to the demand text based on the agent and the demand text, and determine whether to acquire context information based on the demand text and the execution target; a second determining submodule, configured to, if it is determined to acquire the context information, determine the context information corresponding to the demand text from the memory graph based on the agent, the demand text, and the memory graph; a generating submodule, configured to generate the target plan based on the demand text, the context information, and the agent.

12. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by the processing device to implement the steps of the method in any one of claims 1-10.

13. An electronic device, comprising: The computer program is executed by the processing device to implement the steps of the method in any one of claims 1-10. The computer program is executed by the processing device to implement the steps of the method in any one of claims 1-10. The computer program is executed by the processing device to implement the steps of the method in any one of claims 1-10.

14. A computer program product comprising a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Intelligent agent memory data processing method and system and nonvolatile storage medium

    CN119884347A

  • Knowledge graph recall-based agent question and answer method, device, equipment and product

    CN120578749A