Traditional Chinese medicine auxiliary diagnosis and treatment method and device based on multi-agent cooperation

CN122950110APending Publication Date: 2026-10-20SHANDONG SOSO TRADITIONAL CHINESE MEDICINE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611139066.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0004]本发明提供一种基于多智能体协同的中医辅助诊疗方法及装置,用以解决现有技术中中医智能辅助诊疗将诊疗过程视为单一任务处理,导致诊疗过程的合理性与结果的准确性偏低的缺陷

Benefits of technology

[0016]本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述基于多智能体协同的中医辅助诊疗方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention relates to the fields of TCM information technology and artificial intelligence, and provides a TCM-assisted diagnosis and treatment method and device based on multi-agent collaboration. The method involves a planning agent that, in conjunction with user input data, first generates a first query subtask for the syndrome analysis stage, which is then retrieved from external knowledge sources by the execution agent. After the decision agent infers and generates a phased reference result, the planning agent dynamically generates a second query subtask for the prescription recommendation stage based on the reasoning results of the first stage. Finally, the execution agent retrieves the information again, and the decision agent infers, comprehensively outputting the final auxiliary diagnosis and treatment information. This achieves dynamic cascading and multi-stage processing of diagnosis and treatment data processing tasks. Through data flow and collaborative cooperation among multiple agents at different stages, the rationality of the TCM-assisted diagnosis and treatment process, as well as the accuracy and reliability of the results, are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of TCM information technology and artificial intelligence technology, and in particular to a TCM-assisted diagnosis and treatment method and device based on multi-agent collaboration. Background Technology

[0002] Traditional Chinese medicine (TCM) diagnosis and treatment centers on "syndrome differentiation and treatment," which involves comprehensively analyzing a patient's symptoms, signs, and medical history to determine the disease or syndrome category under the guidance of TCM theory and formulate an individualized treatment plan. In recent years, the development of artificial intelligence (AI) technology, especially the improved capabilities of large language models in natural language understanding and generation, has continuously enhanced the application capabilities of these models in vertical fields. This provides new technical means for scenarios such as TCM question answering and assisted diagnosis, and promotes the development of intelligent TCM diagnostic and treatment systems. Currently, existing intelligent assisted diagnosis and treatment systems for TCM have evolved from rule-matching methods and deep learning-based model methods to generative methods based on large language models.

[0003] However, existing TCM intelligent assisted diagnosis and treatment methods mostly treat the diagnosis and treatment process as a single task, usually completing information retrieval and result generation based on only one query, and lack the ability to autonomously plan tasks according to the TCM diagnosis and treatment process, thus affecting the rationality of the diagnosis and treatment process and the accuracy of the results. Summary of the Invention

[0004] This invention provides a TCM-assisted diagnosis and treatment method and device based on multi-agent collaboration, which solves the defects of existing TCM intelligent assisted diagnosis and treatment methods that treat the diagnosis and treatment process as a single task, resulting in low rationality of the diagnosis and treatment process and low accuracy of the results.

[0005] This invention provides a TCM-assisted diagnosis and treatment method based on multi-agent collaboration, comprising: Based on the planning agent and combined with the user's diagnosis and treatment characteristic data, the first query subtask for the syndrome analysis stage is generated. Based on the execution agent performing information retrieval on the first query subtask in the preset knowledge source to obtain the first retrieval result, and based on the decision agent combining the first retrieval result to perform reasoning, a syndrome analysis reference result is generated. Based on the planning agent and the syndrome analysis reference results, a second query subtask is generated for the prescription recommendation stage. Based on the execution agent performing information retrieval on the second query subtask in the preset knowledge source, a second retrieval result is obtained, and the decision agent, in conjunction with the second retrieval result, performs reasoning to generate a prescription recommendation reference result. Based on the combined results of the syndrome analysis and the prescription recommendation, auxiliary diagnostic and treatment information for the user is generated.

[0006] According to the present invention, a TCM-assisted diagnosis and treatment method based on multi-agent collaboration is provided, wherein the preset knowledge source includes a text knowledge base and a TCM knowledge graph; The process of obtaining a first search result by retrieving information from the first query subtask in a preset knowledge source based on the execution agent, and obtaining a second search result by retrieving information from the second query subtask in the preset knowledge source based on the execution agent, both include: The executing agent performs text segment matching in the text knowledge base based on the current query subtask to obtain the retrieved text search results; the current query subtask is either the first query subtask or the second query subtask. The execution agent extracts entity keywords from the current query subtask and performs graph link deduction based on the entity keywords in the TCM knowledge graph to determine the graph reasoning result. The text retrieval results and the graph inference results are combined to obtain the current retrieval result corresponding to the current query subtask; the current retrieval result is either the first retrieval result or the second retrieval result.

[0007] According to the present invention, a TCM-assisted diagnosis and treatment method based on multi-agent collaboration is provided, wherein the step of extracting entity keywords from the current query subtask by the executing agent, and performing graph link inference based on the entity keywords in the TCM knowledge graph to determine the graph inference result includes: Based on the entity similarity between the entity keywords and the entities in the entity set of the TCM knowledge graph, a set of candidate entities that meet the similarity threshold is recalled from the entity set. Extract the graph association relationship between the candidate entity set and the candidate nodes in the traditional Chinese medicine knowledge graph; If the graph association relationship is that there is an association, calculate the comprehensive weight of the candidate entity in the candidate entity set to the candidate node; A weighted score is calculated based on the comprehensive weight of each candidate entity. The target node is then selected from the candidate nodes based on the weighted score results, and the path containing the target node is taken as the graph reasoning result.

[0008] According to a TCM-assisted diagnosis and treatment method based on multi-agent collaboration provided by the present invention, the step of calculating the comprehensive weight of each candidate entity in the candidate entity set to the candidate node includes: The similarity of entity features between the candidate entity and the entity keyword is evaluated and determined. The co-occurrence frequency of the candidate entity in medical knowledge items related to the candidate node is counted. Based on the co-occurrence frequency and the total number of global nodes, the importance weight of the candidate entity under the candidate node is evaluated. The entity feature similarity and importance weight are numerically fused to obtain the comprehensive weight of the candidate entity to the candidate node.

[0009] According to the present invention, a TCM-assisted diagnosis and treatment method based on multi-agent collaboration is provided, wherein the executing agent performs text segment matching in the text knowledge base based on the current query subtask to obtain the retrieved text retrieval results, including: The current query subtask and the candidate texts in the text knowledge base are vectorized to obtain query vectors and candidate text vectors, respectively. Calculate the feature similarity between the query vector and each candidate text vector, and based on the feature similarity, initially filter out a target number of candidate texts from the text knowledge base; Extract the deep relevance features between the current query subtask and each candidate text. Based on the deep relevance features, re-rank the target number of candidate texts according to their relevance. Use the candidate texts whose re-ranking meets the preset conditions as the text retrieval results.

[0010] According to the present invention, a TCM-assisted diagnosis and treatment method based on multi-agent collaboration is provided, wherein the planning agent combines the user's diagnosis and treatment feature data to generate a first query subtask for the syndrome analysis stage, including: Based on the planning intelligent agent, semantic parsing is performed on the diagnostic feature data to extract the original symptom query data; The candidate syndrome features related to the original symptom query data are deduced to construct extended query data; The original symptom query data and the extended query data are fused together to construct the first query subtask.

[0011] According to the present invention, a TCM auxiliary diagnosis and treatment method based on multi-agent collaboration is provided, wherein the auxiliary diagnosis and treatment information for the user is generated by integrating the syndrome analysis reference results and the prescription recommendation reference results, including: The consistency of the TCM logic between the syndrome analysis reference results and the prescription recommendation reference results is verified. If the consistency check passes, the syndrome analysis reference results and the prescription recommendation reference results are integrated to generate basic auxiliary diagnosis and treatment information; The corresponding literature source data is extracted from the text retrieval results, and the entity node sequence is extracted from the graph reasoning results to construct evidence tracing information; The evidence tracing information is attached to the basic auxiliary diagnosis and treatment information and output synchronously to obtain the user's auxiliary diagnosis and treatment information.

