Agent-driven medical knowledge graph updating method and system

By using an agent-driven approach and leveraging LLM to determine the update strategy for the medical knowledge graph, generating a candidate operation set and verifying consistency, the logical conflict problem of updating new information in the medical knowledge graph is resolved. This achieves accurate knowledge assimilation and global consistency, and improves the learning efficiency and knowledge retention of large-scale language models.

CN122387477APending Publication Date: 2026-07-14SHANDONG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG UNIV
Filing Date
2026-04-17
Publication Date
2026-07-14

Smart Images

  • Figure CN122387477A_ABST
    Figure CN122387477A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of knowledge graph updating, and particularly discloses a medical knowledge graph updating method and system based on an agent drive, which comprises the following steps: when new medical information is received, an agent based on an LLM retrieves relevant existing facts from a main knowledge graph, determines the core semantic connotation of the new information, and generates a candidate scheme set containing multiple candidate atomic operations; for each candidate operation in the candidate scheme set, a corresponding confidence score and evaluation reason are generated by executing an evaluation function; the optimal candidate operation scheme is selected as an updating plan by maximizing the confidence score; an influence domain subgraph related to the updating plan to be executed is constructed based on the main knowledge graph; the updating plan is executed on the influence domain subgraph to generate a simulated subgraph state, and the agent is used to check whether the subgraph state violates consistency. The application solves dynamic decision ambiguity at the fact and procedure levels and realizes accurate modeling of knowledge evolution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph updating technology, and in particular to a method and system for updating medical knowledge graphs based on agent-driven intelligence. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] As a structured representation of real-world facts, knowledge graphs have become an indispensable infrastructure for artificial intelligence applications. However, the real world is inherently dynamic and evolving; facts change over time, new knowledge emerges constantly, and existing information may become obsolete. This static perspective limits the practical utility of knowledge graphs because it fails to address the critical domain requirements of incrementally acquiring knowledge from streaming data, maintaining global logical consistency in conflict scenarios, and mitigating factual errors during integration updates.

[0004] This need is particularly prominent in medical knowledge graphs. Medical knowledge itself is highly dynamic: new drug approvals, clinical guideline updates, disease classification adjustments, and the discovery of drug contraindications all require knowledge graphs to have continuous evolution capabilities. Static medical knowledge graphs cannot reflect this change. Directly covering old facts or simply merging new data may lead to logical conflicts (such as labeling the same patient as both "suitable" and "contraindicated" for the same drug) or introduce unverified erroneous information (such as treatment relationships constructed based on retracted papers).

[0005] Existing technologies that disclose temporal knowledge graphs (TKGs) focus on explicitly modeling the temporal validity of facts. However, their core focus remains on predicting temporal links based on existing patterns, rather than semantically assimilating and disambiguating new information from external sources. They cannot be used to parse updates in natural language forms, nor can they decide how to integrate them into the graph structure to achieve incremental learning.

[0006] Some existing technologies focus on targeted modifications and fact corrections, but their limitation lies in treating editing as discrete, independent events, failing to fully consider the cascading effects of a single update on the entire graph and macroscopic logical consistency. While the problem of handling conflicting information has been partially solved in the field of knowledge fusion, they lack the sophisticated semantic reasoning capabilities required to handle complex update operations such as time-bound or fact archiving.

[0007] The emergence of large language models (LLMs) has provided a powerful new tool for this purpose, with its strong semantic understanding and reasoning capabilities driving the dynamic evolution of knowledge graphs. However, directly applying LLMs can lead to ambiguity and randomness in their decision-making process. Local atomic update operations lack awareness of the global topological structure, which can easily trigger a chain reaction of logical conflicts. Summary of the Invention

[0008] To address the aforementioned issues, this invention proposes a method and system for updating medical knowledge graphs based on agent-driven approaches. By analyzing factual content and using evidence-driven reasoning, semantic and procedural ambiguities in the process of assimilating new knowledge are eliminated. A prospective consistency verification mechanism is introduced as a safety filter, which uses the influence domain subgraph to rehearse update operations in an isolated sandbox to proactively intercept potential conflicts that could disrupt global logic.

[0009] In some implementations, the following technical solutions are adopted: A method for updating a medical knowledge graph based on agent-driven intelligence, comprising: When new medical information is received, the LLM-based agent retrieves relevant existing facts from the main knowledge graph to determine the core semantic connotation of the new information; and generates a set of candidate schemes containing multiple candidate atomic operations based on the core semantic connotation. For each candidate operation in the candidate solution set, the agent generates a corresponding confidence score and evaluation reason by executing an evaluation function; and selects the optimal candidate operation solution as the update plan by maximizing the confidence score. Construct an influence domain subgraph related to the update plan to be executed based on the main knowledge graph; execute the update plan on the influence domain subgraph to generate a simulated subgraph state; and use the agent to check whether the subgraph state violates consistency. If the rules are not violated, the update plan is added to the execution queue; otherwise, the update plan is rejected.

[0010] As a further provision, before the update plan is executed, the following steps are also included: Using the update plan to be executed as input, a query generation function is used to generate one or more structured graph query statements; the graph query statements are then used to retrieve contextual information related to the update plan from the main knowledge graph. The context information is linearized to convert it into a coherent natural language description; the natural language description is then concatenated with new medical information and the update plan is added to form a complete learning sample for updating the agent's knowledge and capabilities.

[0011] As a further approach, an experience replay pool is configured to store the constructed learning samples. During the training phase of the agent, learning samples are uniformly sampled from the experience replay pool, and the agent is fine-tuned using low-rank adaptive LoRA technology.

[0012] As a further option, the new medical information includes, but is not limited to: new drug announcements, updated clinical guidelines, new medical literature, adjustments to disease classifications, or new drug contraindications.

[0013] As a further solution, the core semantic connotation specifically includes: fact correction, fact supplementation, or time limitation; The aforementioned fact correction refers to the use of new medical information to correct an existing but outdated or incorrect statement in the main knowledge graph; The additional fact is that the new medical information is entirely new and an independent fact that does not directly conflict with the content in the main knowledge graph; The aforementioned time constraint means that new medical information does not negate the existence of existing facts in the main knowledge graph, but rather defines an effective time boundary for them, while introducing new facts that are sequential in time.

