Knowledge graph dynamic updating method based on large language model multi-agent

By adopting a multi-agent collaborative architecture based on a large language model, the problems of data quality, semantic ambiguity, and high computational resource consumption in the dynamic updating of knowledge graphs are solved, achieving efficient and accurate knowledge graph updates that can adapt to the update needs of different fields.

CN121390263APending Publication Date: 2026-01-23BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511541380.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Dynamic updates of knowledge graphs suffer from efficiency and accuracy issues due to inconsistent data quality, semantic ambiguity, knowledge conflicts, and high computational resource consumption, making it difficult to achieve efficient and accurate updates.

Method used

A multi-agent collaborative architecture based on a large language model is adopted. Through agents for entity tracking, information retrieval, entity extraction, data monitoring, and conflict resolution, the entire process from dynamic entity recognition to knowledge writing is automated. The BERT model and Neo4j database are combined for entity disambiguation, relation extraction, and conflict handling.

Benefits of technology

It achieves fully automated, timely, and accurate dynamic updates of knowledge graphs, reduces labor costs, adapts to the update needs of different fields, and ensures the timeliness and consistency of knowledge graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121390263A_ABST
    Figure CN121390263A_ABST
Patent Text Reader

Abstract

The invention provides a knowledge graph dynamic updating method based on large language model multi-agent, and relates to the technical field of data processing. The embodiment of the invention provides an automatic knowledge graph updating method based on multiple agents of a large language model, the core architecture ingeniously adopts a three-layer progressive design of an agent-LLM-storage layer, and by means of a tight annular cooperation mechanism among seven agents and strong semantic understanding and processing support of the large language model, the knowledge graph can be updated automatically, and the knowledge graph can be updated automatically. And a set of closed-loop system capable of realizing full-automatic and high-precision knowledge updating is successfully constructed through the high-efficiency graph storage capability of the preset database (Neo4j).
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of data processing, and in particular to a knowledge graph dynamic updating method based on a large language model multi-agent. BACKGROUND

[0002] As the core carrier of structured knowledge representation, the dynamic updating of the knowledge graph is the key to maintaining its timeliness and accuracy. However, in the actual updating process, it will be affected by many factors, and thus the efficiency and accuracy of the updating are not high. In terms of data, the quality of the data is uneven, and the noise, errors, and inconsistencies of the data source will introduce incorrect knowledge into the updating; in the knowledge extraction link, the accuracy of entity recognition and relationship extraction needs to be improved in the face of complex and diverse texts and data formats, and some semantically ambiguous and polysemous words are prone to extraction errors. Automatic updating may also cause knowledge conflicts, and the newly added knowledge conflicts with the original knowledge in the knowledge graph, but it is difficult to automatically and effectively resolve. In addition, the updating efficiency is also a problem, and with the increase of the size of the knowledge graph, the full updating consumes a lot of computing resources and has a high time cost, and although the incremental updating has improved, it still faces challenges in the processing of complex association relationships. Therefore, how to effectively update the knowledge graph is still an important research problem in the construction of the knowledge graph. SUMMARY

[0003] Embodiments of the present application provide a knowledge graph dynamic updating method based on a large language model multi-agent to at least partially solve the above problems.

[0004] The first aspect of the embodiments of the present application provides a knowledge graph dynamic updating method based on a large language model multi-agent, and the method comprises: In the perception stage, a dynamic entity is identified by an entity tracking agent and an information retrieval agent, and a latest information set of the dynamic entity is obtained; In the analysis stage, the latest information set is analyzed by an entity extraction agent and a relationship attribute extraction agent, entities, relationships, and attributes are extracted, relationship triples and attribute triples are obtained; In the decision stage, based on the relationship triples, the attribute triples, and the historical data in the preset database, an incremental difference detection is performed by a data monitoring agent and a conflict resolution agent, new and old data are identified, knowledge conflicts are handled, new relationship triples and new attribute triples are obtained; In the execution stage, the new relationship triples and the new attribute triples are written into the preset database by a knowledge storage agent, and the knowledge graph is updated.

[0005] Optionally, the dynamic entity is identified by the entity tracking agent and the information retrieval agent, and the latest information set of the dynamic entity is obtained, comprising: The entity tracking agent tracks entities from an initial knowledge graph, and a large language model is used to analyze the relationship characteristics and attribute characteristics of the entities to generate a dynamic entity tracking list. An information retrieval agent constructs a search formula with time constraints based on the dynamic entity tracking list, performs a search, filters the search results through a relevance scoring model, and forms a dynamic entity latest information set.

[0006] Optionally, the latest information set is parsed by an entity extraction agent and a relationship attribute extraction agent to extract entities, relationships, and attributes, and obtain relationship triples and attribute triples, including: The entity extraction agent and entity recognition prompt words are combined with the sequence labeling function of the BERT pre-training model to identify the start and end positions of candidate entities, generate a candidate entity set, perform entity disambiguation through cosine similarity calculation, and map the new entities after entity disambiguation to a preset database. The relationship attribute extraction agent and relationship attribute extraction prompt words guide the large language model to infer the relationships between entities in the preset database and perform directional verification to generate relationship triples. For structured text, attribute data is extracted through regular expressions, and for unstructured text, attribute data is extracted through the relationship attribute extraction agent and relationship attribute extraction prompt words to generate attribute triples.

[0007] Optionally, the entity extraction agent and entity recognition prompt words are combined with the sequence labeling function of the BERT pre-training model to identify the start and end positions of candidate entities, including: The entity extraction agent and entity recognition prompt words identify candidate entities from the latest information set, and based on the sequence labeling function of the BERT pre-training model, the start and end positions of the entities are identified from the latest information machine to correct the errors of the entity extraction agent in entity boundary identification.