[0012] According to the present invention, a TCM-assisted diagnosis and treatment method based on multi-agent collaboration is provided, wherein the diagnostic and treatment feature data includes at least one of symptom description, physical sign information, and tongue and pulse information.

[0013] According to the present invention, a TCM-assisted diagnosis and treatment method based on multi-agent collaboration is provided, wherein the text knowledge base is constructed based on at least one of the following: ancient TCM books, TCM textbooks, TCM guidelines, and TCM clinical experience literature.

[0014] This invention also provides a TCM auxiliary diagnosis and treatment device based on multi-agent collaboration, comprising: The first task planning unit generates the first query subtask for the syndrome analysis stage based on the planning intelligent agent and the user's diagnosis and treatment characteristic data. The first retrieval and reasoning unit performs information retrieval on the first query subtask from a preset knowledge source based on the execution agent, obtains the first retrieval result, and then performs reasoning based on the decision agent in combination with the first retrieval result to generate a syndrome analysis reference result. The second task planning unit generates a second query subtask for the prescription recommendation stage based on the planning agent and the syndrome analysis reference results. The second retrieval and reasoning unit performs information retrieval for the second query subtask in the preset knowledge source based on the execution agent, obtains the second retrieval result, and then performs reasoning based on the decision agent in combination with the second retrieval result to generate a prescription recommendation reference result. The auxiliary output unit integrates the syndrome analysis reference results and the prescription recommendation reference results to generate auxiliary diagnosis and treatment information for the user.

[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the TCM auxiliary diagnosis and treatment method based on multi-agent collaboration as described above.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the TCM auxiliary diagnosis and treatment method based on multi-agent collaboration as described above.

[0017] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the TCM auxiliary diagnosis and treatment method based on multi-agent collaboration as described above.

[0018] The present invention provides a TCM-assisted diagnosis and treatment method and device based on multi-agent collaboration. First, a planning agent, combined with user input data, generates a first query subtask for the syndrome analysis stage. This subtask is then retrieved from external knowledge sources by the execution agent. After the decision agent infers and generates a staged reference result, the planning agent dynamically generates a second query subtask for the prescription recommendation stage based on the reasoning result of the first stage. Finally, the execution agent retrieves the information again, and the decision agent infers, comprehensively outputting the final auxiliary diagnosis and treatment information. This achieves dynamic cascading and multi-stage processing of diagnosis and treatment data processing tasks. Through data flow and collaborative cooperation among multiple agents at different stages, the rationality of the TCM-assisted diagnosis and treatment process, as well as the accuracy and reliability of the results, are significantly improved. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the TCM-assisted diagnosis and treatment method based on multi-agent collaboration provided by the present invention. Figure 2 This is a flowchart illustrating the dual-path concurrent retrieval method provided by the present invention; Figure 3 This is a schematic diagram of the architecture of the TCM auxiliary diagnosis and treatment system based on multi-agent collaboration provided by the present invention; Figure 4 This is a schematic diagram of the structure of the TCM auxiliary diagnosis and treatment device based on multi-agent collaboration provided by the present invention; Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0022] It should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of the embodiments of this invention, "multiple" means two or more, unless otherwise explicitly specified. Furthermore, all actions involving the acquisition of signals, information, or data in this application are performed in accordance with the applicable data protection regulations and policies of the locality and with permission granted by the owner of the relevant device.

[0023] To address the aforementioned problems, this invention provides a TCM-assisted diagnosis and treatment method based on multi-agent collaboration, in order to improve the rationality and accuracy of the final assisted diagnosis and treatment results. Figure 1 This is a flowchart illustrating the TCM-assisted diagnosis and treatment method based on multi-agent collaboration provided by the present invention, as shown below. Figure 1 As shown, the method includes: Step 110: Based on the planning agent and the user's diagnosis and treatment characteristic data, generate the first query subtask for the syndrome analysis stage.

[0024] In this step, diagnostic feature data refers to the basic case information related to diagnosis and treatment input by the user. This can include everything from basic symptom descriptions and physical signs to more detailed information such as past medical history, tongue and pulse characteristics. For example, diagnostic feature data could include symptoms such as headache, chills, absence of sweating, itchy throat, cough, thin white tongue coating, and a floating and tight pulse. Here, the planning agent refers to a model component in the system that possesses the ability to understand natural language, decompose tasks, and construct query strategies. It can be implemented based on a Large Language Model (LLM) or an instruction fine-tuning model. Here, the syndrome analysis stage corresponds to the "disease diagnosis" step in the TCM diagnosis and treatment process. It is mainly used to preliminarily infer the disease or syndrome category to which the patient belongs based on their specific manifestations. In addition, the first query subtask here refers to the preliminary retrieval instruction constructed for the disease diagnosis target. It can be an original query that only extracts the user's original symptoms, or it can include an expanded query that incorporates candidate diseases or candidate syndromes preliminarily inferred by the model.

[0025] In practical implementation, diagnostic and treatment feature data can be input into the planning agent. The planning agent, combining this data with the inherent logic of traditional Chinese medicine diagnosis and treatment, can then plan the complex diagnostic and treatment process, segmenting it into the initial syndrome analysis stage. This process dynamically generates a first query subtask specific to that stage. It should be noted that this task decomposition and targeted query task generation effectively addresses the problem of ambiguous intent in complex case scenarios, providing a clear retrieval direction for subsequent auxiliary diagnosis.

[0026] Step 120: Based on the execution agent performing information retrieval on the first query subtask in the preset knowledge source to obtain the first retrieval result, and based on the decision agent combining the first retrieval result to perform reasoning, generate syndrome analysis reference results.

[0027] In this step, the executing agent refers to a model component specifically responsible for performing information matching, precise retrieval, and logical reasoning operations within an external knowledge base. Here, the preset knowledge source is an external database that is pre-built or accessed to support medical judgment. It can cover single or multi-source heterogeneous medical data, such as unstructured textual knowledge from ancient Chinese medicine books, textbooks, and guidelines, as well as structured Chinese medicine knowledge graphs composed of medical entities and relationships.

[0028] Here, the first search result refers to the relevant supporting information found in the preset knowledge source for the first query subtask, which may include relevant literature excerpts or node inference data in a graph. Here, the decision agent refers to the model component responsible for semantic fusion, comprehensive evaluation, and final judgment of multi-source input information, usually implemented based on a large language model. Here, the syndrome analysis reference result refers to the preliminary diagnostic opinion obtained after retrieval and reasoning. For example, for the aforementioned symptoms such as headache and chills, the syndrome analysis reference result could be wind-cold exterior syndrome or exogenous wind-cold syndrome.

[0029] In practical implementation, an execution agent can comprehensively search a preset knowledge source based on the generated first query subtask, collecting relevant medical knowledge as the first search result. Then, the execution agent transmits the first search result to a decision agent, which combines these externally recalled first search results to evaluate and reason about candidate diseases or syndromes, outputting a syndrome analysis reference result. It is understandable that by introducing the support of external medical knowledge sources and a comprehensive reasoning mechanism, the objectivity and reliability of the preliminary diagnostic reference result are significantly enhanced.

[0030] Step 130: Based on the planning agent and the syndrome analysis reference results, generate a second query subtask for the prescription recommendation stage.

[0031] In this step, the prescription recommendation stage corresponds to the "treatment discussion" and "prescription" stages in the TCM diagnosis and treatment process. It is mainly used to provide symptomatic drug or treatment suggestions based on the existing disease diagnosis. Here, the second query subtask refers to the retrieval expression instructions specifically constructed for finding suitable prescriptions and treatments. Its content can include prescription retrieval information based on specific syndrome names, as well as extended queries containing candidate prescription features and pharmacological information inferred by the model.

[0032] In practical implementation, the planning agent can receive the syndrome analysis reference results output by the decision agent, use the syndrome analysis reference results obtained in the previous stage as new condition inputs, and combine them with the original diagnosis and treatment feature data to perform dynamic planning of the task dimension again, thereby constructing an accurate second query subtask for the prescription recommendation stage.