[0014] As a further approach, a candidate scheme set containing multiple candidate atomic operations is generated based on the core semantic connotation, specifically: The agent is guided to generate a set of candidate schemes containing multiple candidate atomic operations for each core semantic connotation through structured output prompts. The candidate atomic operations include: adding new triplet fact supplements, replacing old objects with new objects, and adding end time attributes to existing facts to indicate their timeliness; The structured output prompts include: detailed instructions, API definitions, and CoT guidance; the structured output prompts are dynamically compressed using prompt word compression technology.

[0015] As a further approach, for each candidate operation in the candidate solution set, the agent generates a corresponding confidence score and evaluation reason by executing an evaluation function, specifically as follows: The agent extracts contextual evidence from new medical information, calculates the logical fit between each candidate operation and the contextual evidence, and quantifies and outputs a real number in the interval [0, 1] as a confidence score; the confidence score reflects the correctness of each candidate operation under the current contextual evidence. At the same time, the agent explicitly weighs the potential clinical consequences of adding, replacing, or archiving a medical fact, and clarifies in natural language whether the candidate operation meets the timeline and mutual exclusion rules of the current medical guidelines, using the natural language as the evaluation reason.

[0016] As a further solution, an influence domain subgraph related to the update plan to be executed is constructed based on the main knowledge graph, specifically as follows: The set of entities involved in the pending update plan E Centered on, through execution k Use a jump neighbor query to extract all relevant entities and relationships.

[0017] In other embodiments, the following technical solutions are adopted: A medical knowledge graph update system based on agent-driven intelligence, comprising: The multi-hypothesis operation generation module is configured to, upon receiving new medical information, use an LLM-based agent to retrieve relevant existing facts from the main knowledge graph, determine the core semantic connotation of the new information, and generate a candidate scheme set containing multiple candidate atomic operations based on the core semantic connotation. The optimal decision module is configured to, for each candidate operation in the candidate solution set, generate a corresponding confidence score and evaluation reason by executing an evaluation function; and select the optimal candidate operation as the update plan by maximizing the confidence score. The consistency verification module is configured to construct an influence domain subgraph related to the update plan to be executed based on the main knowledge graph; execute the update plan on the influence domain subgraph to generate a simulated subgraph state; and use the agent to check whether the subgraph state violates consistency. If the rules are not violated, the update plan is added to the execution queue; otherwise, the update plan is rejected.

[0018] As a further option, it also includes: The context-aware continuous learning module is configured to take an update plan to be executed as input, generate one or more structured graph query statements using a query generation function, and retrieve context information related to the update plan from the main knowledge graph using the graph query statements; The context information is linearized to convert it into a coherent natural language description; the natural language description is then concatenated with new medical information and the update plan is added to form a complete learning sample for updating the agent's knowledge and capabilities.

[0019] Compared with the prior art, the beneficial effects of the present invention are: (1) When new information arrives, the core challenge is to guide the LLM to make the most accurate knowledge assimilation strategy. This invention aims to explore a mechanism that enables agents to uniformly reason about the factual content of new information, that is, to determine whether it is to correct existing facts, supplement new information or add time constraints to old facts, and to autonomously match the most appropriate update operation, such as direct replacement, adding limiting conditions or archiving old information and creating new entries, thereby resolving the dynamic decision-making ambiguity at the factual and procedural levels and realizing accurate modeling of knowledge evolution.

[0020] (2) An update that appears correct locally may trigger a chain reaction that disrupts the global logic in a highly interconnected knowledge network, and existing LLMs lack native awareness of such systemic risks during the reasoning process. This invention designs a forward-looking risk assessment framework that enables agents to proactively simulate the potential impact on relevant knowledge subgraphs before submitting updates, thereby anticipating and avoiding downstream logical conflicts and ensuring the long-term health and consistency of the entire knowledge base.

[0021] Other features and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0022] Figure 1 This is a flowchart of the agent-driven medical knowledge graph update method in an embodiment of the present invention; Figure 2 This is a schematic diagram of the agent-driven medical knowledge graph update process in an embodiment of the present invention; Figure 3 This diagram illustrates the impact of compression ratio on model effectiveness and relative token consumption in an embodiment of the present invention. Detailed Implementation

[0023] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0024] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0025] Example 1 In one or more embodiments, a method for updating a medical knowledge graph based on agent-driven intelligence is disclosed, combining... Figure 1 Specifically, it includes the following processes: S101: When new medical information is received, the LLM-based agent retrieves relevant existing facts from the main knowledge graph to determine the core semantic connotation of the new information; and generates a candidate scheme set containing multiple candidate atomic operations based on the core semantic connotation.

[0026] In this embodiment, new medical information includes, but is not limited to: new drug announcements, updated clinical guidelines, new medical literature, adjustments to disease classifications, or new drug contraindications.

[0027] The main sources of data for the medical knowledge graph include: structured data such as tabular data in electronic medical records, drug databases, and ICD disease classification codes; semi-structured data such as encyclopedia pages on medical websites and clinical guidelines in XML format; and unstructured data such as massive amounts of medical literature, text paragraphs of treatment guidelines, and image reports.

[0028] The main knowledge graph typically uses objective medical concepts such as diseases, drugs, symptoms, examinations, genes, and surgeries as entities, and constructs triples with possible logical relationships between entities, such as treatment, contraindications, and causes, as edges. For example: (disease)-[treatment]-(drug), (disease)-[symptom]-(clinical manifestation), (drug)-[contraindication]-(population), (gene)-[cause]-(disease), etc.

[0029] In this embodiment, new information is presented in natural language. and relevant existing facts retrieved from the knowledge graph Using LLM's powerful contextual learning capabilities as input, we designed a few-sample prompt containing several typical examples to guide LLM in semantic comparison and relational analysis of new and old information.