[0008] Optionally, entity disambiguation is performed through cosine similarity calculation, including: Calculate the context vector cosine similarity between the candidate entity and the existing entity in the preset database. If the cosine similarity is higher than a preset threshold, the corresponding candidate entity and the existing entity are determined to be the same entity. If there are multiple same entities for a candidate entity, the same entity with the highest cosine similarity to the candidate entity is selected for matching.

[0009] Optionally, a data monitoring agent and a conflict resolution agent perform incremental difference detection based on the relationship triples, attribute triples, and historical data in the preset database to identify new and old data, handle knowledge conflicts, and obtain new relationship triples and new attribute triples, including: The data monitoring agent queries corresponding historical data in the preset database based on the relationship triplets and attribute triplets, identifies relationship changes and attribute changes through value comparison, and generates a list of relationships to be updated and a list of attributes to be updated; The conflict processing agent adopts a confidence-based coverage strategy, compares the confidence of new and old relationships and new and old attributes based on the list of relationships to be updated and the list of attributes to be updated, determines relationship data and attribute data with high confidence, and obtains new relationship triplets and new attribute triplets.

[0010] Optionally, the conflict processing agent adopts a confidence-based coverage strategy, compares the confidence of new and old relationships and new and old attributes based on the list of relationships to be updated and the list of attributes to be updated, determines relationship data and attribute data with high confidence, and obtains new relationship triplets and new attribute triplets. For relationship data, based on entity pair-relation type, the relationship conflict between the same head entity and tail entity is determined, and in the case that the confidence of the new relationship is higher than the confidence of the old relationship, the old relationship is replaced with the new relationship, otherwise the old relationship remains unchanged; For attribute data, based on entity-attribute-value, the attribute conflict of the same entity is determined, and in the case that the confidence of the new attribute value is higher than the confidence of the old attribute value, the old attribute value is replaced with the new attribute value, otherwise the old attribute value remains unchanged.

[0011] The second aspect of the embodiment of the application provides a knowledge graph dynamic updating device based on a large language model multi-agent, the device comprising: A perception module is configured to identify dynamic entities and obtain a latest information set of the dynamic entities through an entity tracking agent and an information retrieval agent in a perception stage. An analysis module is configured to analyze the latest information set, extract entities, relationships and attributes, obtain relationship triplets and attribute triplets through an entity extraction agent and a relationship and attribute extraction agent in an analysis stage. A decision module is configured to perform incremental difference detection based on the relationship triplets, attribute triplets and historical data in a preset database, identify new and old data, process knowledge conflicts, and obtain new relationship triplets and new attribute triplets through a data monitoring agent and a conflict resolution agent in a decision stage.

[0012] An execution module is configured to write the new relationship triplets and new attribute triplets into the preset database through a knowledge storage agent in an execution stage, and update the knowledge graph.

[0013] The third aspect of the embodiment of the present application provides an electronic device, including a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the knowledge graph dynamic updating method based on a large language model multi-agent as described in the first aspect of the present application when executed.

[0014] The fourth aspect of the embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the knowledge graph dynamic updating method based on a large language model multi-agent as described in the first aspect of the present application.

[0015] The fifth aspect of the embodiment of the present application provides a computer program product, including computer programs / instructions, which are executed by a processor to implement the steps in the knowledge graph dynamic updating method based on a large language model multi-agent as described in the first aspect of the present application.

[0016] The embodiment of the present application innovatively proposes a knowledge graph automatic updating method based on a large language model multi-agent, the core architecture of which is ingeniously designed in a three-layer progressive manner of “agent-LLM-storage layer”, and successfully builds a closed-loop system capable of realizing full-automatic and high-precision knowledge updating by means of the close ring cooperation mechanism among the seven agents, the powerful semantic understanding and processing support of the large language model, and the efficient graph storage capability of the preset database (Neo4j).

[0017] Therefore, the technical scheme provided by the embodiment of the present application can break through the bottleneck of traditional manual maintenance, and by means of the ring cooperation of the seven agents and the semantic processing capability of the large language model, the embodiment of the present application replaces the mode of relying on manual annotation and review in the traditional knowledge graph updating, realizes full-process automation from dynamic entity identification, information retrieval to knowledge writing, and greatly reduces the labor cost.

[0018] In the embodiment of the present application, by means of the multi-agent processing mode, the update cycle can be customized according to the business requirements (such as hourly or daily), and the update lag problem caused by the complicated process in the traditional method is solved, and the timeliness of the knowledge graph is ensured.

[0019] In the embodiment of the present application, dynamic entities and change information can be accurately identified: based on the dual judgment standard of “attribute dimension + relationship dimension”, the entity tracking agent can accurately locate the dynamic entities to be monitored; by means of the BERT model sequence labeling and the cosine similarity disambiguation technology, the entity extraction accuracy is significantly improved.

[0020] In the embodiment of the present application, the conflict processing agent adopts a confidence comparison strategy to reasonably verify the rationality of the new and old relationship / attribute data, avoids the coverage of false information, and guarantees the consistency and reliability of the knowledge graph.

[0021] The loosely coupled three-layer architecture of "agent-LLM-storage layer" proposed in this invention supports independent iteration of the functions of each agent (such as replacing a better retrieval model or conflict handling strategy), and can be adapted to the knowledge graph update needs of different fields such as finance, healthcare, and education.