[0033] It should be noted that the TCM diagnosis and treatment process is typically multi-stage and multi-purpose. For example, it requires first determining the disease or syndrome based on the patient's symptoms, and then generating a corresponding prescription or treatment plan based on the determination result. The method provided in this invention, however, uses the syndrome analysis reference results output in the first stage to generate a second query subtask in stages, thus decoupling the TCM theory, method, prescription, and medication process. This allows the retrieval strategy in the subsequent prescription recommendation stage to adaptively and flexibly adjust based on the syndrome analysis reference results output in the previous stage.

[0034] Step 140: Based on the execution agent performing information retrieval on the second query subtask in the preset knowledge source to obtain the second retrieval result, the decision agent combines the second retrieval result to perform reasoning and generate a prescription recommendation reference result.

[0035] In this step, the second search result refers to the data closely related to prescriptions and treatment methods obtained from the preset knowledge source for the second query subtask, such as text or node information about the composition, main efficacy, and contraindications of the prescription. Here, the prescription recommendation reference result refers to the specific reference treatment plan finally deduced, such as recommending the use of the pungent-warm exterior-releasing treatment method and recommending a specific prescription such as Jingfang Dabiao Decoction.

[0036] In practical implementation, the executing agent can use the second query subtask to perform a targeted search in the preset knowledge source to obtain the second search results. Then, the executing agent transmits the second search results to the decision agent, which combines the medical evidence in the search results to screen and verify the candidate treatment suggestions, and deduce the most matching prescription recommendation to ensure the scientific nature of the prescription recommendation and the safety of medication.

[0037] Step 150: Based on the syndrome analysis reference results and the prescription recommendation reference results, generate the user's auxiliary diagnosis and treatment information.

[0038] In this step, auxiliary diagnostic information refers to the comprehensive reference diagnostic and treatment plan that the system ultimately outputs to the user and has internal logical consistency.

[0039] In practical implementation, a decision-making intelligent agent can comprehensively review and integrate the syndrome analysis reference results obtained in the diagnosis stage with the prescription recommendation reference results obtained in the prescription stage, forming a clear and organized auxiliary diagnostic information output as feedback. This provides professional medical staff with reasonable and accurate reference basis during diagnosis. Here, the auxiliary diagnostic information can cover a wide range, including basic syndrome reference judgment conclusions and recommended prescriptions, and can be further expanded to include corresponding diagnosis criteria, details of prescription composition, and evidence support paths traced back to preset knowledge sources.

[0040] The method provided in this invention first generates a first query subtask for the syndrome analysis stage by combining user input data with a planning agent. This subtask is then retrieved from external knowledge sources by an execution agent. After the decision agent infers and generates a phased reference result, the planning agent dynamically generates a second query subtask for the prescription recommendation stage based on the reasoning result of the first stage. Finally, the execution agent retrieves the information again, and the decision agent infers the result to output the final auxiliary diagnosis and treatment information. This method realizes the dynamic cascading and multi-stage processing of diagnosis and treatment data processing tasks. Through the data flow and collaborative cooperation of multiple agents at different stages, it significantly improves the rationality of the TCM auxiliary diagnosis and treatment process and the accuracy and reliability of the results.

[0041] It should be noted that existing TCM intelligent diagnosis and treatment systems are mostly based on a single knowledge source, such as text retrieval methods based on retrieval enhancement or structured reasoning methods based on knowledge graphs. While text retrieval methods can utilize large-scale unstructured text information, they suffer from limited retrieval depth, difficulty in multi-hop reasoning, and insufficient query expansion capabilities in complex diagnostic and treatment scenarios. Furthermore, knowledge graph-based methods primarily rely on nodes and their relationships for reasoning. Although they possess some structured reasoning capabilities, their knowledge representation is relatively simplified, making it difficult to fully express the rich semantic information contained in the text, which can easily lead to the loss of some semantic information in practical applications.

[0042] Therefore, to address the limitation of expression and reasoning capabilities of single-knowledge-source methods, based on any of the above embodiments, the preset knowledge sources include text knowledge bases and traditional Chinese medicine knowledge graphs.

[0043] In this context, a text knowledge base refers to a collection of natural language text data existing in unstructured or semi-structured form. This data can include cleaned and segmented fragments of traditional Chinese medicine (TCM) texts, textbooks, guidelines, and clinical experience literature. Here, a TCM knowledge graph refers to a structured network existing as a graph data structure, containing rich entities and the relationships between them. Entities include, for example, symptom nodes, disease nodes, syndrome nodes, treatment method nodes, and prescription nodes; relationships between entities include "manifests as," "corresponding syndrome," and "applicable prescription." In practical implementation, the executing agent will simultaneously perform parallel or serial data reading and matching tasks for these two different data sources.

[0044] Step 120, where the executing agent performs information retrieval on the first query subtask from a preset knowledge source to obtain a first retrieval result, and step 140, where the executing agent performs information retrieval on the second query subtask from the preset knowledge source to obtain a second retrieval result, both include: The executing agent performs text segment matching in the text knowledge base based on the current query subtask to obtain the retrieved text search results; the current query subtask is either the first query subtask or the second query subtask. The execution agent extracts entity keywords from the current query subtask and performs graph link deduction based on the entity keywords in the TCM knowledge graph to determine the graph reasoning result. The text retrieval results and the graph inference results are combined to obtain the current retrieval result corresponding to the current query subtask; the current retrieval result is either the first retrieval result or the second retrieval result.

[0045] Specifically, firstly, by executing an intelligent agent based on the current query subtask, text fragment matching is performed in the text knowledge base to obtain the retrieved text search results.

[0046] In this step, the recalled text retrieval results refer to the highly relevant reference text fragments successfully filtered from the text knowledge base. Specifically, the planning agent sends the generated first or second query subtask to the executing agent. Here, the first or second query subtask is collectively referred to as the current query subtask. After receiving the task, the executing agent converts it into a natural language query expression or vector form suitable for text retrieval, executes a matching algorithm in the text knowledge base, and extracts relevant ancient texts or textbook passages to obtain the recalled text retrieval results, providing rich contextual semantic data for the subsequent decision-making agent.

[0047] Then, the entity keywords in the current query subtask are extracted by the execution agent, and the graph link inference is performed in the TCM knowledge graph based on the entity keywords to determine the graph reasoning result.

[0048] In this step, entity keywords refer to the core terms extracted from the query task, such as specific symptom names like headache and chills. Here, the graph reasoning result refers to a series of node combinations and associated paths obtained through network topology deduction. In practice, an intelligent agent can extract structured entity keywords from the received current query subtask. Subsequently, it connects to the Traditional Chinese Medicine knowledge graph, using these keywords as a starting point, and performs layer-by-layer traversal and logical deduction within the graph's associated network to uncover the associated node data hidden deep within the graph, ultimately summarizing to form the graph reasoning result.

[0049] Furthermore, the text retrieval results and graph inference results are merged to obtain the current retrieval result corresponding to the current query subtask. Here, the current retrieval result is either the first retrieval result or the second retrieval result. In specific implementation, the executing agent merges and packages the unstructured dimension retrieved text retrieval results with the structured dimension graph inference results, such as by performing unified encapsulation or splicing operations, to generate the current retrieval result corresponding to the current query subtask, i.e., the first retrieval result for the first stage or the second retrieval result for the second stage, and then forwards this current retrieval result to the decision-making agent.

[0050] In one embodiment, Figure 2 This is a flowchart illustrating the dual-path concurrent retrieval method provided by the present invention, as follows: Figure 2 The diagram illustrates in detail the specific process of the executing agent mining information from a pre-defined knowledge source. After the user inputs a question, the query is first rewritten using a large language model to generate search instructions adapted to different data structures. In the text knowledge base retrieval branch above, multiple rewritten subqueries are input into the database. The first stage uses vector recall to quickly filter out a target number of candidate relevant documents from massive amounts of unstructured knowledge. The second stage uses a re-ranking model to extract deep relevance features, re-ranking the initially recalled documents based on relevance, thereby accurately extracting the top-ranked, high-quality documents as the retrieved text search results.