[0030] The relevant existing facts are obtained by matching the information retrieval module with the underlying structure of the graph. The system extracts core medical entities from newly input unstructured text and uses the BM25 algorithm to retrieve CQL information based on graph queries, searching the existing knowledge base for historical triples containing these core entities. For example, suppose the newly received information is that clinical research confirms a novel targeted drug has significant efficacy against disease A. The system first extracts the core entities [targeted drug name] and [disease A]. Then, it searches for their adjacency connections in the existing medical graph database, extracting the original relational data of the graph, such as (targeted drug, treatment, disease B) or (targeted drug, contraindications, disease C). These retrieved existing triples constitute the relevant existing facts.

[0031] The core task of LLM is to perform a classification function. f The new information is classified according to its core semantic connotation. Based on the new medical information in natural language form received, the relevant existing facts extracted from the graph, and the typical example scenarios preset in the few sample prompts, the above inputs are integrated. With the help of CoT, logical comparison and relationship analysis are carried out on the new and old medical information to evaluate whether the new information is intended to correct erroneous records, fill gaps in discovery, or define the effective time boundary of old facts, and finally output the accurate classification result.

[0032] The core task of LLM is to perform a classification function. f The new information is categorized into one of three core semantic meanings: ① Fact Correction: New Information Aiming to correct An existing but outdated or incorrect statement.

[0033] ② Supplementary Facts: New Information It is brand new and different from the existing ones. Knowledge does not produce independent facts that directly conflict with each other.

[0034] ③ Time limit: i.e., new information Not denying It does not refer to the past existence of old facts, but rather to defining an effective time boundary for them, while introducing new facts that are sequential in time.

[0035] The formal representation is as follows: ; Among them, the output semantic category It belongs to a predefined set that includes multiple decisions. This classification decision provides a fundamental semantic basis for choosing which update operation to perform subsequently, and is a prerequisite for achieving accurate knowledge assimilation.

[0036] The three core semantic connotations in this embodiment aim to cover the most representative basic event types in the evolution of knowledge graphs, with mutual exclusivity and collective completeness among the categories. Supplementary operations handle the growth of knowledge, corrective operations handle the correction of knowledge errors, and time-bound operations handle the evolution of knowledge in the time dimension. Although there are more complex compound events, they can also be decomposed into basic operation sequences.

[0037] After clarifying the factual content, the intelligent agent needs to transform it into specific, executable procedural operations. This paper designs a set of structured output prompts to guide the LLM as a generator function. For each identified connotation Generate a candidate scheme set containing multiple candidate atomic operations. H : ; in, This represents the k-th specific executable graph atomic operation output by the generating function based on semantic connotation classification and new medical information. Atomic operations include fact addition (ADD) for adding new medical triples, fact replacement (UPDATE) for replacing existing medical objects, and fact archiving (ARCHIVE) for adding end-time attributes to existing facts.

[0038] These atomic operations are predefined as instruction types with explicit semantics. For example: for a fact ,in h , t These represent the head entity and the tail entity, respectively, and r represents the relation. The main operation types include: fact replacement, which replaces the old object with the new object; fact supplementation, which adds a completely new triple; and fact archiving, which adds an end time attribute to an existing fact to indicate its timeliness.

[0039] As an example, suppose new medical literature is received indicating that patients with severe heart failure have been excluded from the standard patient population for a certain type of pacemaker.

[0040] The candidate scheme set H may contain the following independent assumptions consisting of atomic operations: Corresponding to ARCHIVE (a certain model of pacemaker, suitable for patients with severe heart failure). Corresponding UPDATE (a specific model of pacemaker, contraindications, patients with severe heart failure) The candidate solution set H is the set consisting of the two atomic operations mentioned above. , }

[0041] To improve generation efficiency and quality, this embodiment first uses thought chain prompts and the ROSES framework to guide the model in preliminary logical planning.

[0042] Among them, the thought chain prompts guide the large language model to decompose the complex graph update decision process into multiple consecutive intermediate logical steps, requiring the model to output detailed textual logical deduction records in advance before giving the final update instruction.

[0043] The ROSES framework is a thought chain representation consisting of five key elements: Role, Objective, Scenario, Expected Solution, and Steps. It not only helps entrepreneurs and teams clearly define tasks but also guides agents to output high-quality, actionable responses in complex tasks. Through these five dimensions, the ROSES framework breaks down complex goals into executable, structured tasks. It can also generate agent prompts (Q) to help agents understand task intent, identify constraints, and output high-quality results.

[0044] Guiding the model to perform preliminary logical planning refers to requiring the model to logically deconstruct the new medical data before the system generates the final map modification code, clarify the types of medical entities involved, assess the changing attributes of related drugs or disease relationships, and deduce a reasonable order of update operations and calling logic.

[0045] However, such prompts, which include detailed instructions, API definitions, and CoT guidance, are very verbose, leading to high API call costs and inference latency. To address this issue, this embodiment employs LLLLingua technology (prompt word compression technology) to dynamically compress this long text prompt. Before each API call, a lightweight language model (such as GPT-2 Small or LLaMA-7B) is used as a filter to intelligently remove redundant information while preserving the core semantic instructions, compressing the original prompt to a preset target length. With a compression rate of 0.4, this reduces token overhead by approximately 60% without significantly affecting generation quality.

[0046] As a concrete example, suppose there is a fact in the current medical knowledge graph: (Non-small cell lung cancer, first-line treatment drug, drug A). At this time, the agent receives the latest external streaming data (new information I_{new}): "Latest announcement in March 2026: Due to the discovery of severe hepatotoxicity, drug A is no longer recommended as a first-line treatment for non-small cell lung cancer, and the targeted new drug B is now recommended as the first choice."

[0047] The agent first compares new information with old knowledge in the graph using LLM, discovering that drug A was indeed a first-line drug in the past, but is now ineffective. Therefore, drug A is categorized as having a composite semantic connotation of time constraint and factual supplementation, rather than being directly deleted. Based on this composite semantic connotation, the agent generates a candidate scheme set H containing multiple candidate atomic operations, including: Assumption 1: Directly replace drug A with drug B (direct modification).

[0048] Hypothesis 2: Add an end time attribute valid_until: 2026-03 to the original triplet (non-small cell lung cancer, first-line treatment drug, drug A) for archiving, and add a new triplet (non-small cell lung cancer, first-line treatment drug, drug B, valid_from: 2026-03).