[0022] The dynamic update process of this invention is rigorously divided into four main stages: "perception, analysis, decision-making, and execution". Through the orderly connection and coordinated operation of each stage, it ensures that the knowledge graph can be updated automatically, efficiently, and accurately. Attached Figure Description

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

[0024] Figure 1 This is a flowchart of the steps of the knowledge graph dynamic update method based on a large language model and multiple agents provided in the embodiments of the present invention; Figure 2 This is a schematic diagram of the overall architecture of the knowledge graph dynamic update method based on a large language model and multiple agents provided in the embodiments of the present invention.

[0025] Figure 3 This is a dynamic update sequence diagram of the knowledge graph dynamic update method based on a large language model and multiple agents provided in this embodiment of the invention; Figure 4 This is a hardware structure diagram of any device with data processing capabilities, which is the knowledge graph dynamic update device based on a large language model and multi-agent provided in the embodiments of the present invention. Detailed Implementation

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

[0027] In related technologies, methods for dynamic updating of knowledge graphs mainly include: The rule-based and reasoning-based update method can perform probabilistic inference on entities and relationships in a knowledge graph through rule-based reasoning, thereby enabling the updating of the knowledge graph.

[0028] An automated update method based on natural language processing (NLP) uses techniques such as semantic parsing and entity linking to extract new knowledge from text and integrate it into the graph.

[0029] The updating method based on topology and similarity obtains data of a knowledge graph topology, calculates similarity to update nodes, and optimizes the graph by using a least square method.

[0030] The updating method based on rules and reasoning needs to define a series of rules to check the consistency and integrity of the graph, and can make probabilistic inferences on entities and relationships in the knowledge graph through rule reasoning, and generate candidate facts with high confidence, thereby realizing updating of the knowledge graph.

[0031] However, the artificially defined rules are mostly for known scenarios, while entities and relationships in the knowledge graph are constantly evolving with the development of the field, making it difficult for rules to cover everything comprehensively. When facing emerging or complex correlations, there may be rule gaps, resulting in some updating requirements being missed and affecting the integrity of the graph.

[0032] In addition, the expansion of the knowledge graph leads to an exponential increase in the number of rules, and conflicts or redundancies may occur between rules due to semantic overlap. It is necessary to manually review and adjust each rule, and the rule base needs to be updated continuously with the iteration of knowledge, which requires a lot of manpower and time cost for long-term maintenance.

[0033] The automatic updating method based on natural language processing (NLP) needs to understand the semantics of the update request by establishing a semantic parsing model, map it to the corresponding entities and relationships using knowledge graph representation technology, adjust the update order and method based on the graph structure and semantic information, and verify it through automatic testing. With the help of machine learning optimization strategies, efficiency and accuracy can be improved.

[0034] However, entities in text often appear in variant forms such as aliases, abbreviations, homophones, etc., which differ from the standard naming in the graph, and the NLP technology has limited ability to recognize and match these variants, posing a challenge to entity linking, which can easily lead to incorrect connections of entities, causing updating bias.

[0035] In addition, new knowledge extracted from text may conflict with existing knowledge in the graph, but NLP methods lack a systematic conflict detection mechanism and are difficult to effectively resolve conflicts in combination with domain logic, which can easily lead to the retention of incorrect information and affect the consistency of the graph.

[0036] The updating method based on topology and similarity needs to extract edges, nodes and relationship sets from the topology graph, obtain the embedding matrix, calculate the similarity, update the nodes if the similarity is below the threshold, and finally use the least square method to fit and optimize the model to improve the quality of the graph.

[0037] However, topology analysis requires parsing the complex structure of the graph, embedding matrix calculation involves high-dimensional vector operations, and least square optimization requires repeated iterative fitting, all of which require a lot of computing power. In the context of large-scale knowledge graphs, updating delays are likely to occur, making it difficult to meet real-time requirements.

[0038] Furthermore, the least squares method, which optimizes based on the existing data distribution, may over-fit known patterns and fail to capture potential dynamic knowledge such as emerging entity relationships, thus limiting the map's ability to accommodate and adapt to new information.

[0039] Based on this, this invention proposes an automatic knowledge graph update method based on a large language model and multiple agents. By constructing a multi-agent collaborative architecture and combining the semantic understanding and reasoning capabilities of the large language model, the method achieves fully automated knowledge graph updates. This invention aims to improve the accuracy of entity recognition and linking, enhance the detection and resolution of knowledge conflicts, avoid the limitations of traditional NLP techniques in entity variant handling and conflict resolution, and ensure the accuracy and consistency of knowledge graph updates.

[0040] Unlike rule-based and reasoning-based update methods, this invention utilizes the autonomous learning and generalization capabilities of a large language model, combined with multi-agent collaboration, to construct an adaptive and evolving knowledge update logic. This invention uses a large language model to perform semantic understanding and reasoning on complex entity relationships without pre-defined rules, and combines this with dynamic optimization of update rules by multiple agents, thus overcoming the shortcomings of traditional methods such as limited rule coverage, difficulty in handling emerging entity relationships, and high maintenance costs.

[0041] Compared to topology- and similarity-based update methods, the multi-agent collaborative architecture provided in this invention significantly reduces computational costs and system complexity by decomposing tasks and processing them in parallel, eliminating the need for large-scale topology analysis and high-dimensional embedding matrix operations. Secondly, the multi-agent system, combined with machine learning optimization strategies, can continuously learn new knowledge patterns during the update process, exhibiting a stronger ability to capture dynamic information such as emerging entity relationships, thus avoiding the limitation of least squares methods overfitting known patterns. Compared to traditional methods, it can more efficiently handle the update needs of large-scale knowledge graphs, especially in scenarios with rapid knowledge iteration, enabling more timely and comprehensive graph updates.