[0051] In the knowledge graph retrieval branch below, keywords from the query are extracted, and similarity evaluation and entity recall are performed on the node set of the underlying knowledge graph. Subsequently, along the association edges of the graph network, feature evaluation is performed on the relationship between the recalled entity p and the deep candidate node S, using a weighted voting mechanism, such as the formula... The comprehensive weights of each associated entity are aggregated and calculated, and the downstream candidate nodes are weighted and scored. This represents the overall weight of all n recalled entities p relative to the deep candidate node S; This represents the combined weight of the i-th recalled entity with respect to the deep candidate node S, where... This can represent the weight of the i-th recalled entity itself. Finally, the top-K core nodes with the highest scores are selected, i.e., the target nodes, and the structured inference paths containing these nodes are used as the graph reasoning results. It is understandable that these two parallel branches extract deep semantic features and rigorous logical features respectively, and their merging can provide multi-source evidence support with both breadth and depth for subsequent diagnostic reasoning.

[0052] The method provided in this invention introduces a dual-path concurrent retrieval mechanism of text knowledge base and traditional Chinese medicine knowledge graph during the information retrieval stage of the execution agent. While obtaining deep semantic information through text fragment matching, it uses graph link deduction to obtain structured association information and merges the two for output. This effectively makes up for the deficiencies of single text retrieval lacking logical chains and single graph retrieval lacking rich semantic details, realizes the complementary advantages of multi-source heterogeneous data, and greatly improves the completeness and reference value of data retrieval results in the process of assisted diagnosis and treatment.

[0053] Based on any of the above embodiments, the executing agent extracts entity keywords from the current query subtask, and performs graph link deduction in the TCM knowledge graph based on the entity keywords to determine the graph reasoning result, including: Based on the entity similarity between the entity keywords and the entities in the entity set of the TCM knowledge graph, a set of candidate entities that meet the similarity threshold is recalled from the entity set. Extract the graph association relationship between the candidate entity set and the candidate nodes in the traditional Chinese medicine knowledge graph; If the graph association relationship is that there is an association, calculate the comprehensive weight of the candidate entity in the candidate entity set to the candidate node; A weighted score is calculated based on the comprehensive weight of each candidate entity. The target node is then selected from the candidate nodes based on the weighted score results, and the path containing the target node is taken as the graph reasoning result.

[0054] Specifically, firstly, based on the entity similarity between entity keywords and entities in the entity set of the TCM knowledge graph, a candidate entity set that meets the similarity threshold is recalled from the entity set. In this step, the candidate entity set refers to the group of graph nodes that have a high surface or semantic association with the query keywords, initially screened out from the graph. In specific implementation, an intelligent agent can first perform feature representation on the extracted entity keywords using a unified encoding model. The unified encoding model can be text embeddings from bidirectional encoder representations (E5), general text embeddings (GTE), or a text vector model fine-tuned from the TCM corpus. Subsequently, the entity similarity between these features and the entity features in the graph entity set is calculated. Then, entity nodes with entity similarity greater than or equal to the similarity threshold are extracted and aggregated to form the candidate entity set.

[0055] In one embodiment, entity keywords can be vectorized and denoted as... Where i represents the index of the entity keyword, the entity set of the TCM knowledge graph is vectorized and denoted as . Here, j represents the index of each entity in the entity set. Therefore, the entity similarity between any entity keyword and any entity in the entity set can be calculated using the following formula, as shown below: ; In the formula, Represents any entity keyword With any entity in the entity set Entity similarity between them.

[0056] Then, the candidate entity set that meets the similarity threshold can be recalled from the entity set using the following formula, as shown below: ; In the formula, Represents the set of candidate entities; Indicates the similarity threshold; This refers to entities in the entity set whose keyword similarity to the i-th entity is greater than a similarity threshold. Add to the candidate entity set.

[0057] Next, the graph associations between the candidate entity set and the candidate nodes in the TCM knowledge graph are extracted. In this step, candidate nodes typically refer to target type nodes located at deeper or higher logical levels in the graph, such as syndrome nodes or disease nodes in the graph during the syndrome analysis stage. Here, graph associations refer to the edge data at the bottom layer of the knowledge graph, representing the objective medical connections between different nodes.

[0058] In practical implementation, after locking the set of candidate entities, the executing agent can retrieve and extract the connection information between these candidate entities and downstream potential target candidate nodes based on the topological structure of the graph, and clarify whether there are direct or indirect graph associations such as "symptom-syndrome".

[0059] Furthermore, assuming the graph association relationship exists, the comprehensive weight of each candidate entity in the candidate entity set to the candidate node is calculated. In this step, the comprehensive weight is a quantitative indicator that measures the contribution of a candidate entity to determining the corresponding candidate node, taking into account both the importance of the entity itself and the closeness of its association with the node.

[0060] In practical implementation, the intelligent agent can perform weight calculation logic for each confirmed entity-candidate node pair with a graph association. That is, the candidate entity only participates in the candidate node's scoring system if the two are indeed connected in the graph topology. By combining dimensions such as the co-occurrence and matching degree between nodes, the comprehensive weight of the candidate entity to the candidate node is calculated.

[0061] In one embodiment, when candidate entities If a graph association exists between the entity and the candidate node, the entity is included in the calculation of the candidate node's overall weight, as shown in the following formula: ; In the formula, Candidate entities that are related For candidate nodes The overall weight; Candidate entities are those with a graph association relationship with a candidate node.

[0062] Finally, a weighted score is calculated based on the comprehensive weights of each candidate entity. The target node is then selected from the candidate nodes based on the weighted score, and the path containing the target node is used as the graph inference result. In this step, the target node refers to the core node that, after mathematical screening, ranks highest and is most likely to represent the current data analysis result.

[0063] In practical implementation, the executing agent can aggregate and sum the comprehensive weights of all entities associated with a candidate node to obtain the final score of that candidate node. Subsequently, the executing agent sorts all candidate nodes according to their scores, selects the target node with the highest score, and then outputs the entire logical link structure from the initial symptom entity along the graph edges to the target node. This link serves as the graph inference result flowing to the decision-making agent.

[0064] The method provided in this invention, during the graph link inference process, firstly achieves accurate node recall through feature representation and similarity evaluation by the executing agent, and then performs rigorous comprehensive weight calculation and weighted scoring based on the graph association relationship between entities. Through a rigorous graph structure quantization mechanism, invalid graph walk paths are filtered out, avoiding excessive expansion of invalid data. This results in graph inference results that are not only highly accurate, but also have a complete structured inference path, thereby ensuring the correctness, reliability, and logic of the retrieved graph inference results.

[0065] Based on any of the above embodiments, the comprehensive weight of the candidate entity in the candidate entity set to the candidate node is calculated, including: The similarity of entity features between the candidate entity and the entity keyword is evaluated and determined. The co-occurrence frequency of the candidate entity in medical knowledge items related to the candidate node is counted. Based on the co-occurrence frequency and the total number of global nodes, the importance weight of the candidate entity under the candidate node is evaluated. The entity feature similarity and importance weight are numerically fused to obtain the comprehensive weight of the candidate entity to the candidate node.

[0066] Specifically, the first step is to evaluate the entity feature similarity between candidate entities and entity keywords. In this step, entity feature similarity refers to the semantic or feature space proximity between the entity keywords extracted from the user query and the candidate entities actually recalled in the knowledge graph. In practice, this can be achieved by executing an agent to calculate the distance between the vector representation of the entity keywords and the vector representation of the candidate entities, such as cosine similarity, to evaluate the matching degree between the two in the feature dimension, thereby determining the extent to which the candidate entity accurately maps the user's original input.