[0049] This embodiment is based on dynamic decision-making with multiple hypothesis evaluation, which eliminates medical semantic and operational ambiguities. Through the unified reasoning mechanism of the agent, it determines whether it is correcting existing facts, supplementing new information, or adding time constraints to old facts, and autonomously matches the most appropriate update operation, such as directly replacing, adding limiting conditions, or archiving old information and creating new entries. This solves the dynamic decision-making ambiguity at the factual and procedural levels and achieves accurate modeling of knowledge evolution.

[0050] S102: For each candidate operation in the candidate scheme set, the agent generates a corresponding confidence score and evaluation reason by executing an evaluation function; and selects the optimal candidate operation scheme as the update plan by maximizing the confidence score.

[0051] In this embodiment, it is from the candidate hypothesis set H The optimal solution is selected from the options, and the agent executes the evaluation function. Each hypothesis is then carefully evaluated again using thought chain reasoning (i.e., structured cue words). At this stage, LLM students are required to act as critical thinkers, explicitly weighing the potential consequences of each action and assessing its relation to contextual evidence. Logical fit (such as timestamps explicitly mentioned in the information, source reliability, etc.).

[0052] As a structured set of key-value pairs The content is primarily extracted from new information through named entity recognition and rule-based pattern matching, mainly including temporal expressions, source information, modal words, and adverbs. Modal words are used to express the degree of certainty in an assertion. In medical texts, they are often used to describe the probability of treatment effectiveness or the absolute limitations of drug contraindications, including words like "may," "must," and "should." Adverbs indicate the time and scope of an action or state. They are often used to limit the frequency of symptom occurrence or the time points of disease progression, including words like "already" and "not yet."

[0053] For the hypothesis set H Each candidate operation in The evaluation function will generate a confidence score. and a detailed evaluation reason : ; Among them, the output confidence score It is a real number in the interval [0,1], which quantifies the assumptions the model makes. Given evidence The rationality and correctness of the following.

[0054] Specifically, the evaluation function This is a critical CoT task performed by an LLM. The agent extracts contextual evidence from new medical information, specifically including the publication time, source institution, modal words, and adverbs of clinical practice guidelines; calculates the logical fit between each candidate operation and the contextual evidence, and quantifies and outputs a real number in the interval [0,1] as a confidence score; this confidence score reflects the correctness of each candidate operation under the current contextual evidence.

[0055] Meanwhile, before outputting confidence scores, LLM utilizes CoT to progressively generate the inference process. The model explicitly weighs the potential clinical consequences of adding, replacing, or archiving a medical fact and clarifies in natural language whether the candidate operation satisfies the timeline and mutual exclusion rules of current medical guidelines. This textual inference record serves directly as the evaluation justification.

[0056] Ultimately, the agent selects the optimal atomic operation by maximizing the confidence score. a* This operation constitutes the final update plan and is passed to the next module for prospective consistency verification. The selection process is formalized as follows: ; As an example, LLM extracted contextual evidence from the new information "Latest announcement in March 2026: Due to the discovery of severe hepatotoxicity, drug A is no longer recommended as a first-line treatment for non-small cell lung cancer, and the new targeted drug B is now the preferred recommendation." Through internal thought chain evaluation, it was determined that the aforementioned hypothesis 2 best met the requirements of medical traceability and selected it as the optimal update plan.

[0057] S103: Construct an influence domain subgraph related to the update plan to be executed based on the main knowledge graph; execute the update plan on the influence domain subgraph to generate a simulated subgraph state; and use the agent to check whether the subgraph state violates consistency. If the rules are not violated, the update plan is added to the execution queue; otherwise, the update plan is rejected.

[0058] Because a locally semantically optimal decision cannot guarantee its security in the global knowledge network; an update that seems correct locally may trigger a chain reaction that disrupts the global logic in a highly interconnected knowledge network. To address this issue, this embodiment designs a forward-looking risk assessment framework. Before an update plan is executed, it undergoes rigorous review through forward-looking consistency verification. This allows the agent to proactively simulate its potential impact on related knowledge subgraphs before submitting the update, thereby anticipating and avoiding downstream logical conflicts and ensuring the long-term health and consistency of the entire knowledge base.

[0059] The forward-looking consistency verification step in this embodiment aims to solve the problems of global consistency risk and cascading effects. The core idea is to perform update operations in an isolated simulation environment in a forward-looking manner, and use the logical reasoning ability of LLM to predict whether it will cause logical conflicts with the existing knowledge of the knowledge graph. By taking proactive prevention rather than post-event repair, the long-term health and consistency of the knowledge base are guaranteed.

[0060] The process of prospective consistency verification in this embodiment is as follows: To assess the potential impact of a single update within a controllable computational overhead, it is necessary to first construct an update plan from the massive master knowledge graph. a* Highly correlated influence domain subgraph The subgraph is a* The set of entities involved E Centered on, through execution k A skip-neighbor query is used to extract all relevant entities and relationships. For example, suppose new information about a drug indication is received, and the system generates the atomic operation to be executed as ADD(A, Treatment, B). In this update plan, the set of entities involved are the two nodes [A] and [B]. The system then extracts the neighbor nodes centered on these two medical entities to verify whether this update will cause a global pharmacological logic conflict in the graph.

[0061] Formally, influence domain subgraph The construction process is as follows: ; ; in, Original image G The entity set in the middle, Representing entities e and v In the original image G The shortest path distance in the middle, k These are predefined hyperparameters used to define the depth of the influence range. In this embodiment, they are set as follows: k =2, to capture both direct and indirect logical connections simultaneously.

[0062] Vertex set That is, all entities in the entity set. k Jump to the neighbor union.

[0063] edge set Then includes Any two vertices In the original image G All edges that exist in the array.

[0064] This subgraph constitutes a temporary isolated computational environment for simulating updates, containing the local knowledge network most likely to be affected by the update. As an example, taking "non-small cell lung cancer", "drug A", and "drug B" as the center, relevant nodes (such as drug contraindications, receptor targets, and complications) are extracted outwards in two hops.

[0065] On the memory copy of the aforementioned subgraph, the agent executes the update plan to be verified. a* Generate the simulated subgraph state This process can be represented as: ; Where Apply(·) represents a function that performs atomic operations on the graph structure, based on... a* The instructions to Add, delete, or modify the edge set.