[0042] Specifically, such as Figure 1 The diagram illustrates a flowchart of the steps in the knowledge graph dynamic update method based on a large language model multi-agent provided by an embodiment of the present invention. The method includes the following steps: S101, In the perception phase, dynamic entities are identified by entity tracking agents and information retrieval agents, and the latest information set of the dynamic entities is obtained.

[0043] S102, In the parsing phase, the latest information set is parsed by entity extraction agent and relation attribute extraction agent to extract entities, relations and attributes, and obtain relation triples and attribute triples.

[0044] S103, in the decision-making stage, by the data monitoring agent and the conflict resolution agent, based on the relationship triplets, attribute triplets and historical data in the preset database, incremental difference detection is carried out, new and old data are identified, knowledge conflicts are processed, new relationship triplets and new attribute triplets are obtained.

[0045] S104, in the execution stage, by the knowledge storage agent, the new relationship triplets and the new attribute triplets are written into the preset database, and the knowledge graph is updated.

[0046] In the embodiment of the application, the knowledge graph automatic updating method based on the large language model multi-agent is designed by adopting a three-layer progressive architecture of "agent-LLM-storage layer", which specifically includes: a multi-agent cooperation system for building a knowledge graph basic framework, an entity tracking agent responsible for dynamic entity tracking, an information retrieval agent focusing on the latest information acquisition, and a data monitoring agent specially monitoring data changes, and the like. The overall architecture is as shown in Figure 2 Specifically, in the perception stage, by means of the LLM large language model, the entity tracking agent dynamically tracks, and the information retrieval agent extracts high-confidence content through regular retrieval, so as to realize the acquisition of entity-related information.

[0047] In the analysis stage, based on the LLM large language model, the entity extraction agent and the relationship / attribute extraction agent respectively perform entity extraction and relationship / attribute extraction, and extract entities and knowledge elements such as relationships and attributes between entities from the acquired information.

[0048] In the decision-making stage, the data monitoring agent compares and identifies changes in data, and monitors the changes in data. Then, according to the confidence coverage principle, the conflict processing agent processes possible knowledge conflicts, so as to ensure the accuracy of the knowledge.

[0049] Finally, in the decision-making stage, the knowledge storage agent stores the processed knowledge into the preset database (neo4j). In addition, in the embodiment of the application, a visual system can also be provided to support Cypher query, text query and other operations, and to realize knowledge display and other related operations.

[0050] In the embodiment of the present application, at the top agent layer, the 7 agents cooperate in a ring shape to form a complete link for data processing: the entity tracking agent and the information retrieval agent constitute the data input end, responsible for obtaining the entity to be updated and the latest information; the knowledge storage agent is the output end, responsible for writing the processed knowledge into the database; the entity extraction agent, the relationship attribute extraction agent, the data monitoring agent and the conflict processing agent are intermediate processing nodes, which complete information parsing, difference detection and conflict resolution in turn. The agents realize data interaction through preset interfaces, for example, the entity tracking agent outputs the dynamic entity list to the information retrieval agent in JSON format, and the information retrieval agent returns the latest information set in the form of a structured dictionary.

[0051] In the middle LLM support layer, the core agent calls LLM through API to realize semantic understanding, entity recognition and other core tasks. When calling, the parameter optimization strategy is adopted: temperature is set to 0.3 to ensure the stability of the output, max_tokens is dynamically adjusted according to the task type, entity recognition task is set to 500, and relationship reasoning is set to 1000. For batch processing scenarios, an asynchronous calling mechanism is adopted, 20 tasks are processed in each batch to avoid interface timeout.

[0052] In the bottom storage layer, Neo4j graph database is used to store the knowledge graph, and Cypher query language is used to support the addition, deletion, modification and query of triples. The database design includes entity table, relationship table and attribute table, and the query efficiency is improved through index optimization.

[0053] In the embodiment of the present application, the dynamic update process of the three-layer progressive architecture design is strictly divided into four main stages of "perception-analysis-decision-execution", and through the orderly connection and cooperative operation of each stage, it can ensure that the knowledge graph can be automatically updated with high timeliness and high accuracy. Figure 3 The dynamic update timing diagram clearly shows the execution order of the 7 agents under the scheduling of the main program, as shown in Figure 3As shown, the interaction logic between the main program and the plurality of agents is shown, specifically including: the main program first loads the initial entity list, and triggers the entity tracking agent to start working, then the entity tracking agent outputs the dynamic entity list to the main program, the main program passes the dynamic entity list to the information retrieval agent, and obtains the latest information of the dynamic entity from the information retrieval agent. The main program sends the latest information to the entity extraction agent, extracts the entity, obtains the entity list, and sends the latest information to the relationship and attribute extraction agent, extracts the relationship and attribute, and obtains the relationship list and attribute list. After the main program obtains the entity list, relationship list and attribute list, the data monitoring agent detects the difference between new and old data, determines the changed relationship and attribute, and sends it to the main program. The main program further solves the conflict between the new and old data through the conflict processing agent, and stores the new triple in the knowledge storage agent after completing the conflict resolution.