[0067] In addition, the co-occurrence frequency of candidate entities in medical knowledge entries related to candidate nodes is statistically analyzed. Based on the co-occurrence frequency and the total number of global nodes, the importance weight of the candidate entity under the candidate node is evaluated. In this step, co-occurrence frequency refers to the statistical count of the number of times a symptom candidate entity and a disease or syndrome candidate node co-occur in medical literature, case databases, or graph relationships. Here, the total number of global nodes refers to the overall size of disease or syndrome nodes contained in the knowledge graph. Here, importance weight refers to a statistical indicator similar to Term Frequency-Inverse Document Frequency (TF-IDF), used to measure the specific contribution of a symptom to a specific syndrome.

[0068] In practical implementation, the agent can evaluate the primary and secondary importance of a candidate entity in diagnosing a candidate node by performing a mathematical logarithmic or penalty calculation based on the co-occurrence frequency of the candidate entity and candidate node in medical knowledge entries, combined with the total number of global nodes. This effectively reduces interference from common but non-specific symptoms. Here, the importance weight of a candidate entity under a candidate node can be calculated using the following formula, as shown below: ; In the formula, Indicates candidate entities In candidate nodes The importance weights below; Indicates candidate entities In candidate nodes Co-occurrence frequency in relevant medical knowledge items; N represents the total number of global nodes; Represents candidate entities The number of candidate nodes that have a relationship.

[0069] Finally, the entity feature similarity and importance weights are numerically fused to obtain the comprehensive weight of the candidate entity to the candidate node. Specifically, the executing agent fuses the aforementioned entity feature similarity and importance weights to generate the final comprehensive weight, which is then passed to the subsequent weighted scoring stage to accurately reflect the entity's true medical reference value in the graph link deduction. Here, the comprehensive weight can be calculated using the following formula, as shown below: ; In the formula, Indicates candidate entities For candidate nodes The overall weight; Indicates importance weight; Indicates candidate entities With entity keywords The similarity of entity features between them.

[0070] The method provided in this invention calculates importance weights by statistically analyzing co-occurrence frequency and the total number of global nodes, and then numerically fuses these weights with entity feature similarity. This achieves accurate calculation of the association strength of medical entities, taking into account both the matching degree of query semantics and the statistical specificity within the medical knowledge system. It effectively avoids interference from high-frequency, non-specific symptoms on information retrieval results, and significantly improves the professional rigor and data retrieval accuracy of auxiliary diagnostic reference information without involving substantive medical diagnostic actions.

[0071] Based on any of the above embodiments, the executing agent performs text fragment matching in the text knowledge base based on the current query subtask to obtain the recalled text retrieval results, including: The current query subtask and the candidate texts in the text knowledge base are vectorized to obtain query vectors and candidate text vectors, respectively. Calculate the feature similarity between the query vector and each candidate text vector, and based on the feature similarity, initially filter out a target number of candidate texts from the text knowledge base; Extract the deep relevance features between the current query subtask and each candidate text. Based on the deep relevance features, re-rank the target number of candidate texts according to their relevance. Use the candidate texts whose re-ranking meets the preset conditions as the text retrieval results.

[0072] Specifically, firstly, the current query subtask and the candidate texts in the text knowledge base are vectorized to obtain query vectors and candidate text vectors. In the specific implementation, after the executing agent receives the current query subtask from the planning agent, it uses a unified encoding model to map the task and the large number of candidate texts in the text knowledge base into dense vectors, forming query vectors and candidate text vectors, so as to achieve efficient spatial retrieval in the subsequent process.

[0073] Next, the feature similarity between the query vector and each candidate text vector is calculated. Based on the feature similarity, a target number of candidate texts are initially selected from the text knowledge base. In this step, feature similarity refers to the distance score calculated in the multi-dimensional vector space, used to initially measure the relevance between texts. Here, the target number refers to the first-stage recall threshold preset by the system, such as the Top-K number.

[0074] In practical implementation, an intelligent agent can quickly calculate the feature similarity between the query vector and a massive pool of candidate text vectors, and sort them from high to low scores to achieve large-scale coarse-grained data recall, extracting a pool of candidate texts that meet the target number from the text knowledge base. Here, the feature similarity between the query vector and any candidate text vector can be calculated using the following formula, as shown below: ; In the formula, Represents the query vector With the j-th candidate text vector Feature similarity between them.

[0075] Furthermore, deep relevance features are extracted between the current query subtask and each candidate text. Based on these deep relevance features, the candidate texts of the target number are re-ranked according to relevance. The candidate texts whose re-ranking meets the preset conditions are then used as the text retrieval results. In this step, deep relevance features refer to the fine-grained matching information between the query and the text in terms of vocabulary, syntax, and deep logic, captured by complex models such as cross-encoders. It can be understood that the relevance re-ranking here refers to the process of further refining and rearranging the coarse recall results.

[0076] In practical implementation, the executing agent can employ a cross-encoder to perform more computationally complex interactive semantic matching on the initially selected target number of candidate texts, extracting deep relevance features and re-ranking them. Here, the cross-encoder can adopt a Transformer-based Bidirectional Encoder Representations from Transformers (BERT), BGE-reranker, or a domain-fine-tuned cross-matching model. Finally, the executing agent encapsulates the high-ranking, high-quality candidate texts that meet preset conditions into text retrieval results and passes them to the decision agent.

[0077] The method provided in this invention, by introducing a two-stage text matching mechanism of vector coarse recall and deep relevance feature reordering in the executing agent, effectively balances the computational efficiency and semantic matching accuracy of massive medical literature retrieval. It can accurately locate the most valuable paragraphs in complex unstructured medical texts, providing high-quality external evidence support for the subsequent generation of auxiliary diagnostic and treatment information, and improving the overall efficiency of data processing.

[0078] Based on any of the above embodiments, step 110 includes: Based on the planning intelligent agent, semantic parsing is performed on the diagnostic feature data to extract the original symptom query data; The candidate syndrome features related to the original symptom query data are deduced to construct extended query data; The original symptom query data and the extended query data are fused together to construct the first query subtask.

[0079] Specifically, firstly, semantic parsing of the diagnostic feature data is performed based on the planning intelligent agent to extract the original symptom query data. Here, the original symptom query data refers to the basic symptom or sign vocabulary directly extracted from the user's description.

[0080] In practice, after the planning agent receives the user's diagnosis and treatment feature data, it performs word segmentation, entity recognition, and semantic parsing to filter out redundant interjections and accurately extract the original symptom query data that represents the patient's objective physical signs.

[0081] Then, candidate syndrome features related to the original symptom query data are deduced to construct extended query data. In this step, candidate syndrome features refer to potential medical patterns or syndrome directions initially deduced from apparent symptoms based on medical logic. Here, extended query data refers to guiding query instructions that are expanded upon the original data through the internal logic of the planning system.

[0082] In practice, by planning intelligent agents and pre-trained knowledge, logical deductions can be performed on the extracted raw symptom query data to preliminarily predict the possible associated syndrome types. Then, these deduced concepts can be used to construct extended query data, enriching the semantic dimension of the retrieval.

[0083] Furthermore, the original symptom query data and extended query data are fused and constructed to generate the first query subtask for the syndrome analysis stage. In this step, fusion and construction refers to the process of structurally splicing and logically arranging the user's original subjective symptom description with the deep features objectively deduced by the intelligent agent. In specific implementation, the planning intelligent agent seamlessly fuses the objectively extracted original symptom query data with the inferred extended query data to form the first query subtask, which includes both specific manifestations and medical exploration directions. Subsequently, this comprehensive instruction is sent to the executing intelligent agent to initiate the first stage of data retrieval.

[0084] The method provided in this invention uses an intelligent agent to perform semantic parsing on the user's diagnostic and treatment feature data to extract the original symptoms, and endogenously infers relevant candidate syndrome features as extended query data. Finally, the two are merged to construct the first query subtask, which effectively bridges the semantic gap between the user's colloquial description and the professional medical knowledge base. The active extension and inference capabilities of the intelligent agent enrich the retrieval context, and can provide query instructions with higher medical guidance value at the source of data processing, thereby comprehensively improving the quality of subsequent auxiliary diagnostic and treatment reference results.