[0066] Then, LLM was used as the logic reasoning engine to examine... Does the state violate consistency?

[0067] A predefined set containing multiple natural language formal logic rules. R Provided to the LLM and the verification function is executed. : ; The verification function Requires LLM judgment Does it satisfy all the rules in R?

[0068] In this embodiment, the set R The logical rules in the framework include not only strict logical constraints such as time sequence and entity type, but also soft constraints that require common sense judgment; for example, rule sets. R It includes the following constraints: ① Timing constraint: The end time of a fact must not be earlier than the start time. ② Cardinality constraint: For single-valued relations, an entity can only have one value at any given time. ③ Mutual exclusion constraint: There is mutual exclusion between specific relations.

[0069] If any conflict is detected, i.e., the function returns False, update the plan. a* The request will be rejected, and the conflict reason generated by the LLM will be returned to the decision module for correction; otherwise, if the return value is True, the plan is considered safe and approved to enter the final execution queue.

[0070] As an example, the agent performs validation using a predefined set of medical logic rules. If a new drug B is added as a treatment for a certain disease, the graph must not contain contradictory associations that contraindicate the use of drug B for common complications of that disease. If the large model checks the subgraph and finds that the new drug B does not conflict with a common complication of lung cancer patients, and meets all medical safety soft and hard constraints, the validation function returns True, and the update is approved and entered into the execution queue.

[0071] At this point, the intelligent agent has completed a high-quality security update decision.

[0072] As a further implementation method, simply updating the atlas database is not enough. It is also necessary to enable the medical big model of the driving system to learn and remember the new guidelines, so that it does not forget the treatment plans for other diseases just because it has learned about new drugs.

[0073] The existing LLM's ability to continuously learn new knowledge declines, leading to catastrophic forgetting problems. Traditional continuous learning focuses on passively preventing LLM from forgetting old knowledge, neglecting to actively promote learning by utilizing graph context.

[0074] This embodiment constructs a context-aware continuous learning paradigm, which enables the agent to enhance LLM's understanding and integration of new knowledge by retrieving structured context in the knowledge graph. This allows for efficient learning of new knowledge while consolidating existing knowledge and reasoning abilities, thus achieving efficient integration of new knowledge and consolidation of long-term memory.

[0075] As a specific implementation method, in the update plan a* The key nodes that have been verified and are ready to be executed perform context-aware continuous learning operations; aiming to solve the problem of context-aware incremental knowledge learning and integration, and overcome the problem of knowledge isolation in traditional continuous learning methods.

[0076] Traditional incremental fine-tuning often treats new knowledge as isolated data points for learning, ignoring its deep structural connections with existing knowledge in the knowledge graph. This not only reduces learning efficiency but also leads to catastrophic forgetting.

[0077] This embodiment designs a closed-loop learning process of retrieval-enhancement-integration, which actively utilizes the structured information of the graph to promote the agent's efficient learning and long-term memory.

[0078] First, perform contextual retrieval based on the graph structure: Employing a GraphRAG-inspired retrieval mechanism, a rich, structured context is built for each validated and ready-to-execute update event. This process is driven by an LLM, which stores the update plans to be executed. a* As input, and execute the query generation function. Its task is to generate one or more structured graph query statements (such as SPARQL): ; These queries are designed to retrieve information from the main knowledge graph. a* The most semantically and structurally relevant contextual information C The search results include not only the first-order neighbors of the updated entity, but also the reasoning paths connecting key entities, or other entity groups with similar relationship patterns.

[0079] Retrieved structured context C A set of multiple triples that provides the necessary background knowledge network for understanding the current update event.

[0080] Then, context-enhanced knowledge integration is performed: After obtaining the structured context C Next, it needs to be updated with the original natural language processing information. Effective fusion is achieved to form learning samples with high information density and rich semantics. S This process first uses a linearization function to transform the context of the graph structure. C Transform into a coherent natural language description : ; Then, With the original information Perform text concatenation and then append the final gold standard update operation. a* Together they constitute a complete learning sample: ; The learned samples were then used to update the agent's knowledge and capabilities.

[0081] To maintain model stability and combat catastrophic forgetting during continuous learning, a strategy combining experience replay and efficient parameter fine-tuning is employed. All generated learning samples... S Stored in a fixed-size experience replay pool M In the training phase of the agent, from MA small batch of samples is uniformly sampled, and the LLM is fine-tuned using the Low-Rank Adaptive Regression (LoRA) technique. LoRA efficiently injects new knowledge into the model by introducing and training only a small number of low-rank factorization matrices, while keeping most of the pre-trained parameters unchanged. This context-enhanced, replay-based learning approach not only allows new knowledge to establish a deeper connection with the existing knowledge network, but also effectively consolidates the agent's procedural memory for processing such updates, thereby fundamentally alleviating the problem of forgetting general skills.

[0082] As an example, based on a recently approved update event, the agent retrieves structured context from the medical atlas, including the pharmacological mechanism of drug B and the pathological characteristics of non-small cell lung cancer. The retrieved atlas background knowledge is converted into a natural language description and concatenated with the original announcement to form a high-information-density learning sample (e.g., "Due to hepatotoxicity, for non-small cell lung cancer (characteristics: ...), starting in March 2026, the first-line drug will be updated from drug A with the mechanism of ... to a new drug B targeting the receptor ..."). This sample is stored in an experience replay pool, and LoRA technology is used to fine-tune the large-scale medical model. The system not only updates nodes in the atlas database but also internalizes this latest clinical guideline into the neural network parameters of the large-scale model, while maintaining specificity for other irrelevant disease knowledge.

[0083] The following experimental setup, evaluation metrics, and baseline comparisons comprehensively verify the performance of the proposed method in this embodiment from three dimensions: effectiveness, generalization ability, and specificity of large-scale knowledge updates.