[0054] Specifically, in the embodiment of the application, the execution order of the 7 agents under the scheduling of the main program presents a high-efficiency collaborative mode combining "serial + parallel". In the starting phase, the main program first loads the initial entity list and triggers the entity tracking agent to start working; in the perception phase, the parallel mode is adopted, and when the entity tracking agent outputs the dynamic entity list, the information retrieval agent starts immediately, and no other agent participates in this phase, the purpose being to ensure the uniqueness and accuracy of the retrieval data; the analysis phase is also a parallel mode, and after the information retrieval is completed, the entity extraction agent and the relationship and attribute extraction agent work synchronously, respectively outputting the entity list and the triple set, greatly shortening the analysis time consumption; the decision-making phase is a serial mode, first comparing the difference between the new and old data by the data monitoring agent, and then solving the conflict by the conflict processing agent, strictly ensuring the processing order to avoid logical confusion; in the execution phase, the knowledge storage agent writes the processed knowledge into the database, and returns the "update success" signal to the main program after completion, and the main program enters the waiting state until the next time trigger.

[0055] The perception phase is the starting point of knowledge update, which is mainly completed by the entity tracking agent and the information retrieval agent, and the core goal is to accurately identify dynamic entities and obtain their latest information.

[0056] Specifically, the step S101 includes the following sub-steps: S1011, through the entity tracking agent, the relationship features and attribute features of the entity are analyzed from the entity set of the initial knowledge graph through a large language model to generate a dynamic entity tracking list.

[0057] S1012, through the information retrieval agent, a retrieval formula containing time constraints is constructed based on the dynamic entity tracking list, retrieval is performed, and a dynamic entity latest information set is formed by screening the retrieval results through a relevance scoring model.

[0058] In the embodiments of the present application, the core function of the entity tracking agent is to accurately identify dynamic entities from the initial knowledge graph and generate the tracking list. The operation mechanism is as follows: taking the entity set in the initial knowledge graph as input, the relationship features and attribute features of each entity are deeply semantically analyzed by a large language model, and the determination of whether the entity has timeliness features is focused.

[0059] The determination logic of the timeliness feature is to perform semantic reasoning on the entity attributes and relationships by LLM, and set double determination standards: attribute dimension: if the attribute value meets the "time-sensitive" or "high-frequency change" type, it is marked as a dynamic attribute; relationship dimension: if the relationship has "time constraint" or "state dependence", it is marked as a dynamic relationship.

[0060] After model reasoning, a structured dynamic entity tracking list is output, which includes dynamic entities, dynamic relationship types or attribute items that need to be continuously monitored, and keyword combinations customized for subsequent information retrieval, thereby providing accurate tracking targets for dynamic updating of the knowledge graph.

[0061] For the dynamic entity list generated by the entity tracking agent, the information retrieval agent uses a multi-strategy cooperative approach to obtain the latest data. First, based on the entity keywords and tracking dimensions in the list, a search formula with time constraints is automatically constructed, and by embedding time prefixes such as "latest" and "current" in the keyword set, the timeliness of the search results is improved.

[0062] To break through the access restrictions of multiple information sources, dynamic User-Agent generation and proxy IP pool management can be used: the former can randomly simulate different browser version numbers such as Chrome and Safari, as well as corresponding operating systems and device types, to avoid being identified as a crawler by the server; the latter requires maintaining a large number of high-anonymity proxy IPs and dynamically adjusting them according to the "switch 1 IP every 5 requests" strategy, while coordinating a random request interval of 3-5 seconds, to reduce the risk of IP being banned, thereby effectively avoiding the interference of anti-crawling mechanisms on data acquisition. In the data screening link, the search results are sorted by a pre-set relevance scoring model, and high-confidence content is extracted first, finally forming a structured dynamic entity latest information set, providing high-quality data input for subsequent knowledge extraction and graph updating.

[0063] In the embodiments of the present application, the information retrieval agent can break through the limitations of a single data source, obtain high-quality information from multiple channels, and effectively avoid anti-crawling mechanisms, thereby improving the success rate of information acquisition.

[0064] In the embodiment of the application, the core task of the analysis stage is to deeply analyze the latest information obtained in the perception stage, extract entities, relationships and attributes therefrom, and provide structured triple data for knowledge graph updating. Specifically, the step S102 includes the following sub-steps: S1021, through the entity extraction agent and the entity recognition prompt word, the starting and ending positions of the candidate entity are identified by combining the sequence labeling function of the BERT pre-training model, a candidate entity set is generated, entity disambiguation is performed through cosine similarity calculation, and the new entity after entity disambiguation is mapped to a preset database.

[0065] In the entity extraction link, first, a precise entity recognition prompt is constructed based on a large language model, and a double-task guided mode of "entity type + boundary positioning" is adopted. After the entity boundary verification link, the prompt is designed as "please extract entities from the following text, the extraction format is [entity text, type], and the entity types include person, organization, place, event, etc.", and the model is guided to focus on entity extraction through clear task instructions. At the same time, in order to further improve the accuracy of entity boundary recognition, the agent will combine the sequence labeling function of the BERT pre-training model to position the boundary - the BERT model can accurately identify the starting and ending positions of the entity through deep learning of the text sequence, so as to correct the errors that may occur in the entity boundary recognition process of the large language model, and finally generate a candidate entity set containing entity text and corresponding types.

[0066] Specifically, candidate entities can be identified from the latest information set through the entity extraction agent and the entity recognition prompt word, and the starting and ending positions of the entities can be identified from the latest information set based on the sequence labeling function of the BERT pre-training model, so as to correct the errors of the entity extraction agent in entity boundary recognition Specifically, in the embodiment of the application, entity disambiguation can be achieved through the following steps: S1, calculate the context vector cosine similarity of the candidate entity and the existing entity in the preset database.

[0067] S2, in the case where the cosine similarity is higher than a preset threshold, the corresponding candidate entity and the existing entity are determined as the same-named entity.

[0068] S3, in the case where a certain candidate entity has multiple same-named entities, the same-named entity with the highest cosine similarity with the candidate entity is selected for matching.