[0085] It should be noted that in the context of intelligent diagnosis and treatment in Traditional Chinese Medicine (TCM), relying solely on retrieval or generation methods is insufficient to meet practical needs. While retrieval-based methods can provide knowledge with source evidence, they lack the ability to comprehensively analyze and structurally express multiple pieces of information. Generative methods based on large language models, although possessing strong language understanding and generation capabilities, are prone to producing illusions when lacking knowledge constraints. Furthermore, because TCM diagnosis and treatment emphasizes the logical consistency of "theory, method, prescription, and medicine," the diagnostic results need to have clear evidence and reasoning processes. However, current methods combining retrieval and generation typically only use the retrieved text as input to the generation model, lacking effective constraints on the generation process and result verification mechanisms. This results in generated results that, while referencing relevant knowledge, fail to clearly indicate the corresponding knowledge source, making it difficult to interpret and verify the generated results.

[0086] Therefore, to address the problem of insufficient retrieval and generation coordination capabilities and limited interpretability, based on any of the above embodiments, step 150 includes: The consistency of the TCM logic between the syndrome analysis reference results and the prescription recommendation reference results is verified. If the consistency check passes, the syndrome analysis reference results and the prescription recommendation reference results are integrated to generate basic auxiliary diagnosis and treatment information; The corresponding literature source data is extracted from the text retrieval results, and the entity node sequence is extracted from the graph reasoning results to construct evidence tracing information; The evidence tracing information is attached to the basic auxiliary diagnosis and treatment information and output synchronously to obtain the user's auxiliary diagnosis and treatment information.

[0087] Specifically, firstly, the consistency of the TCM logic between the syndrome analysis reference results and the prescription recommendation reference results is verified. In this step, TCM logic refers to the strict correspondence between "theory, method, prescription, and medicine" in traditional medicine, that is, a specific syndrome must correspond to a specific treatment method and prescription. In practice, after the decision-making agent receives the syndrome analysis reference results from the first stage and the prescription recommendation reference results from the second stage, it can use the internalized domain rules of the Large Language Model (LLM) to perform logical verification on the correlation link between the two, and determine whether the recommended prescription truly conforms to the syndrome conclusion deduced in the previous stage, so as to screen out and intercept possible logical gaps or model illusion data.

[0088] If the consistency check passes, the syndrome analysis reference results and the prescription recommendation reference results are integrated to generate basic auxiliary diagnostic and treatment information. In this step, the basic auxiliary diagnostic and treatment information mainly includes the determined syndrome direction and the corresponding prescription plan. In specific implementation, after the decision-making agent confirms that the logic between the two-stage results is correct and the consistency check passes, the syndrome analysis reference results and the prescription recommendation reference results are structurally spliced ​​and semantically refined to generate well-organized basic auxiliary diagnostic and treatment information.

[0089] Furthermore, corresponding literature source data is extracted from the text retrieval results, and entity node sequences are extracted from the graph reasoning results to construct evidence tracing information. In this step, literature source data refers to the underlying source metadata supporting the text retrieval results, such as specific ancient book titles, chapters, or paragraph numbers of clinical guidelines. Here, entity node sequences refer to the complete structured reasoning path traversed in the knowledge graph, such as a chain of "symptom node—syndrome node—treatment method node—prescription node." Here, evidence tracing information refers to the transparent background data that supports the aforementioned basic conclusions. In specific implementation, the decision-making agent can extract specific literature source data from the text retrieval results transferred from the execution agent, while simultaneously extracting intuitive entity node sequences from the graph reasoning results. These two different dimensions of supporting materials are combined and encapsulated to construct evidence tracing information.

[0090] Next, the evidence tracing information is appended to the basic auxiliary diagnosis and treatment information and output synchronously to obtain the user's auxiliary diagnosis and treatment information. In specific implementation, the constructed evidence tracing information can be embedded or appended to the basic auxiliary diagnosis and treatment information as an explanatory appendix through a decision-making intelligent agent, forming a complete data report with both conclusions and sources, which is then output to the user as the final auxiliary diagnosis and treatment information.

[0091] The method provided in this invention performs rigorous consistency verification on the multi-stage generated results through a decision-making agent, and extracts literature sources and node sequences from the multi-source retrieval results of the executing agent to construct evidence tracing information. Finally, it achieves the synchronous output of conclusions and evidence, effectively overcoming the black box phenomenon and illusion problem that easily occurs in generative large models during data processing. Without involving direct clinical diagnosis, it significantly improves the interpretability and logical consistency of auxiliary diagnosis and treatment information, and provides reliable data references with clear information sources.

[0092] Based on any of the above embodiments, the diagnostic feature data includes at least one of symptom description, physical sign information, and tongue and pulse information.

[0093] Here, symptom description refers to the user's subjective abnormal feelings expressed in natural language, such as headache or chills. Physical signs refer to objectively manifested external characteristics or physiological data. Tongue and pulse information refers to tongue and pulse signs unique to Traditional Chinese Medicine diagnosis, such as a thin white tongue coating and a floating, tight pulse.

[0094] In practice, when the planning agent receives external input, it can be compatible with and parse multi-dimensional diagnostic feature data covering the above-mentioned symptom descriptions, physical signs information, and tongue and pulse information, and transform these multi-type representation information into the basic data for subsequent structured query tasks.

[0095] It should be noted that by limiting the diagnostic and treatment feature data to include a variety of combinations such as symptom descriptions, physical signs, and tongue and pulse information, the system's data collection entry point is ensured to fully cover the core information dimensions required by the traditional medical diagnostic methods of "observation, auscultation, inquiry, and palpation".

[0096] Based on any of the above embodiments, the text knowledge base is constructed based on at least one of the following: ancient Chinese medicine books, Chinese medicine textbooks, Chinese medicine guidelines, and Chinese medicine clinical experience literature.

[0097] Here, "ancient Chinese medicine books" refers to classic medical literature passed down through generations. "Chinese medicine textbooks" refers to modern medical teaching materials with a high degree of systematicity and standardization. "Chinese medicine guidelines" refers to standardized clinical operation guidelines recognized within the industry. "Chinese medicine clinical experience literature" refers to journals or case data containing real case data and expert insights.

[0098] In practice, the text knowledge base invoked by the executing agent is not ordinary internet text, but rather vertical domain professional data constructed by the system after pre-collecting the aforementioned highly specialized documents and processing them through data cleaning, paragraph segmentation, and metadata tagging. This effectively avoids data noise caused by general corpora and significantly enhances the industry reference value of the output results of the decision support system.

[0099] Based on any of the above embodiments Figure 3This is a schematic diagram of the architecture of the TCM auxiliary diagnosis and treatment system based on multi-agent collaboration provided by the present invention, as shown below. Figure 3 As shown, the system comprises four core components: a user interaction module, a multi-agent collaboration module, a knowledge and data layer module, and an output module. The user interaction module serves as a unified input path, acquiring basic diagnostic data such as symptom descriptions, physical signs, and tongue and pulse information input by users or doctors.

[0100] The multi-agent collaboration module is the core of the system, which integrates three agents working together: First, the planning agent uses a large language model to perform deep semantic understanding and parsing of the input information, completes query rewriting for different underlying data sources, and decomposes the complex diagnosis and treatment process into two stages: "diagnosis" (identifying the disease or syndrome) and "prescription" (recommending treatment methods or prescriptions).