[0084] To ensure the experimental results are strictly comparable to state-of-the-art baseline models, this study uniformly adopted the zsRE (Zero-Shot Relation Extraction) dataset as the primary evaluation benchmark. As a general standard dataset in the field of knowledge editing and reasoning, it contains question-answer pairs generated from Wikipedia, with each sample containing one fact to be edited. f =( s,r,o (and the corresponding rewriting issues and irrelevant facts.)

[0085] The zsRE dataset is a general-domain dataset, primarily based on Wikipedia. This dataset was chosen to verify the underlying reasoning capabilities and long-term memory mechanisms of the agent framework in handling high-frequency continuous knowledge evolution. zsRE provides a high-density testing environment for logical conflicts and complex entity associations, comprehensively stress-testing the model's parameter stability and anti-forgetting capabilities under information flow pressure. The update logic of the medical atlas is similar to that of the general atlas, heavily reliant on factual content analysis, conflict interception, and the maintenance of the global network structure. Therefore, the structured editing and logical deduction capabilities demonstrated by the method framework in this embodiment on the zsRE dataset can be transferred to medical professional scenarios.

[0086] A large-scale editing task with 10,000 fact updates is constructed. This setting aims to simulate the massive information flow faced by knowledge graphs in the real world, focusing on the system's stability and resistance to forgetting when processing large amounts of new knowledge. Compared to a simple single edit, this setting better exposes the model's robustness deficiencies in continuous evolution. In this task, the model needs to continuously process and memorize 10,000 new knowledge points, followed by a comprehensive evaluation on a test set.

[0087] The performance of the LLM-based agent in this embodiment was comprehensively evaluated using three core general indicators: effectiveness, generalization, and specificity.

[0088] Efficacy measures the model's recall accuracy for the target facts after editing. Given the facts to be edited... f =( s,r,o ),in, s Subject, r For the relationship, o Let (s,r) be the target object. Transform (s,r) into a natural language prompt p(s,r) and input it into the model. Effectiveness is defined as the probability that the model generates the correct object o, as shown in the following formula: ; in, This indicates that in editing dataset D edit Mathematical expectation on; This is an indicator function that takes the value 1 when the condition inside the parentheses is true, and 0 otherwise; This indicates that the updated parameters are The probability distribution output by the model is given by y, where y represents the prediction result generated by the model. This metric directly reflects the system's ability to successfully write new knowledge into memory.

[0089] Generalization measures the accuracy of a model's responses to questions about paraphrasing a target fact. The test set contains a set P(f) of multiple semantic restates of the same fact f. This metric reflects whether the model truly understands the semantic connotation of the knowledge, rather than merely memorizing a specific word order. The formula is as follows: ; Where P(f) represents the set of all paraphrasing hints for fact f, and |P(f)| is the cardinality of the set; p' is a specific paraphrasing hint in the set. A high generalization score indicates that the model can generalize new knowledge in the semantic space and handle diverse questioning styles.

[0090] Specificity measures how well the model retains its performance on irrelevant facts after editing. This is a key metric for measuring catastrophic forgetting. For each edited sample, we select a set D of irrelevant but semantically similar neighboring facts. neigh .

[0091] ; Among them, (s n , r n , o n ) represents the neighborhood dataset D neigh The triple in the text contains the subject s n Relationship r n and the corresponding real object o n The definitions of the remaining symbols are consistent with the aforementioned formulas. The baseline score of the original, unedited model is approximately 27.0. If this metric drops significantly, it indicates that the update operation has disrupted the model's original knowledge structure; if it remains stable or rises slightly, it indicates that the model has good locality protection capabilities.

[0092] To verify the superiority of the method in this embodiment, representative models from four different paradigms were compared. To ensure fairness in the comparison, the baseline results were based on the GPT-J(6B) model, while this embodiment uses the Llama-3(8B) model with similar parameter magnitudes. The baseline models can be divided into three different paradigms based on their technical principles, reflecting the research evolution trajectory in the field of knowledge editing: (1) Standard fine-tuning method: FT-W (Fine-Tuning Weights): As the most intuitive baseline, FT-W uses the standard gradient descent method to directly update all weights of the large language model on the edited samples. Although this method can theoretically fit new data, it is prone to catastrophic forgetting in practice and is usually regarded as the lower bound of the performance of knowledge editing tasks, used to measure the behavior characteristics of the model under unconstrained updates.

[0093] (2) Meta-learning-based methods: MEND (Model Editor Networks with GradientDecomposition) is an efficient meta-learning editing method that does not directly compute gradients, but instead trains lightweight supernetworks to predict parameter updates of large models. By performing low-rank decomposition on gradients, MEND can quickly process batch editing requests with extremely low computational cost, representing a technical approach that pursues editing efficiency.

[0094] (3) Localization-Editing Method: ROME (Rank-One Model Editing) is the benchmark method in the field of single-editing. Based on causal tracking theory, this method accurately locates the feedforward neural network layer that stores factual knowledge and uses a rank-1 update strategy to modify the key-value mapping of specific neurons. ROME performs well in modifying single pieces of knowledge, but faces the challenge of parameter conflicts when dealing with large-scale concurrent updates.

[0095] MEMIT (Mass-Editing Memory in a Transformer) extends the theoretical framework of ROME. It enables the batch injection of thousands of pieces of knowledge by distributing a large number of update requests across multiple layers of the model. MEMIT represents the highest level of current parameter editing paradigms and is the primary point of comparison in this study.

[0096] The autonomous agent framework in this study is built based on the open-source large model Llama-3-8B-Instruct. This model has the same number of parameters as the baseline model GPT-J(6B) and represents the highest performance of open-source models of the same scale, fully demonstrating the potential of this framework on modern large models. In the multiple hypothesis generation stage, the LLM Lingua library is used to compress the prompts, with a target compression ratio of 0.4 to optimize inference efficiency. In the continuous learning stage, LoRA technology is used for efficient parameter fine-tuning, with a rank of 8, a scaling factor of 32, a learning rate of 3e-4, and the AdamW optimizer. For graph operations, the Py2Neo library is used to interact with the Neo4j database.

[0097] Table 1 shows the performance comparison on large-scale (10,000 edits) knowledge update tasks.

[0098] Table 1 Model performance in high-frequency knowledge update scenarios

[0099] Experimental results reveal the limitations of existing parameter editing methods when dealing with massive amounts of knowledge, as well as the significant advantages of this framework.

[0100] As shown in Table 1, the traditional parameter editing methods MEND and ROME exhibit significant model collapse when faced with 10,000 knowledge updates. ROME's effectiveness score is only 21.0, slightly lower than the original model's 26.4, indicating that after continuously modifying a large number of parameters, the model can no longer effectively recall this knowledge. Meanwhile, ROME's specificity score drops to 0.9, far lower than the original model's 27.0. This suggests that the baseline methods cause drastic oscillations in the model's parameter space when injecting new knowledge, disrupting the stability of existing knowledge representations and leading to severe catastrophic forgetting and loss of neighboring knowledge. MEND also performs poorly, with an effectiveness score of only 19.4, failing to adapt to large-scale continuous update scenarios.

[0101] In comparison, the LLM agent-driven framework in this embodiment achieved superior performance across all metrics. Its effectiveness score reached 97.2, surpassing the current state-of-the-art method MEMIT (96.7). This is due to the dynamic decision-making module transforming unstructured information into precise graph operations, coupled with the GraphRAG mechanism, enabling accurate retrieval and utilization of new knowledge, rather than relying on unstable parameter memory.

[0102] In terms of generalization, this implementation framework scored 91.5, outperforming MEMIT's 89.7, demonstrating that the context-aware continuous learning module effectively enhances the model's semantic understanding of knowledge. Through the enhancement of graph structure context, the model not only remembers the triples themselves but also understands the logical relationships between entities, thus flexibly responding to different questioning methods.

[0103] In terms of specificity, the framework achieved a score of 28.1, significantly exceeding ROME's 0.9 and even slightly surpassing the original model baseline GPT-J's 27.0, thus confirming the core value of the prospective consistency verification module. By isolating potential conflicts at the logical level and leveraging the locality characteristics of the graph structure, the framework ensures that the injection of new knowledge is strictly confined within the influence domain subgraph, without interfering with the model's existing knowledge structure. This result demonstrates that the framework significantly addresses the catastrophic forgetting problem under large-scale updates.

[0104] To verify the contribution of the core components of this framework in large-scale update scenarios, this section conducted an ablation study on the same dataset, and the results are shown in Table 2. The experimental setups included removing the dynamic decision module (without Decision), removing the prospective verification module (without Verification), and removing the context learning module (without Context).

[0105] Table 2 Ablation Experiment Results

[0106] Removing the dynamic decision-making module caused the effectiveness index to drop to 92.5. This indicates that without precise analysis of the semantic connotation of new information, a simple greedy update strategy can lead to some complex knowledge failing to be correctly transformed into graph operations, thereby reducing the success rate of knowledge writing.

[0107] Removing the prospective validation module significantly impacted generalization, reducing the score to 84.2. This ablation experiment confirms that the lack of logical constraint mechanisms leads to the model internalizing contradictory information, thereby weakening its robustness in reasoning when faced with complex semantic restates and causing it to exhibit uncertainty or errors when dealing with rewriting problems.

[0108] Removing the context learning module primarily caused the specificity score to drop to 25.4, below the original baseline. This confirms that graph-based context retrieval is crucial for defining update boundaries. Without the constraints of structured context, relying solely on parameter updates makes the model more prone to confusing similar entities when assimilating new knowledge, thus inadvertently compromising neighborhood knowledge.

[0109] By conducting parameter sensitivity analysis, the effectiveness of the model and the comparison of token consumption under different compression ratio choices were obtained, for example... Figure 3 As shown in the figure, a significant nonlinear phase transition characteristic is observed, revealing the information entropy distribution pattern in natural language prompts: when the compression rate is set too low, the model's effectiveness drops precipitously from 97% to 82.5%. According to Shannon's information theory, natural language contains a large amount of redundancy, but the core logical connectors carry extremely high information entropy. Excessive compression leads to the loss of key syntactic structures, making the model unable to correctly resolve the subtle semantic differences between fact corrections and fact supplements, causing the collapse of decision-making logic. When the compression rate is increased to 0.4, the curve shows an inflection point, indicating that after removing approximately 60% of stop words, decorative adjectives, and redundant context tokens, the prompts still retain a core semantic skeleton sufficient to support reasoning. As the compression rate increases, token consumption increases linearly and is mostly low-entropy redundant information, with minimal or even fluctuating improvement in model effectiveness.

[0110] Therefore, this embodiment selects a compression rate of 0.4 for the prompt words, and utilizes the LLM's ability to understand noisy text to reduce the computation and storage costs during the continuous evolution process while ensuring high-precision decision-making.

[0111] The rank of LoRA determines the capacity for fine-tuning parameters. Table 3 shows the model performance under different ranks.

[0112] Table 3. Impact of different LoRA ranks on model performance and training cost

[0113] The results showed that when rThe model performs best when the rank is 8. While smaller rank models are faster and more stable to train, they result in insufficient model capacity and difficulty in fitting new knowledge; while larger rank models not only increase computational overhead but also lead to overfitting to new data, thus impairing specificity.

[0114] In summary, the proposed method framework outperforms state-of-the-art baseline models such as ROME, MEND, and MEMIT in terms of effectiveness, generalization, and specificity. Particularly under stress testing of processing 10,000 knowledge updates consecutively, the proposed method framework demonstrates superior anti-forgetting capabilities, achieving a specificity score of 28.1, significantly higher than parameter editing methods. This proves that explicitly introducing graph structure constraints and logical verification is a key path to building a long-term, robust, dynamic knowledge management system.

[0115] Example 2 In one or more embodiments, a medical knowledge graph update system based on agent-driven intelligence is disclosed, specifically including: The multi-hypothesis operation generation module is configured to, upon receiving new medical information, use an LLM-based agent to retrieve relevant existing facts from the main knowledge graph, determine the core semantic connotation of the new information, and generate a candidate scheme set containing multiple candidate atomic operations based on the core semantic connotation. The optimal decision module is configured to, for each candidate operation in the candidate solution set, generate a corresponding confidence score and evaluation reason by executing an evaluation function; and select the optimal candidate operation as the update plan by maximizing the confidence score. The consistency verification module is configured to construct an influence domain subgraph related to the update plan to be executed based on the main knowledge graph; execute the update plan on the influence domain subgraph to generate a simulated subgraph state; and use the agent to check whether the subgraph state violates consistency. If the rules are not violated, the update plan is added to the execution queue; otherwise, the update plan is rejected.

[0116] The context-aware continuous learning module is configured to take an update plan to be executed as input, generate one or more structured graph query statements using a query generation function, and retrieve context information related to the update plan from the main knowledge graph using the graph query statements; The context information is linearized to convert it into a coherent natural language description; the natural language description is then concatenated with new medical information and the update plan is added to form a complete learning sample for updating the agent's knowledge and capabilities.

[0117] It should be noted that the specific implementation methods of the above modules are exactly the same as those in Example 1, and will not be described in detail again.

[0118] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A method for updating a medical knowledge graph based on agent-driven intelligence, characterized in that, include: When new medical information is received, the LLM-based agent retrieves relevant existing facts from the main knowledge graph to determine the core semantic meaning of the new information; And based on the core semantic connotation, a candidate scheme set containing multiple candidate atomic operations is generated; For each candidate operation in the candidate solution set, the agent generates a corresponding confidence score and evaluation reason by executing an evaluation function; and selects the optimal candidate operation solution as the update plan by maximizing the confidence score. Construct an influence domain subgraph related to the update plan to be executed based on the main knowledge graph; An update plan is executed on the subgraph of the influence domain to generate a simulated subgraph state, and the agent is used to check whether the subgraph state violates consistency. If the rules are not violated, the update plan is added to the execution queue; otherwise, the update plan is rejected.

2. The method for updating a medical knowledge graph based on agent-driven intelligence as described in claim 1, characterized in that, Before the update plan is executed, it also includes: Using the update plan to be executed as input, a query generation function is used to generate one or more structured graph query statements; the graph query statements are then used to retrieve contextual information related to the update plan from the main knowledge graph. The context information is linearized to convert it into a coherent natural language description; the natural language description is then concatenated with new medical information and the update plan is added to form a complete learning sample for updating the agent's knowledge and capabilities.

3. The method for updating a medical knowledge graph based on agent-driven intelligence as described in claim 2, characterized in that, An experience replay pool is configured to store the constructed learning samples. During the training phase of the agent, learning samples are uniformly sampled from the experience replay pool, and the agent is fine-tuned using low-rank adaptive LoRA technology.

4. The method for updating a medical knowledge graph based on agent-driven intelligence as described in claim 1, characterized in that, The new medical information includes, but is not limited to: new drug announcements, updated clinical guidelines, new medical literature, adjustments to disease classifications, or new drug contraindications.

5. The method for updating a medical knowledge graph based on agent-driven intelligence as described in claim 1, characterized in that, The core semantic connotations specifically include: fact correction, fact supplementation, or time limitation; The aforementioned fact correction refers to the use of new medical information to correct an existing but outdated or incorrect statement in the main knowledge graph; The additional fact is that the new medical information is entirely new and an independent fact that does not directly conflict with the content in the main knowledge graph; The aforementioned time constraint means that new medical information does not negate the existence of existing facts in the main knowledge graph, but rather defines an effective time boundary for them, while introducing new facts that are sequential in time.

6. The method for updating a medical knowledge graph based on agent-driven intelligence as described in claim 1, characterized in that, Based on the core semantic meaning, a candidate scheme set containing multiple candidate atomic operations is generated, specifically as follows: The agent is guided to generate a set of candidate schemes containing multiple candidate atomic operations for each core semantic connotation through structured output prompts. The candidate atomic operations include: adding new triplet fact supplements, replacing old objects with new objects, and adding end time attributes to existing facts to indicate their timeliness; The structured output prompts include: detailed instructions, API definitions, and CoT guidance; the structured output prompts are dynamically compressed using prompt word compression technology.

7. The method for updating a medical knowledge graph based on agent-driven intelligence as described in claim 1, characterized in that, For each candidate operation in the candidate solution set, the agent generates a corresponding confidence score and evaluation reason by executing an evaluation function, specifically as follows: The agent extracts contextual evidence from new medical information, calculates the logical fit between each candidate operation and the contextual evidence, and quantifies and outputs a real number in the interval [0, 1] as a confidence score; the confidence score reflects the correctness of each candidate operation under the current contextual evidence. At the same time, the agent explicitly weighs the potential clinical consequences of adding, replacing, or archiving a medical fact, and clarifies in natural language whether the candidate operation meets the timeline and mutual exclusion rules of the current medical guidelines, using the natural language as the evaluation reason.

8. The method for updating a medical knowledge graph based on agent-driven intelligence as described in claim 1, characterized in that, Based on the main knowledge graph, an influence domain subgraph related to the update plan to be executed is constructed, specifically as follows: The set of entities involved in the pending update plan E Centered on, through execution k Use a jump neighbor query to extract all relevant entities and relationships.

9. A medical knowledge graph update system based on agent-driven intelligence, characterized in that, include: The multi-hypothesis operation generation module is configured to, upon receiving new medical information, use an LLM-based agent to retrieve relevant existing facts from the main knowledge graph, determine the core semantic connotation of the new information, and generate a candidate scheme set containing multiple candidate atomic operations based on the core semantic connotation. The optimal decision module is configured to, for each candidate operation in the candidate solution set, generate a corresponding confidence score and evaluation reason by executing an evaluation function; and select the optimal candidate operation as the update plan by maximizing the confidence score. The consistency verification module is configured to construct an influence domain subgraph related to the update plan to be executed based on the main knowledge graph; An update plan is executed on the subgraph of the influence domain to generate a simulated subgraph state, and the agent is used to check whether the subgraph state violates consistency. If the rules are not violated, the update plan is added to the execution queue; otherwise, the update plan is rejected.

10. A medical knowledge graph update system based on agent-driven operation as described in claim 9, characterized in that, Also includes: The context-aware continuous learning module is configured to take an update plan to be executed as input and use a query generation function to generate one or more structured graph query statements. The graph query statement is used to retrieve contextual information related to the update plan from the main knowledge graph; The context information is linearized to convert it into a coherent natural language description; the natural language description is then concatenated with new medical information and the update plan is added to form a complete learning sample for updating the agent's knowledge and capabilities.