[0069] In the embodiment of the application, after the candidate entity set is generated, to solve the ambiguity problem caused by entities with the same name, the intelligent agent will use entity disambiguation technology on the candidate entities: by calculating the semantic similarity of the candidate entities and the existing entities in the knowledge graph (for example, using the cosine similarity algorithm to compare the context vector representations of the two), if the similarity is higher than a preset threshold, it is determined that they are the same entity; if there are multiple entities with the same name and the semantic similarity is different, the one with the highest similarity is selected as the matching item, so as to clearly determine the real direction of the candidate entity. Then, with the help of entity linking technology, the disambiguated new entity is accurately mapped to the corresponding unique ID in the Neo4j database: if the entity already exists in the database, its ID is directly associated; if it is a new entity, a new unique ID is automatically generated, and the corresponding type label is assigned to it according to the entity type, finally realizing the normalization processing of the entity, ensuring the uniqueness and consistency of the entity in the knowledge graph.

[0070] In S1022, the relationship attribute extraction intelligent agent and the relationship attribute extraction prompt word are extracted to guide the large language model to infer the relationship between the entities in the preset database and perform directional verification to generate relationship triples; for structured text, attribute data is extracted through regular expression, and for unstructured text, attribute data is extracted through the relationship attribute extraction intelligent agent and the relationship attribute extraction prompt word to generate attribute triples.

[0071] In the relationship and attribute extraction link, the intelligent agent adopts a targeted processing strategy: for relationship extraction, the input mode of "entity pair + context" is adopted, that is, the entity pair to be analyzed and the text context in which they are located are input into the large language model at the same time, and the model is guided to infer the relationship between the entities through careful design of Prompt Engineering. After the relationship is extracted, directional verification is performed to ensure that the starting entity and the target entity of the relationship are correct, and finally structured relationship triples are generated.

[0072] For the extraction of attribute characteristics of entities, a hybrid method combining rules and deep learning can be used: when processing structured text, the attribute name and its corresponding attribute value are accurately matched through a predefined regular expression - for example, for a text such as "height: 180 cm", the regular expression "height: (.*?) cm" can be used to extract the attribute name "height" and the attribute value "180"; when processing unstructured text, the large language model prompt is used for guidance extraction, so as to ensure the effective extraction of attribute information in different types of text.

[0073] In the embodiment of the application, the relationship attribute extraction intelligent agent adopts a "rule + deep learning" hybrid method, which can quickly parse structured text through regular expressions and can also use a large language model to extract implicit knowledge from unstructured text, covering a wider range of information sources.

[0074] In the embodiment of the present application, the perception stage and the analysis stage adopt a parallel processing mode (such as entity extraction and relationship attribute extraction are performed synchronously), which can greatly shorten the single round update cycle; the batch task adopts an asynchronous calling mechanism, and each batch can process 20 tasks, thereby improving the system throughput.

[0075] In the decision stage, the data monitoring agent identifies the differences between the new and old data through an incremental difference detection mechanism. The process is as follows: first, receive the structured data (i.e. attribute triple) containing the newly extracted entity relationship (i.e. relationship triple) and attribute, based on the two-level identification system of "entity pair-relation type" (corresponding to relationship triple) and "entity-attribute-value" (corresponding to attribute triple), call the knowledge storage agent interface to query the existing relationship of the corresponding entity pair and the historical attribute value of the entity-attribute binary tuple in the Neo4j graph database; then, through the value-based difference detection method, directly compare the new relationship type with the old relationship type, and the new attribute value with the old attribute value, identify the relationship changes and attribute changes, and classify these changes into the relationship update list and the attribute update list respectively, and finally output the structured update data as the basis for subsequent processing. The whole process only focuses on the changed part of the new and old data, and realizes the accurate capture of the dynamic changes of the knowledge graph.

[0076] Specifically, the step S103 includes the following sub-steps: S1031, query the corresponding historical data in the preset database based on the relationship triple and the attribute triple through the data monitoring agent, identify the relationship changes and attribute changes through value comparison, and generate the relationship update list and the attribute update list.

[0077] S1032, through the conflict processing agent, adopt a confidence-based coverage strategy, compare the confidence of the new and old relationships and attributes based on the relationship update list and the attribute update list, determine the relationship data and attribute data with high confidence, and obtain new relationship triple and new attribute triple.

[0078] After obtaining the relationship update list and the attribute update list returned by the data monitoring agent, the conflict resolution agent adopts a confidence-based coverage strategy to process knowledge conflicts. Specifically, for relationship conflicts, a new and old confidence comparison replacement strategy is adopted, for example, it is detected that there is an existing relationship between the same head entity and tail entity, and the new and old relationship confidences are compared. If the new relationship confidence is high, the new relationship replaces the old relationship, otherwise it remains unchanged. The attribute conflict processing method is similar.

[0079] Specifically, the step S1032 includes the following sub-steps: S10321, for the relationship data, based on the entity pair-relation type, determining the relationship conflict between the same head entity and tail entity, in the case of new relationship confidence higher than the old relationship confidence, replacing the old relationship with the new relationship, otherwise keeping the old relationship unchanged.

[0080] S10322, for the attribute data, based on the entity-attribute-value, determining the attribute conflict of the same entity, in the case of new attribute value confidence higher than the old attribute value confidence, then replacing the old attribute value with the new attribute value, otherwise keeping the old attribute value unchanged.

[0081] In the embodiment of the application, in the execution stage, for the relationship triple list and attribute triple list processed by the conflict resolution agent, the knowledge storage agent is called, and the processed knowledge is stored in the neo4j database. At the same time, the schedule library triggers the task at regular intervals to ensure the automatic and continuous updating of the knowledge graph.