[0101] Secondly, the executing agent performs specific retrieval matching and weighted voting scoring operations in the text knowledge base and knowledge graph according to the decomposed sub-task instructions. Finally, the decision-making agent is responsible for fusing and analyzing the multi-source retrieval results, and combining the evidence analysis and reasoning capabilities of the large language model to generate the final diagnosis and corresponding evidence sources. Specifically, in the text knowledge base retrieval stage, vector recall is used to quickly filter out a target number of candidate relevant documents from massive amounts of unstructured knowledge. Then, a re-ranking model is used to extract deep relevance features, and the relevance of the initially recalled documents is re-ranked to accurately extract the top-k high-quality ranked documents as the recalled text retrieval results. In the knowledge graph retrieval stage, keywords in the query are extracted, and similarity evaluation and entity recall are performed in the node set of the underlying knowledge graph to achieve symptom matching. Subsequently, along the association edges of the graph network, the relationship between the recalled nodes and deep candidate nodes is evaluated using features. A weighted voting mechanism is used, such as using a formula to summarize and calculate the comprehensive weight of each associated entity, to perform weighted scoring on downstream candidate nodes. Finally, the top-K core nodes with the highest scores are selected as target nodes, and the structured inference paths containing these nodes are used as the graph reasoning results, i.e., candidate diseases / syndromes.

[0102] At the system's core, the knowledge and data layer module provides data for the aforementioned processes. This includes not only text block vector representations processed from ancient Chinese medicine texts, textbooks, and dictionaries, but also a TCM knowledge graph covering various entity types and their relationships, such as "symptoms-diseases-treatments-prescriptions-herbs." Finally, the output module synchronously and in a structured manner presents the diagnostic results, prescription recommendations, and evidence tracing information generated by the decision-making agent to the user. It is understandable that this multi-agent collaborative architecture design allows for the flexible access and replacement of different knowledge sources and model components, thereby supporting the system's expansion and optimization in various application scenarios.

[0103] Based on any of the above embodiments Figure 4 This is a schematic diagram of the structure of the TCM auxiliary diagnosis and treatment device based on multi-agent collaboration provided by the present invention, as shown below. Figure 4 As shown, the device includes: The first task planning unit 410 generates the first query subtask for the syndrome analysis stage based on the planning intelligent agent and the user's diagnosis and treatment characteristic data. The first retrieval and reasoning unit 420 performs information retrieval of the first query subtask in a preset knowledge source based on the execution agent to obtain the first retrieval result, and then performs reasoning based on the decision agent in combination with the first retrieval result to generate a syndrome analysis reference result. The second task planning unit 430 generates a second query subtask for the prescription recommendation stage based on the planning agent and the syndrome analysis reference results. The second retrieval and reasoning unit 440 retrieves information about the second query subtask from the preset knowledge source based on the execution agent, obtains the second retrieval result, and then generates a prescription recommendation reference result based on the reasoning agent combined with the second retrieval result. The auxiliary output unit 450 integrates the syndrome analysis reference results and the prescription recommendation reference results to generate auxiliary diagnosis and treatment information for the user.

[0104] The device provided in this invention first generates a first query subtask for the syndrome analysis stage by combining user input data with a planning agent. This subtask is then retrieved from external knowledge sources by an execution agent. After the decision agent infers and generates a phased reference result, the planning agent dynamically generates a second query subtask for the prescription recommendation stage based on the reasoning result of the first stage. Finally, the execution agent retrieves the information again, and the decision agent infers the result to output the final auxiliary diagnosis and treatment information. This device realizes the dynamic cascading and multi-stage processing of diagnosis and treatment data processing tasks. Through the data flow and collaborative cooperation of multiple agents at different stages, it significantly improves the rationality of the TCM auxiliary diagnosis and treatment process and the accuracy and reliability of the results.

[0105] Based on any of the above embodiments, the preset knowledge source includes a text knowledge base and a traditional Chinese medicine knowledge graph; The device also includes a retrieval reasoning unit, which may be a first retrieval reasoning unit or a second retrieval reasoning unit, specifically used for: The executing agent performs text segment matching in the text knowledge base based on the current query subtask to obtain the retrieved text search results; the current query subtask is either the first query subtask or the second query subtask. The execution agent extracts entity keywords from the current query subtask and performs graph link deduction based on the entity keywords in the TCM knowledge graph to determine the graph reasoning result. The text search results and the graph reasoning results are combined to obtain the current search result corresponding to the current query subtask; the current search result is either the first search result or the second search result.

[0106] Based on any of the above embodiments, the retrieval reasoning unit is further specifically used for: Based on the entity similarity between the entity keywords and the entities in the entity set of the TCM knowledge graph, a set of candidate entities that meet the similarity threshold is recalled from the entity set. Extract the graph association relationship between the candidate entity set and the candidate nodes in the traditional Chinese medicine knowledge graph; If the graph association relationship is that there is an association, calculate the comprehensive weight of the candidate entity in the candidate entity set to the candidate node; A weighted score is calculated based on the comprehensive weight of each candidate entity. The target node is then selected from the candidate nodes based on the weighted score results, and the path containing the target node is taken as the graph reasoning result.

[0107] Based on any of the above embodiments, the retrieval reasoning unit is further specifically used for: The similarity of entity features between the candidate entity and the entity keyword is evaluated and determined. The co-occurrence frequency of the candidate entity in medical knowledge items related to the candidate node is counted. Based on the co-occurrence frequency and the total number of global nodes, the importance weight of the candidate entity under the candidate node is evaluated. The entity feature similarity and importance weight are numerically fused to obtain the comprehensive weight of the candidate entity to the candidate node.

[0108] Based on any of the above embodiments, the retrieval reasoning unit is further specifically used for: The current query subtask and the candidate texts in the text knowledge base are vectorized to obtain query vectors and candidate text vectors, respectively. Calculate the feature similarity between the query vector and each candidate text vector, and based on the feature similarity, initially filter out a target number of candidate texts from the text knowledge base; Extract the deep relevance features between the current query subtask and each candidate text. Based on the deep relevance features, re-rank the target number of candidate texts according to their relevance. Use the candidate texts whose re-ranking meets the preset conditions as the text retrieval results.

[0109] Based on any of the above embodiments, the first task planning unit is specifically used for: Based on the planning intelligent agent, semantic parsing is performed on the diagnostic feature data to extract the original symptom query data; The candidate syndrome features related to the original symptom query data are deduced to construct extended query data; The original symptom query data and the extended query data are fused together to construct the first query subtask.

[0110] Based on any of the above embodiments, the auxiliary output unit is specifically used for: The consistency of the TCM logic between the syndrome analysis reference results and the prescription recommendation reference results is verified. If the consistency check passes, the syndrome analysis reference results and the prescription recommendation reference results are integrated to generate basic auxiliary diagnosis and treatment information; The corresponding literature source data is extracted from the text retrieval results, and the entity node sequence is extracted from the graph reasoning results to construct evidence tracing information; The evidence tracing information is attached to the basic auxiliary diagnosis and treatment information and output synchronously to obtain the user's auxiliary diagnosis and treatment information.

[0111] Based on any of the above embodiments, the diagnostic feature data includes at least one of symptom description, physical sign information, and tongue and pulse information.

[0112] Based on any of the above embodiments, the text knowledge base is constructed based on at least one of the following: ancient Chinese medicine books, Chinese medicine textbooks, Chinese medicine guidelines, and Chinese medicine clinical experience literature.

[0113] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute an auxiliary diagnosis and treatment method based on multi-agent collaboration. This method includes: generating a first query subtask for the syndrome analysis stage based on the planning agent and the user's diagnosis and treatment feature data; retrieving information from the first query subtask in a preset knowledge source based on the execution agent to obtain a first retrieval result, and generating a syndrome analysis reference result based on the decision agent and the first retrieval result; generating a second query subtask for the prescription recommendation stage based on the planning agent and the syndrome analysis reference result; retrieving information from the second query subtask in the preset knowledge source based on the execution agent to obtain a second retrieval result, and generating a prescription recommendation reference result based on the decision agent and the second retrieval result; and generating auxiliary diagnosis and treatment information for the user by combining the syndrome analysis reference result and the prescription recommendation reference result.

[0114] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0115] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the TCM auxiliary diagnosis and treatment method based on multi-agent collaboration provided by the above methods. The method includes: generating a first query subtask for the syndrome analysis stage based on a planning agent combined with the user's diagnosis and treatment feature data; performing information retrieval on the first query subtask in a preset knowledge source based on an execution agent to obtain a first retrieval result, and generating a syndrome analysis reference result based on reasoning by a decision agent combined with the first retrieval result; generating a second query subtask for the prescription recommendation stage based on the planning agent combined with the syndrome analysis reference result; performing information retrieval on the second query subtask in the preset knowledge source based on the execution agent to obtain a second retrieval result, and generating a prescription recommendation reference result based on reasoning by the decision agent combined with the second retrieval result; and generating auxiliary diagnosis and treatment information for the user by combining the syndrome analysis reference result and the prescription recommendation reference result.

