A medical knowledge question and answer system and method based on a multi-agent cooperation mechanism
The medical knowledge question-answering system, which utilizes a multi-agent collaborative mechanism, solves the problems of contextual understanding, proactive guidance, and scalability in existing systems. It achieves efficient and accurate multi-turn dialogues and diversified outputs, thereby improving user experience and system applicability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHAO XIAN SHI NENG (BEI JING) KE JI YOU XIAN GONG SI
- Filing Date
- 2026-04-03
- Publication Date
- 2026-06-05
AI Technical Summary
Existing medical question-answering systems lack contextual understanding, proactive guidance, professional division of labor, and diversified output capabilities, resulting in low accuracy, poor interactive experience, and insufficient scalability.
A multi-agent collaboration mechanism is adopted, including a user interaction interface, a problem planning agent, an agent library, an agent scheduling module, a comprehensive decision-making agent, and a visualization agent. Through parallel processing and consistency verification, a logically unified answer summary is generated and visualized.
It improves the interactivity, processing efficiency, and output quality of the medical knowledge question-and-answer system, enhances the system's scalability and applicability, and improves the human-computer interaction experience and information transmission efficiency.
Smart Images

Figure CN122153010A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to artificial intelligence and medical information, specifically a medical knowledge question-and-answer system and method based on a multi-agent collaborative mechanism. Background Technology
[0002] With the development of artificial intelligence and big data technologies, intelligent question-answering systems are increasingly widely used in the medical field. Currently, existing medical question-answering systems based on Natural Language Processing (NLP), such as symptom self-diagnosis, medication lookup, and disease encyclopedias, provide users with basic information services. However, most of these existing systems generally suffer from the following shortcomings:
[0003] First, most existing systems are single-point question-and-answer systems, which only support users to input questions once. They lack the ability to understand the context and cannot conduct coherent multi-turn interactions, resulting in a stiff dialogue experience and low information acquisition efficiency.
[0004] Second, when users raise questions that are unclear or lack key information, most existing systems lack the ability to proactively guide and clarify questions, and cannot supplement necessary information by asking follow-up questions like human experts can. This directly affects the accuracy and practicality of the final answer.
[0005] Third, in terms of architecture, most existing systems typically rely on a single model to handle all types of complex medical problems. This "one-size-fits-all" approach makes it difficult to balance efficiency and accuracy, resulting in unsatisfactory response speed and answer quality when faced with diverse queries.
[0006] Fourth, the system's output format is too simplistic, typically only returning answers in plain text format. It lacks the ability to display structured data, comparative information, or procedural knowledge in charts or tables, which limits the efficiency of information delivery and user experience.
[0007] Fifth, most existing systems have poor scalability, and their architecture makes it difficult to flexibly and cost-effectively integrate new functional modules or knowledge subsystems in professional fields, thus failing to meet the real-world needs of rapid updates in medical knowledge and continuous expansion of business scenarios.
[0008] Patent CN202510138058.0 discloses a "Medical Knowledge Question Answering Method, System, and Device Based on a Large Language Model," whose core technical means include a dual-model collaborative architecture and data storage design: the fast question answering language model (LLM-S) adopts a small-scale model with a large number of parameters to retrieve answers from a vector database storing vectors of text fragments of gastroenterology knowledge; the deep reasoning language model (LLM-L) adopts a large-scale model with a large number of parameters, which, after being trained with a fine-tuned dataset of gastroenterology data, can call execution tools such as OCR recognition models and hospital registration and appointment platform interfaces to perform online searches; at the same time, the user's historical question and answer records are stored in a memory database, and the historical data of the current user is prioritized during retrieval.
[0009] This patent suffers from the first technical problem mentioned above. Its multi-turn interaction is limited to passive responses to "preconditions for tool invocation" (such as requesting the user to upload a test report). It cannot connect the context of the current dialogue in real time (for example, when the user asks "Is the medication suitable for the disease mentioned in the previous round?", the question needs to be rephrased completely). It also does not have a dynamic multi-turn guidance logic. In essence, it is still a single-point question and answer system of "single query - single response", lacking the ability to understand the coherent context.
[0010] The patent suffers from the second technical problem mentioned above. It only triggers information requests when the deep reasoning module requires tool support, and cannot proactively guide clarification for vague questions from users (such as "stomach discomfort" or "poor digestion"). It neither inquires about symptom details (such as "is it stomach pain, acid reflux, or bloating") nor confirms key information (such as "duration of symptoms"), relying entirely on users to actively supplement information, and lacks the proactive clarification ability similar to that of human experts.
[0011] The patent suffers from the third technical problem mentioned above. The dual-model approach only employs a linear collaborative mode of "LLM-S priority retrieval → LLM-L call after failure," without a dynamic adaptation mechanism. For example, when facing moderately complex problems (such as "three first-line drugs for reflux esophagitis and their differences"), a lightweight combination of "LLM-S retrieval of basic information + LLM-L supplementary comparative analysis" could achieve an efficient response. However, the system still needs to fully execute the redundant process of "LLM-S retrieval failure → initiation of LLM-L deep inference," resulting in no redundancy for simple problems and wasted efficiency for moderately complex problems, making it difficult to balance efficiency and accuracy across all scenarios.
[0012] This patent suffers from the fourth technical problem mentioned above. Its output module only supports two text formats: "first standardized text" generated by LLM-S and "second standardized text" generated by LLM-L, with a maximum of a medical science popularization link. For structured information (such as "comparison of usage and dosage of three stomach medications") and procedural knowledge (such as "pre-operative preparation steps for gastroscopy"), it makes no mention of visual display capabilities such as tables or flowcharts, relying instead on plain text descriptions to convey information, thus limiting information transmission efficiency.
[0013] This patent suffers from the fifth technical problem mentioned above. Both its vector database and fine-tuning dataset are tied to the gastroenterology specialty, and it lacks a "specialty subsystem plug-and-play mechanism": if it is necessary to add knowledge from other specialties such as cardiovascular or dermatology, it is necessary to rebuild the corresponding text database, vector database, and fine-tuning dataset; if it is necessary to access new functional modules (such as gene detection and analysis tools), it is also necessary to modify the collaborative logic of the two models, making it difficult to expand the overall architecture flexibly and at low cost.
[0014] Patent CN202411969551.9 discloses "A Medical Knowledge Question-Answering Method Based on Medical Text," whose core technical means revolve around "data-model-graph" to construct a single question-answering process: obtaining publicly available online datasets (including semi-structured and unstructured data) and online medical discussion posts (user questions + doctor answers) from multiple medical consultation websites, cleaning them, and storing them in ElasticSearch; constructing a named entity model (using RoBERTa-wwm word embedding layer, BiLSTM feature extraction layer, and GlobalPointer entity annotation layer) and an intent recognition model with an attention mechanism; constructing a Neo4j medical knowledge graph (including entity alignment and node relationship definition) based on the recognized medical entities; converting user questions into Cypher query statements after entity recognition and entity linking, retrieving answers from the knowledge graph, and returning them through answer templates.
[0015] The patent suffers from the aforementioned first technical problem. Its question-and-answer process is a pure "single query - single response" mode, without a historical dialogue storage module. When the user asks multiple follow-up questions (such as first asking "how to treat a stomach ulcer" and then "is the omeprazole I'm taking suitable?"), the system cannot connect to the context of the previous dialogue, requiring the user to completely rephrase the question. It completely lacks the ability to understand the context and engage in multi-round interactions.
[0016] The patent suffers from the second technical problem mentioned above. Its intent recognition model can only recognize questions with "clear entities and clear intents" (such as "What are some medications for hypertension"), and cannot handle ambiguous questions: if a user asks "I've been having stomach discomfort lately," the system will only return "No relevant answer" because it cannot extract a valid entity, instead of actively guiding clarification (such as asking follow-up questions like "Are the symptoms worse after meals or on an empty stomach?" or "Do you have a history of Helicobacter pylori infection?"), lacking the ability to actively clarify ambiguous questions.
[0017] This patent suffers from the third technical problem mentioned above. Its core adopts a single, sequential process of "entity recognition → intent recognition → knowledge graph retrieval," lacking multi-model collaboration or dynamic path adjustment design. For simple questions (such as "What is omeprazole?"), it still requires the complete execution of the "entity annotation → Cypher statement conversion → knowledge graph query" process, resulting in redundant computational resources. For complex questions (such as "Quadrug therapy regimen and precautions for gastric ulcer complicated by Helicobacter pylori infection"), it can only return a fixed answer based on the entity relationships already stored in the knowledge graph, lacking deep reasoning ability and unable to incorporate the latest clinical guidelines or individual differences to supplement information, leading to insufficient accuracy. This "one-size-fits-all" approach cannot balance efficiency and accuracy.
[0018] This patent suffers from the fourth technical problem mentioned above. Its answer generation relies entirely on a "preset answer template": entity relationships retrieved from the knowledge graph (such as "disease-symptom-drug" associations) are filled into the template, ultimately outputting a plain text result. For example, regarding the question of "comparison of complications between hypertension and diabetes," it can only list the types of complications of the two diseases in text, and cannot generate a comparison table; regarding "diabetes diet control process," it cannot show key steps through a flowchart, and the specification does not mention any non-text output modules, limiting the output format to plain text.
[0019] The patent suffers from the fifth technical problem mentioned above. Although it mentions that "modular design can add new data sources," it does not reserve access interfaces for new functional modules: if functions such as "examination report image analysis" or "online consultation appointment" are to be added, the core process of "entity recognition - graph retrieval" needs to be modified; if it needs to be expanded to other medical specialties (such as neurology), the named entity model needs to be retrained and the knowledge graph of the corresponding specialty needs to be constructed. The overall architecture has poor scalability and is difficult to adapt to the needs of medical knowledge updates and business scenario expansion.
[0020] The information disclosed in this background section is intended only to enhance the understanding of the general background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0022] In view of the shortcomings of the existing technology, the purpose of this invention is to provide a medical knowledge question-answering system and method based on a multi-agent collaborative mechanism. It aims to solve the problems of low accuracy, poor interactive experience and insufficient scalability of existing medical question-answering systems due to the lack of contextual understanding, proactive guidance, professional division of labor and diversified output capabilities. In this way, it can effectively improve the intelligence level, answer reliability and system applicability of medical knowledge question-answering.
[0023] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0024] Firstly, a medical knowledge question-answering system based on a multi-agent collaborative mechanism includes:
[0025] The user interaction interface module is used to receive medical questions input by users and record the context of multiple rounds of dialogue.
[0026] The problem planning agent, connected to the user interaction interface module, is used to analyze whether the medical question input by the user is complete. The completeness analysis includes determining whether it contains the key entities required for medical knowledge Q&A, and whether it specifies the time range, population characteristics, or symptom details. If the question is incomplete, a prompt is generated to guide the user to supplement the information.
[0027] The intelligent agent library stores multiple specialized medical intelligent agents;
[0028] The agent scheduling module is connected to the problem planning agent and the agent library respectively. After the problem planning agent determines that the problem is complete, it analyzes the medical problem and the functional descriptions of each agent in the agent library based on the base large language model, and calls at least two matching professional medical agents in parallel from the agent library to process the medical problem.
[0029] The integrated decision-making agent, connected to the agent scheduling module, is configured to perform the following operations:
[0030] Receive at least two results returned after multiple specialized medical intelligent agents are executed in parallel;
[0031] Perform consistency verification on the at least two results to identify conflicting information;
[0032] Based on the analysis of preset conflict resolution prompts and at least one base language model, the identified conflict information is processed to generate a unified description after the conflict is resolved.
[0033] The unified description is adjusted based on the user's background information to generate the final answer summary;
[0034] A visualization agent, connected to the comprehensive decision-making agent, is used to dynamically select and generate corresponding visualization charts for display based on the data characteristics of the final answer summary.
[0035] In one specific implementation, the key entity includes at least one of the following: disease name, drug name, and examination item name.
[0036] In a specific feasible implementation, the consistency verification of at least two results specifically includes:
[0037] The at least two results and the consistency verification requirement are concatenated into a prompt word and submitted to the base large language model;
[0038] The system receives the verification result returned by the base large language model, which includes a description of the conflict information and the source agent.
[0039] In one specific implementation, the user background information includes the user's age and underlying medical history.
[0040] In a specific feasible implementation, the dynamic selection and generation of the corresponding visualization chart specifically includes:
[0041] When the answer summary contains information on multiple drugs, a drug comparison table is automatically generated for comparison.
[0042] When the answer summary contains health management steps, a health management flowchart showing their logical sequence is automatically generated.
[0043] In one specific feasible implementation, the professional medical intelligent agents in the intelligent agent library are constructed based on different knowledge sources, and the construction process includes:
[0044] Text from medical knowledge graphs, clinical guidelines, and databases is segmented into text blocks of preset lengths;
[0045] For each text block, use an embedding model to calculate the embedding vector features and store them in a vector database;
[0046] For a user query, the system first searches the vector database, then combines the first K returned text blocks with the user query to form a prompt word, which is then submitted to the base large language model for analysis to obtain the agent's answer.
[0047] In a specific feasible implementation, the intelligent agent library supports dynamic expansion: when adding a new professional medical intelligent agent, only the functional description and knowledge source of the intelligent agent need to be connected to the system, without modifying the core logic of the problem planning intelligent agent, the intelligent agent scheduling module and the comprehensive decision-making intelligent agent.
[0048] Secondly, a medical knowledge question-answering method based on a multi-agent collaboration mechanism includes the following steps:
[0049] Receive medical questions input by users through a user interaction interface;
[0050] The problem planning agent analyzes whether the medical question entered by the user is complete. The completeness analysis includes determining whether it contains key entities and whether it specifies the time range, population characteristics or symptom details. If it is incomplete, it generates prompts to guide the user to supplement information.
[0051] If the problem is complete, the intelligent agent scheduling module analyzes the medical problem and the functional descriptions of each intelligent agent in the intelligent agent library based on the base large language model, and calls at least two matching professional medical intelligent agents in the intelligent agent library in parallel to process the medical problem;
[0052] The following steps are performed by the integrated decision-making agent:
[0053] Receive at least two results returned by multiple specialized medical intelligent agents that have been invoked;
[0054] Perform consistency verification on the at least two results to identify conflicting information;
[0055] Based on the analysis of preset conflict resolution prompts and at least one base language model, the identified conflict information is processed to generate a unified description after the conflict is resolved.
[0056] The unified description is adjusted based on the user's background information to generate the final answer summary;
[0057] By visualizing the intelligent agent, the system dynamically selects and generates corresponding visual charts based on the data characteristics of the answer summary, and outputs them to the user.
[0058] In a specific feasible implementation, the dynamic selection and generation of the corresponding visualization chart specifically includes:
[0059] When the answer summary contains information on multiple drugs, a drug comparison table is automatically generated;
[0060] When the answer summary contains health management steps, a health management flowchart is automatically generated.
[0061] In one specific implementation, the method further includes a step of dynamically expanding the intelligent agent library:
[0062] By integrating the functional descriptions and knowledge sources of newly added professional medical intelligent agents into the system, the system's functionality can be expanded without modifying the core logic of problem planning, scheduling, and comprehensive decision-making.
[0063] This invention discloses a medical knowledge question-answering system and method based on a multi-agent collaborative mechanism, used to provide medical knowledge reference and decision support. By constructing a multi-agent collaborative architecture encompassing question planning, parallel processing by specialized agents, comprehensive decision-making, and visualization, and combining a consistency verification and conflict resolution mechanism based on a foundational large language model, it achieves intelligent processing throughout the entire process from question understanding to answer generation. This effectively improves the accuracy, reliability, and user experience of the medical knowledge question-answering system, and has the following beneficial effects:
[0064] Enhancing interactive intelligence: By analyzing the completeness of user questions and proactively guiding supplementary information through question planning intelligence, the system's ability to understand the context of multi-turn dialogues is enhanced, solving the problem of stiff interaction in traditional single-point question-and-answer systems and significantly improving the human-computer interaction experience.
[0065] Improve processing efficiency and capabilities: Adopt a multi-agent parallel processing architecture, in which the scheduling module dynamically calls multiple professional medical agents to work together, overcoming the shortcomings of low response efficiency and insufficient knowledge coverage caused by a single model handling all types of problems.
[0066] Improve the quality and consistency of output information: By integrating decision-making agents to verify the consistency of output results from various professional agents and resolve conflicts, a logically unified answer summary is generated, which effectively reduces errors and contradictions that may be caused by a single information source or model and improves the reliability of system output information.
[0067] Enhanced information presentation: By visually displaying the intelligent agent dynamically generating various forms of structured presentations such as tables, charts, and health management flowcharts, complex information is made more intuitive, improving the efficiency of information delivery and the user's understanding of the content.
[0068] Improved system scalability and maintainability: The system's intelligent agent library supports dynamic expansion, and adding new professional medical intelligent agents does not require reconstructing the overall system structure, significantly reducing the development and maintenance costs of system function iteration.
[0069] Expanding the system's application scope: Through the specialized division of labor and close collaboration among multiple agents, the entire system can effectively adapt to various information service scenarios such as medical knowledge consultation and medical knowledge teaching, demonstrating the versatility and practicality of the system architecture. Attached Figure Description
[0070] The present invention includes the following figures:
[0071] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0072] Figure 1 The system architecture diagram of a medical knowledge question-answering system based on a multi-agent collaboration mechanism described in this invention.
[0073] Figure 2 A schematic diagram of the internal processes of a comprehensive decision-making intelligent agent.
[0074] Figure 3 A schematic diagram illustrating the construction and workflow of a professional medical intelligent agent. Detailed Implementation
[0075] The present invention will be further described in detail below with reference to the accompanying drawings. This detailed description is an illustration in conjunction with exemplary embodiments of the invention, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0076] This invention constructs a modular and scalable multi-agent collaborative system, which decomposes the complex medical knowledge question-answering task into a series of orderly and parallel sub-tasks such as question planning, specialized processing, comprehensive decision-making, and intelligent display. This overcomes the inherent defects of existing single-model systems in terms of question-answering accuracy, interactive intelligence, output diversity, and system scalability.
[0077] like Figure 1 As shown, the medical knowledge question-answering system based on a multi-agent collaboration mechanism described in this invention starts with a user interaction interface module and ends with a visualization agent. Through the collaborative operation of core components such as a question planning agent, an agent scheduling module, an agent library, and a comprehensive decision-making agent, a complete data processing pipeline is formed. The core of the question-answering system architecture described in this invention lies in:
[0078] Specialized division of labor, with multiple specialized medical intelligent agents in the intelligent agent library handling different aspects of the problem in parallel;
[0079] Collaborative decision-making involves a comprehensive decision-making agent integrating, verifying, and resolving conflicts in parallel results.
[0080] The technical principles and working processes of each module will be explained in detail below.
[0081] 1. The user interaction interface module serves as the direct window for interaction between the system and the user. Its technical principle lies in capturing the user's original medical questions through graphical interface components or natural language processing interfaces. A key technical aspect of this module is its built-in context management mechanism. This mechanism achieves the continuity of multi-turn dialogues by creating a unique identifier for each session and associating and storing historical question-and-answer records.
[0082] The user interaction interface module works as follows: When a user enters a new question, the module not only receives the current question text but also automatically retrieves and loads relevant historical dialogue content from storage. Then, it packages the current question with the historical context to form a complete dialogue state, which is then passed to the downstream question planning agent. For example, if a user first asks "What is hypertension?" and then asks "What are some commonly used medications?", the system can clearly identify hypertension as the referred disease when answering the second question.
[0083] 2. The problem-planning agent's technical principle is to simulate the thought process of human experts before answering a question, that is, to first determine whether the question is clear and answerable. Its core task is to perform problem integrity analysis, which relies on the identification of key entities in the medical field and the understanding of the semantic structure of the question.
[0084] The working process of the problem planning agent is as follows: After receiving the dialogue state from the user interface, the agent first initiates the key entity recognition process. This process utilizes a pre-trained medical named entity recognition model to search for specific words such as disease names, drug names, and examination item names in the question text. Next, it uses semantic analysis to determine whether the question specifies the necessary time frame, population characteristics, or symptom details.
[0085] Example 1: A user inputs "I've been feeling dizzy lately." After analysis, the problem planning agent finds that although the key entity "dizziness" is included, crucial information such as time frame, accompanying symptoms, and user characteristics are severely lacking. Therefore, it generates guiding questions such as "How long have your dizziness symptoms lasted? Is it continuous or intermittent? Is it accompanied by nausea or tinnitus? How old are you?" and provides feedback to the user through the user interaction interface module, proactively guiding the dialogue towards clarity and completeness.
[0086] 3. The Intelligent Agent Library and Intelligent Agent Scheduling Module: The Intelligent Agent Library is a dynamically expandable registry center. Its technical principle is to encapsulate different medical expertise and services into independent, callable intelligent agent units. The Intelligent Agent Scheduling Module works similarly to an efficient logistics dispatch center, distributing tasks in parallel to the most suitable processing units based on the problem content.
[0087] The agent list maintains a list of agent information descriptions, including the name, function description, and API address of each agent, for example:
[0088] Symptom analysis agent: Responsible for receiving patient symptom descriptions, performing structured processing and correlation analysis of symptom data, identifying symptom features and matching them with disease features in the medical knowledge base, outputting correlation analysis results, and providing reference information for doctors.
[0089] Intelligent Drug Instruction Manual: Specialized in drug information retrieval and parsing, it can extract and present structured information such as drug indications, dosage, contraindications, adverse reactions, and drug interactions from drug instruction manual databases, providing drug knowledge query services for doctors and patients.
[0090] When adding a new agent, simply append the agent's information to the end of the agent list, for example:
[0091] Inductive summarizing agent: Integrates and summarizes medical-related information output by multiple agents, extracts key information points, and generates structured information summary reports, making it easier for doctors to quickly browse and understand the system analysis results and improving information acquisition efficiency.
[0092] When planning agent invocation, a large model of prompts, including the user's request question and a list of agents, is constructed and submitted to the base large language model to obtain the actual planned order of agents to be invoked. For example:
[0093] You are a medical and pharmaceutical expert. Please analyze the user's request, select the appropriate agent from the list of agents, and return the agent's calling sequence plan.
[0094] #User Request#
[0095] <Original User Request>
[0096] #List of Intelligent Agents# [
[0098] {
[0099] "name": "Symptom Analysis Agent",
[0100] "description": "Responsible for receiving patient symptom descriptions, performing structured processing and correlation analysis of symptom data through a medical knowledge base, identifying symptom characteristics and matching them with disease characteristics in the medical knowledge base, outputting correlation analysis results, and providing reference information for doctors."
[0101] },
[0102] {
[0103] "name": "Drug Instruction Manual Intelligent Agent",
[0104] "description": "Specialized in drug information retrieval and analysis, it can extract and present structured information such as drug indications, dosage, contraindications, adverse reactions, and drug interactions from drug instruction manual databases, providing drug knowledge query services for doctors and patients."
[0105] },
[0106] {
[0107] "name": "Inductive Summarizing Agent",
[0108] "description": "This function integrates and summarizes medical-related information output by multiple intelligent agents, extracts key information points, and generates structured information summary reports. This facilitates doctors' quick browsing and understanding of the system's analysis results, improving information acquisition efficiency."
[0109] } ]
[0111] The working process of the agent library and agent scheduling module: Once the problem planning agent determines that the problem is complete, the agent scheduling module is activated. It no longer uses a fixed algorithm for matching, but instead employs a dynamic programming strategy based on a base large language model. Specifically, the scheduling module constructs a prompt containing the user's original problem and descriptions of the functions of all agents in the agent library, submits it to the base large language model, which analyzes it and returns an optimal agent invocation order plan. Subsequently, the scheduling module uses an asynchronous invocation mechanism according to this plan, simultaneously sending processing requests to these selected agents. This parallel invocation method based on large model dynamic programming significantly improves scheduling accuracy and overall system response efficiency compared to the fixed rule matching or serial processing of traditional systems.
[0112] 4. Construction and operation of professional medical intelligent agents
[0113] like Figure 3 As shown, the principle of professional medical intelligent agent technology is based on retrieval enhancement generation technology, which transforms a static and massive medical knowledge base into a dynamic and intelligently searchable knowledge service.
[0114] The construction process of a specialized medical intelligent agent: Taking the construction of a drug recommendation intelligent agent as an example. First, text about drug indications, usage, dosage, and adverse reactions is extracted from medical knowledge graphs, clinical guidelines, and professional databases. Then, these texts are segmented into semantically complete text blocks with a length between 200 and 2000 bytes. Next, an embedding model is used to calculate the high-dimensional vector representation of each text block. In this embodiment, the BERT-base-chinese model is used, with 1024 tokens as the window range, to calculate a 768-dimensional vector from the text, which is then stored in a vector database. At this point, a knowledge system specializing in drug recommendation is completed.
[0115] The working process of a professional medical AI agent is as follows: When a user queries for first-line medications for diabetes, the agent first converts the query into a vector and performs a similarity search in a vector database to obtain the top K most relevant text blocks, such as the top ten. For the user query, it first searches the vector database, uses a conventional vector similarity calculation algorithm to return the top K most relevant text blocks, and then concatenates the returned top K text blocks with the user query to form prompt words, which are then submitted to the base language model for analysis to obtain the agent's answer. The embedding model uses the open-source general-purpose algorithm model bert-base-chinese, with a vector dimension of 768. The base language model generates professional and accurate answers based on these authoritative knowledge fragments, rather than relying solely on its internal parameterized knowledge, thus ensuring the reliability and timeliness of the answers.
[0116] 5. Decision-making process of a comprehensive decision-making agent
[0117] like Figure 2 As shown, the technical principle of the integrated decision-making agent lies in using the reasoning ability of the base large language model to solve the problem of consistency and conflict of multi-source information.
[0118] The working process of the integrated decision-making agent: This agent receives results returned in parallel from multiple specialized medical agents.
[0119] Consistency Verification: The at least two results and the consistency verification requirement are concatenated into a prompt word and submitted to the base large language model. The prompt word explicitly requires "consistency verification" and "conflict determination," and the prompt word template is as follows:
[0120] As an expert in medicine and pharmacy, please analyze in detail, based on the "original question," whether the arguments, evidence, and reasoning in the "multi-source analysis results" below are consistent, and list the points of conflict one by one.
[0121] #Original Question#
[0122] #Multi-source analysis results#
[0123] [Results returned by each agent]
[0124] The system receives the verification result returned by the base large language model, which includes a description of the conflict information and the source agent.
[0125] The base language model analyzes and returns a verification report, clearly indicating which information is conflicting and the source of the conflict.
[0126] Conflict resolution: For each point of conflict, the system uses preset conflict resolution prompts and requires the base language model to arbitrate based on the latest medical consensus or clinical guidelines, generating a unified description after the conflict is resolved.
[0127] The prompt template is:
[0128] As a medical and pharmaceutical expert, please arbitrate based on the latest medical consensus or clinical guidelines to generate a unified description after resolving the conflict.
[0129] #Original Question#
[0130] [Original Question from User]
[0131] #Multi-source analysis results#
[0132] [Results returned by each agent]
[0133] #Multi-source analysis conflict#
[0134] [Conflict information identified by consistency verification]
[0135] Points of conflict: [Specific content of the conflict].
[0136] Viewpoint A (from [Agent A]): [Content].
[0137] Viewpoint B (from [Agent B]): [Content].
[0138] The prompt words, filled with specific conflict information and their sources, are submitted to the base language model for analysis, thereby obtaining a unified description after the conflict is resolved.
[0139] Generate answer summary: Finally, it combines all conflict-free results and unified descriptions after conflict resolution with background information such as the user's age and basic medical history, and once again uses the base big language model to generate a personalized and logically consistent final answer summary.
[0140] The underlying large language model is invoked to summarize all information and obtain the final answer. Clue words, for example:
[0141] If you are an expert in medicine or pharmacy, please generate a personalized and logically consistent final answer based on the "original question" and analysis results, taking into account the user's background information, balancing professionalism and accessibility, and return a JSON structured result according to the "return result structure".
[0142] #Original Question#
[0143] [Original Question from User]
[0144] #Analysis Results#
[0145] [A unified description after conflict resolution]
[0146] #User Background Information#
[0147] [User age, underlying medical history, etc.]
[0148] #Return Result Structure#
[0149] {
[0150] "Successful?": "Yes"
[0151] "Medication": [
[0152] {
[0153] Name: Drug A
[0154] Specification: 100mg
[0155] Usage: Oral administration
[0156] Dosage and Precautions: "
[0157] },
[0158] {
[0159] Name: Drug B
[0160] Specification: 50mg
[0161] Usage: Oral administration
[0162] Dosage and Precautions: "
[0163] }
[0164] ],
[0165] "Health Management Steps": ["Step 1", "Step 2", "Step 3"]
[0166] }
[0167] Example 1: When a user asks about the treatment of osteoporosis in the elderly, the disease diagnosis agent might emphasize calcium supplementation, while the medication recommendation agent might recommend a drug that inhibits bone resorption. If the two approaches differ in their descriptions of specific medications, the integrated decision-making agent will identify the conflict and make a judgment based on authoritative guidelines, ultimately generating a conflict-free personalized plan that integrates basic calcium supplementation treatment with specific medication recommendations.
[0168] 6. Visualizing intelligent agents: The technical principle behind this is based on rule engines and data analysis, which transform structured answer summaries into a visual form most suitable for human understanding.
[0169] The system visualizes the agent's workflow: it receives summaries of answers generated by the comprehensive decision-making agent and analyzes their data characteristics. Based on the actual results of the "medication" and "health management steps" fields in the final JSON result, the system makes judgments and calls relevant components of front-end open-source tools (such as ECharts) for display.
[0170] Example 1: When the answer contains information about multiple drugs, the table generator is automatically triggered to create a comparison table containing drug names, specifications, usage, dosage and precautions.
[0171] Example 2: When the answer describes a clear sequence of health management steps, the flowchart generation component is automatically invoked to display these steps in the form of a flowchart with logical decision nodes, which greatly improves the efficiency of information transmission and the user's understanding.
[0172] The following complete scenario serves as an example to comprehensively illustrate the operation of the entire system.
[0173] 1. A user asked through the user interaction interface: My father has high blood pressure, and a recent physical examination also found that his blood lipids are high. What should we do?
[0174] 2. After analysis by the problem planning agent, it is determined that the problem contains key entities such as hypertension and hyperlipidemia, and specifies the characteristics of the population. The problem is deemed complete, and the request is forwarded to the agent scheduling module.
[0175] 3. The agent scheduling module calls the disease diagnosis agent, drug recommendation agent, and health management agent in parallel.
[0176] 4. Each agent works in parallel, returning diagnostic opinions, medication recommendations, and lifestyle adjustment plans respectively.
[0177] 5. The comprehensive decision-making agent discovered a potential conflict between a certain statin drug recommended by the drug recommendation agent and a certain underlying medical history of the user's father. Therefore, it initiated a consistency verification and conflict resolution process and ultimately adjusted the medication recommendation.
[0178] 6. Visualization: After receiving the final answer summary, the intelligent agent discovers that the content includes multiple drugs and a series of health management steps. Therefore, it dynamically generates a drug comparison table and a health management flowchart, which are then presented to the user.
[0179] The contents not described in detail in this specification are existing technologies known to those skilled in the art.
[0180] Compared with existing technologies, the technological innovation of this invention lies not in any single algorithm, but in the overall system architecture and the collaborative mechanism between components. Specifically:
[0181] First, this invention proposes a question planning and proactive guidance mechanism, which improves the accuracy of question answering and the interactive experience from the source.
[0182] Second, this invention designs a multi-agent collaborative architecture based on parallel scheduling, which achieves a balance between processing efficiency and knowledge coverage through specialized division of labor.
[0183] Third, this invention creates a consistency verification and conflict resolution process based on a base-based large language model, which effectively ensures the scientific validity and consistency of multi-source information fusion.
[0184] Fourth, this invention enables the dynamic visualization generation of answers, presenting complex medical information in the most intuitive form and improving information transmission efficiency.
[0185] Fifth, the intelligent agent library of this invention supports dynamic expansion, and new professional intelligent agents can be used plug and play, enabling the system to flexibly adapt to the rapid iteration of medical knowledge and the continuous expansion of business scenarios, thus possessing long-term vitality.
[0186] The above description is only a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. Any equivalent modifications or changes made by those skilled in the art based on the content disclosed in the present invention should be included in the scope of protection set forth in the claims.
Claims
1. A medical knowledge question-answering system based on a multi-agent collaborative mechanism, characterized in that, include: The user interaction interface module is used to receive medical questions input by users and record the context of multiple rounds of dialogue. The problem planning agent, connected to the user interaction interface module, is used to analyze whether the medical question input by the user is complete. The completeness analysis includes determining whether it contains the key entities required for medical knowledge Q&A, and whether it specifies the time range, population characteristics, or symptom details. If the question is incomplete, a prompt is generated to guide the user to supplement the information. The intelligent agent library stores multiple specialized medical intelligent agents; The agent scheduling module is connected to the problem planning agent and the agent library respectively. After the problem planning agent determines that the problem is complete, it analyzes the medical problem and the functional descriptions of each agent in the agent library based on the base large language model, and calls at least two matching professional medical agents in parallel from the agent library to process the medical problem. The integrated decision-making agent, connected to the agent scheduling module, is configured to perform the following operations: Receive at least two results returned after multiple specialized medical intelligent agents are executed in parallel; Perform consistency verification on the at least two results to identify conflicting information; Based on the analysis of preset conflict resolution prompts and at least one base language model, the identified conflict information is processed to generate a unified description after the conflict is resolved. The unified description is adjusted based on the user's background information to generate the final answer summary; A visualization agent, connected to the comprehensive decision-making agent, is used to dynamically select and generate corresponding visualization charts for display based on the data characteristics of the final answer summary.
2. The system according to claim 1, characterized in that, The key entities include at least one of the following: disease name, drug name, and examination item name.
3. The system according to claim 1, characterized in that, The consistency verification of at least two results specifically includes: The at least two results and the consistency verification requirement are concatenated into a prompt word and submitted to the base large language model; The system receives the verification result returned by the base large language model, which includes a description of the conflict information and the source agent.
4. The system according to claim 1, characterized in that, The user background information includes the user's age and basic medical history.
5. The system according to claim 1, characterized in that, The dynamic selection and generation of corresponding visualization charts specifically involves: When the answer summary contains information on multiple drugs, a drug comparison table is automatically generated for comparison. When the answer summary contains health management steps, a health management flowchart showing their logical sequence is automatically generated.
6. The system according to claim 1, characterized in that, The specialized medical intelligent agents in the intelligent agent library are constructed based on different knowledge sources, and their construction process includes: Text from medical knowledge graphs, clinical guidelines, and databases is segmented into text blocks of preset lengths; For each text block, use an embedding model to calculate the embedding vector features and store them in a vector database; For a user query, the system first searches the vector database, then combines the first K returned text blocks with the user query to form a prompt word, which is then submitted to the base large language model for analysis to obtain the agent's answer.
7. The system according to claim 1, characterized in that, The intelligent agent library supports dynamic expansion: when adding a new professional medical intelligent agent, only the functional description and knowledge source of the intelligent agent need to be connected to the system, without modifying the core logic of the problem planning intelligent agent, the intelligent agent scheduling module and the comprehensive decision-making intelligent agent.
8. A medical knowledge question-answering method based on a multi-agent collaborative mechanism, characterized in that, Includes the following steps: Receive medical questions input by users through a user interaction interface; The problem planning agent analyzes whether the medical question entered by the user is complete. The completeness analysis includes determining whether it contains key entities and whether it specifies the time range, population characteristics or symptom details. If it is incomplete, it generates prompts to guide the user to supplement information. If the problem is complete, the intelligent agent scheduling module analyzes the medical problem and the functional descriptions of each intelligent agent in the intelligent agent library based on the base large language model, and calls at least two matching professional medical intelligent agents in the intelligent agent library in parallel to process the medical problem; The following steps are performed by the integrated decision-making agent: Receive at least two results returned by multiple specialized medical intelligent agents that have been invoked; Perform consistency verification on the at least two results to identify conflicting information; Based on the analysis of preset conflict resolution prompts and at least one base language model, the identified conflict information is processed to generate a unified description after the conflict is resolved. The unified description is adjusted based on the user's background information to generate the final answer summary; By visualizing the intelligent agent, the system dynamically selects and generates corresponding visual charts based on the data characteristics of the answer summary, and outputs them to the user.
9. The method according to claim 8, characterized in that, The dynamic selection and generation of corresponding visualization charts specifically involves: When the answer summary contains information on multiple drugs, a drug comparison table is automatically generated; When the answer summary contains health management steps, a health management flowchart is automatically generated.
10. The method according to claim 8, characterized in that, The method also includes a step of dynamically expanding the intelligent agent library: By integrating the functional descriptions and knowledge sources of newly added professional medical intelligent agents into the system, the system's functionality can be expanded without modifying the core logic of problem planning, scheduling, and comprehensive decision-making.