[0082] In the embodiment of the application, the complex technical details such as entity linking and relationship reasoning are encapsulated in the agent, so that the user can realize dynamic maintenance of the knowledge graph without mastering the underlying algorithm, and the technical application threshold is reduced.

[0083] In the embodiment of the application, through the structured storage and Cypher query support of the Neo4j database, the knowledge updating process is traceable, which facilitates the user to verify the updating result and troubleshoot problems.

[0084] Based on the same inventive concept, the embodiment of the application also provides a knowledge graph dynamic updating device based on a large language model multi-agent, which comprises: A perception module is configured to identify dynamic entities and obtain the latest information set of the dynamic entities through an entity tracking agent and an information retrieval agent in a perception stage. An analysis module is configured to analyze the latest information set, extract entities, relationships and attributes, obtain relationship triples and attribute triples through an entity extraction agent and a relationship attribute extraction agent in an analysis stage. A decision module is configured to perform incremental difference detection based on the relationship triples, attribute triples and historical data in a preset database, identify new and old data, process knowledge conflicts, and obtain new relationship triples and new attribute triples through a data monitoring agent and a conflict resolution agent in a decision stage.

[0085] An execution module is configured to write the new relationship triples and new attribute triples into the preset database through a knowledge storage agent in an execution stage, and update the knowledge graph.

[0086] Optionally, the perception module is configured to: The entity tracking agent is used for tracking entities from an entity set of an initial knowledge graph, analyzing relationship features and attribute features of the entities by using a large language model, and generating a dynamic entity tracking list; The information retrieval agent is used for constructing a search formula with time constraints based on the dynamic entity tracking list, performing search, screening search results by using a correlation scoring model, and forming a dynamic entity latest information set.

[0087] Optionally, the analysis module is configured to: The entity extraction agent and the entity recognition prompt word are used to identify the start and end positions of candidate entities by using a sequence labeling function of a BERT pre-training model, generate a candidate entity set, perform entity disambiguation by using cosine similarity calculation, and map new entities after entity disambiguation to a preset database. The relationship attribute extraction agent and the relationship attribute extraction prompt word are used to guide a large language model to infer relationships between entities in the preset database and perform directional verification, generate relationship triples, extract attribute data from structured text by using a regular expression, extract attribute data from unstructured text by using the relationship attribute extraction agent and the relationship attribute extraction prompt word, and generate attribute triples.

[0088] Optionally, the analysis module is configured to: The entity extraction agent and the entity recognition prompt word are used to identify candidate entities from the latest information set, identify the start and end positions of entities in the latest information set based on a sequence labeling function of a BERT pre-training model, and correct errors of the entity extraction agent in entity boundary identification.

[0089] Optionally, the analysis module is configured to: The cosine similarity of context vectors of a candidate entity and an existing entity in a preset database is calculated. In a case where the cosine similarity is higher than a preset threshold, the corresponding candidate entity and the existing entity are determined as the same-named entity. In a case where a certain candidate entity has multiple same-named entities, the same-named entity with the highest cosine similarity with the candidate entity is selected for matching.

[0090] Optionally, the decision module is configured to: The data monitoring agent is used for querying corresponding historical data in the preset database based on the relationship triples and the attribute triples, identifying relationship changes and attribute changes by value comparison, and generating a to-be-updated relationship list and a to-be-updated attribute list. The conflict processing agent adopts a confidence-based coverage strategy, compares the confidence degrees of new and old relations and new and old attributes based on the to-be-updated relation list and the to-be-updated attribute list, determines the relation data and attribute data with high confidence degrees, and obtains new relation triples and new attribute triples.

[0091] Optionally, the decision module is configured to: For relation data, determine the relation conflict between the same head entity and tail entity based on entity pair-relation type, replace the old relation with the new relation if the new relation confidence degree is higher than the old relation confidence degree, and otherwise keep the old relation unchanged; For attribute data, determine the attribute conflict of the same entity based on entity-attribute-value, replace the old attribute value with the new attribute value if the new attribute value confidence degree is higher than the old attribute value confidence degree, and otherwise keep the old attribute value unchanged.

[0092] The embodiment of the knowledge graph dynamic updating device based on the large language model multi-agent provided by the application can be applied to any device with data processing capability, which can be a device or apparatus such as a computer. The device embodiment can be realized by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory and running by the processor of the device with data processing capability. From the hardware level, as shown in Figure 4 The device provided by the application is a hardware structure diagram of a device with data processing capability, in addition to the processor, memory, network interface, and non-volatile memory shown in Figure 4 In addition to the processor, memory, network interface, and non-volatile memory shown in the embodiment, the device with data processing capability in the embodiment usually includes other hardware according to the actual function of the device with data processing capability, which will not be described again.

[0093] Based on the same inventive concept, the embodiment of the application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the knowledge graph dynamic updating method based on the large language model multi-agent when executed.

[0094] Based on the same inventive concept, the embodiment of the application further provides a computer readable storage medium, which stores a computer program, and the program implements the steps of the knowledge graph dynamic updating method based on the large language model multi-agent when executed by the processor.

[0095] Based on the same inventive concept, the embodiments of the present application provide a computer program product comprising computer programs / instructions which, when executed by a processor, implement the steps of the method for dynamically updating a knowledge graph based on a large language model multi-agent according to any of the above embodiments.

[0096] Each of the embodiments in the specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other.

[0097] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device, or computer program product. Therefore, the embodiments of the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.