[0116] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the TCM auxiliary diagnosis and treatment method based on multi-agent collaboration provided by the above methods. The method includes: generating a first query subtask for the syndrome analysis stage based on a planning agent combined with the user's diagnosis and treatment feature data; performing information retrieval on the first query subtask in a preset knowledge source based on an execution agent to obtain a first retrieval result, and generating a syndrome analysis reference result based on reasoning by a decision agent combined with the first retrieval result; generating a second query subtask for the prescription recommendation stage based on the planning agent combined with the syndrome analysis reference result; performing information retrieval on the second query subtask in the preset knowledge source based on the execution agent to obtain a second retrieval result, and generating a prescription recommendation reference result based on reasoning by the decision agent combined with the second retrieval result; and generating auxiliary diagnosis and treatment information for the user by combining the syndrome analysis reference result and the prescription recommendation reference result.

[0117] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A TCM-assisted diagnosis and treatment method based on multi-agent collaboration, characterized in that, include: Based on the planning agent and combined with the user's diagnosis and treatment characteristic data, the first query subtask for the syndrome analysis stage is generated. Based on the execution agent performing information retrieval on the first query subtask in the preset knowledge source to obtain the first retrieval result, and based on the decision agent combining the first retrieval result to perform reasoning, a syndrome analysis reference result is generated. Based on the planning agent and the syndrome analysis reference results, a second query subtask is generated for the prescription recommendation stage. Based on the execution agent performing information retrieval on the second query subtask in the preset knowledge source, a second retrieval result is obtained, and the decision agent, in conjunction with the second retrieval result, performs reasoning to generate a prescription recommendation reference result. Based on the combined results of the syndrome analysis and the prescription recommendation, auxiliary diagnostic and treatment information for the user is generated.

2. The TCM-assisted diagnosis and treatment method based on multi-agent collaboration according to claim 1, characterized in that, The preset knowledge sources include a text knowledge base and a traditional Chinese medicine knowledge graph; The process of obtaining a first search result by retrieving information from the first query subtask in a preset knowledge source based on the execution agent, and obtaining a second search result by retrieving information from the second query subtask in the preset knowledge source based on the execution agent, both include: The executing agent performs text segment matching in the text knowledge base based on the current query subtask to obtain the retrieved text search results; the current query subtask is either the first query subtask or the second query subtask. The execution agent extracts entity keywords from the current query subtask and performs graph link deduction based on the entity keywords in the TCM knowledge graph to determine the graph reasoning result. The text retrieval results and the graph inference results are combined to obtain the current retrieval result corresponding to the current query subtask; the current retrieval result is either the first retrieval result or the second retrieval result.

3. The TCM-assisted diagnosis and treatment method based on multi-agent collaboration according to claim 2, characterized in that, The step of extracting entity keywords from the current query subtask through the executing intelligent agent, and performing graph link deduction based on the entity keywords in the TCM knowledge graph to determine the graph reasoning result includes: Based on the entity similarity between the entity keywords and the entities in the entity set of the TCM knowledge graph, a set of candidate entities that meet the similarity threshold is recalled from the entity set. Extract the graph association relationship between the candidate entity set and the candidate nodes in the traditional Chinese medicine knowledge graph; If the graph association relationship is that there is an association, calculate the comprehensive weight of the candidate entity in the candidate entity set to the candidate node; A weighted score is calculated based on the comprehensive weight of each candidate entity. The target node is then selected from the candidate nodes based on the weighted score results, and the path containing the target node is taken as the graph reasoning result.

4. The TCM-assisted diagnosis and treatment method based on multi-agent collaboration according to claim 3, characterized in that, The step of calculating the comprehensive weight of each candidate entity in the candidate entity set with respect to the candidate node includes: The similarity of entity features between the candidate entity and the entity keyword is evaluated and determined. The co-occurrence frequency of the candidate entity in medical knowledge items related to the candidate node is counted. Based on the co-occurrence frequency and the total number of global nodes, the importance weight of the candidate entity under the candidate node is evaluated. The entity feature similarity and importance weight are numerically fused to obtain the comprehensive weight of the candidate entity to the candidate node.

5. The TCM-assisted diagnosis and treatment method based on multi-agent collaboration according to claim 2, characterized in that, The process of matching text fragments in the text knowledge base based on the current query subtask by the executing intelligent agent to obtain the retrieved text search results includes: The current query subtask and the candidate texts in the text knowledge base are vectorized to obtain query vectors and candidate text vectors, respectively. Calculate the feature similarity between the query vector and each candidate text vector, and based on the feature similarity, initially filter out a target number of candidate texts from the text knowledge base; Extract the deep relevance features between the current query subtask and each candidate text. Based on the deep relevance features, re-rank the target number of candidate texts according to their relevance. Use the candidate texts whose re-ranking meets the preset conditions as the text retrieval results.

6. The TCM-assisted diagnosis and treatment method based on multi-agent collaboration according to any one of claims 1 to 5, characterized in that, The first query subtask, generated based on the planning agent and the user's diagnostic and treatment characteristic data, is geared towards the syndrome analysis stage and includes: Based on the planning intelligent agent, semantic parsing is performed on the diagnostic feature data to extract the original symptom query data; The candidate syndrome features related to the original symptom query data are deduced to construct extended query data; The original symptom query data and the extended query data are fused together to construct the first query subtask.

7. The TCM-assisted diagnosis and treatment method based on multi-agent collaboration according to any one of claims 2 to 5, characterized in that, The auxiliary diagnosis and treatment information for the user is generated by combining the syndrome analysis reference results and the prescription recommendation reference results, including: The consistency of the TCM logic between the syndrome analysis reference results and the prescription recommendation reference results is verified. If the consistency check passes, the syndrome analysis reference results and the prescription recommendation reference results are integrated to generate basic auxiliary diagnosis and treatment information; The corresponding literature source data is extracted from the text retrieval results, and the entity node sequence is extracted from the graph reasoning results to construct evidence tracing information; The evidence tracing information is attached to the basic auxiliary diagnosis and treatment information and output synchronously to obtain the user's auxiliary diagnosis and treatment information.

8. The TCM-assisted diagnosis and treatment method based on multi-agent collaboration according to any one of claims 1 to 5, characterized in that, The diagnostic and treatment feature data includes at least one of symptom description, physical signs information, and tongue and pulse information.

9. The TCM-assisted diagnosis and treatment method based on multi-agent collaboration according to any one of claims 2 to 5, characterized in that, The text knowledge base is constructed based on at least one of the following: ancient Chinese medicine books, Chinese medicine textbooks, Chinese medicine guidelines, and Chinese medicine clinical experience literature.

10. A TCM auxiliary diagnostic and treatment device based on multi-agent collaboration, characterized in that, include: The first task planning unit generates the first query subtask for the syndrome analysis stage based on the planning intelligent agent and the user's diagnosis and treatment characteristic data. The first retrieval and reasoning unit performs information retrieval on the first query subtask from a preset knowledge source based on the execution agent, obtains the first retrieval result, and then performs reasoning based on the decision agent in combination with the first retrieval result to generate a syndrome analysis reference result. The second task planning unit generates a second query subtask for the prescription recommendation stage based on the planning agent and the syndrome analysis reference results. The second retrieval and reasoning unit performs information retrieval for the second query subtask in the preset knowledge source based on the execution agent, obtains the second retrieval result, and then performs reasoning based on the decision agent in combination with the second retrieval result to generate a prescription recommendation reference result. The auxiliary output unit integrates the syndrome analysis reference results and the prescription recommendation reference results to generate auxiliary diagnosis and treatment information for the user.