[0098] The embodiments of the present application are described with reference to flowcharts and / or block diagrams according to the method, terminal device (apparatus), and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable terminal device produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one flow or multiple flows and / or blocks

[0099] These computer program instructions can also be stored in a computer readable storage medium that can direct the computer or other programmable terminal device to work in a specific manner, so that the instructions stored in the computer readable storage medium produce a product including instruction devices that implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one flow or multiple flows and / or blocks

[0100] These computer program instructions can also be loaded into a computer or other programmable terminal device, so that a series of operation steps are performed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1The steps of the function specified in one or more boxes.

[0101] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.

[0102] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0103] The present invention provides a detailed description of a method for dynamic updating of knowledge graphs based on a large language model and multiple agents. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for dynamic updating of a knowledge graph based on a large language model multi-agent, characterized in that, The method comprises: In the perception stage, the dynamic entity is identified by the entity tracking agent and the information retrieval agent, and the latest information set of the dynamic entity is obtained; In the analysis stage, the latest information set is analyzed by the entity extraction agent and the relation attribute extraction agent, and the entity, relation and attribute are extracted to obtain the relation triple and the attribute triple; In the decision stage, based on the relation triple, the attribute triple and the historical data in the preset database, the incremental difference detection is performed by the data monitoring agent and the conflict resolution agent, the new and old data are identified, the knowledge conflict is handled, and the new relation triple and the new attribute triple are obtained; In the execution stage, the new relation triple and the new attribute triple are written into the preset database by the knowledge storage agent, and the knowledge graph is updated.

2. The method of claim 1, wherein the method is based on a large language model multi-agent knowledge graph dynamic update method. The entity tracking agent and the information retrieval agent identify the dynamic entity and obtain the latest information set of the dynamic entity, comprising: The entity tracking agent analyzes the relation features and attribute features of the entity from the entity set of the initial knowledge graph by the large language model to generate a dynamic entity tracking list; The information retrieval agent constructs a search formula with time constraints based on the dynamic entity tracking list, performs search, filters the search results by a relevance scoring model, and forms a dynamic entity latest information set.

3. The method of claim 1, wherein the method further comprises: The entity extraction agent and the relation attribute extraction agent analyze the latest information set, extract the entity, relation and attribute, and obtain the relation triple and the attribute triple, comprising: The entity extraction agent and the entity recognition prompt word are combined with the sequence labeling function of the BERT pre-training model to identify the start and end positions of the candidate entity, generate a candidate entity set, perform entity disambiguation by cosine similarity calculation, and map the new entity after entity disambiguation to the preset database; The relation attribute extraction agent and the relation attribute extraction prompt word guide the large language model to infer the relations between the entities in the preset database and perform directional verification to generate the relation triple; for structured text, the attribute data is extracted by regular expression, and for unstructured text, the attribute data is extracted by the relation attribute extraction agent and the relation attribute extraction prompt word to generate the attribute triple.

4. The method of claim 3, wherein the method further comprises: The entity extraction agent and the entity recognition prompt word are combined with the sequence labeling function of the BERT pre-training model to identify the start and end positions of the candidate entity, comprising: The entity extraction agent and the entity recognition prompt word identify the candidate entity from the latest information set, and the sequence labeling function of the BERT pre-training model is used to identify the start and end positions of the entity in the latest information set to correct the errors of the entity extraction agent in the entity boundary identification.

5. The method of claim 3, wherein the method further comprises: Entity disambiguation by cosine similarity calculation, comprising: Calculate the context vector cosine similarity of the candidate entity and the existing entity in the preset database; In the case where the cosine similarity is higher than a preset threshold, the corresponding candidate entity and the existing entity are determined as the same named entity; In the case where a certain candidate entity has multiple same named entities, the same named entity with the highest cosine similarity with the candidate entity is selected for matching.

6. The method of claim 1, wherein the method is based on a large language model multi-agent knowledge graph dynamic update method. The data monitoring agent and the conflict resolution agent perform incremental difference detection based on the relationship triplets, the attribute triplets and historical data in the preset database, identify new and old data, handle knowledge conflicts, obtain new relationship triplets and new attribute triplets, including: The data monitoring agent queries corresponding historical data in the preset database based on the relationship triplets and the attribute triplets, identifies relationship changes and attribute changes through value comparison, and generates a to-be-updated relationship list and a to-be-updated attribute list; The conflict processing agent adopts a coverage strategy based on confidence, compares the confidence of new and old relationships and new and old attributes based on the to-be-updated relationship list and the to-be-updated attribute list, determines relationship data and attribute data with high confidence, and obtains new relationship triplets and new attribute triplets.

7. The method of claim 6, wherein the method further comprises: The conflict processing agent adopts a coverage strategy based on confidence, compares the confidence of new and old relationships and new and old attributes based on the to-be-updated relationship list and the to-be-updated attribute list, determines relationship data and attribute data with high confidence, including: For relationship data, based on entity pair-relation type, the relationship conflict between the same head entity and tail entity is determined, and in the case that the confidence of the new relationship is higher than that of the old relationship, the old relationship is replaced by the new relationship, otherwise the old relationship remains unchanged; For attribute data, based on entity-attribute-value, the attribute conflict of the same entity is determined, and in the case that the confidence of the new attribute value is higher than that of the old attribute value, the old attribute value is replaced by the new attribute value, otherwise the old attribute value remains unchanged.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the knowledge graph dynamic updating method based on the large language model multi-agent of any one of claims 1-7.

9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the knowledge graph dynamic updating method based on the large language model multi-agent of any one of claims 1-7.

10. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to realize the steps in the knowledge graph dynamic updating method based on the large language model multi-agent of any one of claims 1-7.