An intelligent traditional Chinese medicine auxiliary diagnosis system based on knowledge graph retrieval enhanced generation
By structuring TCM knowledge through knowledge graphs and intelligent TCM auxiliary diagnosis systems, the complexity of TCM diagnosis and treatment and the limitations of traditional search engines are solved, enabling efficient and accurate TCM information retrieval and meeting the needs of modern medicine.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIV OF SCI & TECH OF CHINA
- Filing Date
- 2024-09-25
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional Chinese medicine diagnosis and treatment processes are complex and time-consuming. Traditional search engines struggle to accurately understand user intent, resulting in low information retrieval efficiency, a proliferation of false information, and an inability to meet the rapid and standardized needs of modern medicine.
An intelligent TCM diagnostic auxiliary system based on knowledge graphs is adopted. It uses large language models and vector embedding models to structure TCM knowledge, and uses knowledge graph retrieval enhancement generation technology to quickly return relevant information. Combined with intelligent retrieval mechanism, the answer method is optimized.
It enables efficient and accurate retrieval of TCM information, reduces the cognitive burden on users, improves the reliability and retrieval efficiency of information, and adapts to the rapid needs of modern medicine.
Smart Images

Figure CN119170258B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of traditional Chinese medicine auxiliary diagnosis systems, and particularly relates to an intelligent traditional Chinese medicine auxiliary diagnosis system based on knowledge graph retrieval-enhanced generation (RAG). BACKGROUND
[0002] Traditional Chinese medicine has a deep historical foundation and unique treatment concepts. Its diagnosis and treatment methods, such as acupuncture, herbal medicine, and massage, have been widely recognized and applied not only in China but also worldwide. Traditional Chinese medicine emphasizes holistic concepts and yin-yang balance, and its personalized treatment plans and emphasis on disease prevention provide valuable supplements to modern medical systems. However, the complexity of traditional Chinese medicine diagnosis and treatment processes, such as the traditional diagnostic methods of "observation, listening, questioning, and palpation," and the reliance on individual experience and intuition, make it seem out of place in the modern society's pursuit of efficient medical environments. This personalized and experiential approach to diagnosis and treatment, while providing meticulous care for patients, also leads to time-consuming treatment processes and the dispersion of resources, making it difficult to meet the modern society's demand for fast, standardized medical services. In addition, the transmission and popularization of traditional Chinese medicine knowledge also face challenges, as its profound theories and practical skills require long-term learning and practice to master.
[0003] With the rapid development of Internet technology and information technology, data and information resources in the field of traditional Chinese medicine have experienced unprecedented growth. The emergence of traditional Chinese medicine professional websites, online databases, and electronic books provides a new platform for the dissemination and application of traditional Chinese medicine knowledge. The establishment of these digital resources undoubtedly opens up new avenues for the inheritance and development of traditional Chinese culture, enabling more people to conveniently access and learn traditional Chinese medicine knowledge.
[0004] However, traditional search engines have shown obvious limitations in dealing with these professional information in traditional Chinese medicine. The keyword-based search mechanism often fails to accurately understand the user's query intent, resulting in a large amount of irrelevant or redundant information in the search results. Users face a huge amount of data and have difficulty quickly finding valuable information, which not only increases the user's cognitive burden but also reduces the efficiency of information retrieval. In addition, the proliferation of false information on the Internet makes it difficult for users to distinguish the authenticity and reliability of traditional Chinese medicine information, which is undoubtedly a great challenge for the field of traditional Chinese medicine, which requires accurate information.
[0005] In summary, the importance of traditional Chinese medicine culture in modern society is self-evident, but the complexity of its diagnosis and treatment process and the contradiction with the requirements of modern medical efficiency, as well as the limitations of traditional search engines in processing traditional Chinese medicine information, have restricted the ability of traditional Chinese medicine to adapt to modern society. In order to overcome these challenges, we need to explore more efficient and intelligent information retrieval technology, and innovate the diagnosis and treatment mode of traditional Chinese medicine, so that it can better integrate into the modern medical system and play its unique value and role. SUMMARY
[0006] The purpose of the present application is to provide an intelligent traditional Chinese medicine auxiliary diagnosis system based on knowledge graph retrieval enhancement generation, which takes professional traditional Chinese medicine knowledge as the knowledge base and uses large models as the tool for knowledge organization and summary. Through human-computer interaction, the system accurately identifies the user's needs and quickly returns the required answers, overcoming the shortcomings of traditional search engines.
[0007] The purpose of the present application is achieved by the following technical solutions:
[0008] An intelligent traditional Chinese medicine auxiliary diagnosis system based on knowledge graph retrieval enhancement generation, the system comprises a knowledge base and an online reasoning module, wherein:
[0009] The knowledge base comprises a vector knowledge base and a graph knowledge base, and the graph knowledge base is obtained by extracting knowledge and identifying entities from traditional Chinese medicine original text data sets through prompt engineering of a large language model LLM;
[0010] Among them, there are 13 types of entities: drugs, drug ingredients, diseases, symptoms, syndromes, disease groups, foods, food groups, populations, drug groups, drug dosage forms, drug properties and Chinese herbal medicine efficacy;
[0011] The large language model LLM outputs a list of triples according to the relationship between related entities in the original text corpus, and each element in the list of triples includes an entity, another entity and the relationship between the two entities;
[0012] Then use the fine-tuned M3E-large vector embedding model to vectorize the entities in the graph knowledge base, and use the approximate nearest neighbor search algorithm ANN to cluster the vectors to speed up the vector retrieval speed, and finally obtain the vector knowledge base; wherein M3E-large is a general vector embedding model;
[0013] The online inference module adopts a large language model LLM to perform named entity recognition on a user question to obtain entities related to traditional Chinese medicine, uses a fine-tuned M3E-large vector embedding model to vectorize the extracted traditional Chinese medicine-related entities, and then performs cosine similarity query with vectors in the vector knowledge base to obtain the top K entities most related to the disease in the user question; then all triples containing these entities in the graph knowledge base are queried, these triples are multi-scale sorted, the top triples are taken as known knowledge, and the user question is spliced together as an instruction input to the large language model LLM, and the corresponding query result is output by the large language model LLM.
[0014] As can be seen from the technical solutions provided by the above-mentioned application, the above-mentioned system takes professional traditional Chinese medicine knowledge as a knowledge base, takes a large model as a tool for knowledge collation and summary, accurately identifies the user's demand through human-computer interaction, and quickly returns an answer meeting the requirements, overcoming the defects of traditional search engines. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0016] Figure 1 The overall structure schematic diagram of the intelligent traditional Chinese medicine auxiliary diagnosis system based on knowledge graph retrieval enhancement generated by the embodiments of the present application is provided.
[0017] Figure 2 The overall design framework schematic diagram of the intelligent traditional Chinese medicine auxiliary diagnosis system based on knowledge graph retrieval enhancement generated by the embodiments of the present application is provided.
[0018] Figure 3 For the framework of the present application, the intelligent retrieval mechanism is added. Figure 2 The framework schematic diagram after adding the intelligent retrieval mechanism based on the framework of the present application. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments, which do not constitute a limitation on the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0020] As Figure 1As shown in the whole structure schematic diagram of the intelligent traditional Chinese auxiliary diagnosis system based on knowledge graph retrieval and enhancement generation provided by the embodiment of the application, the system comprises a knowledge base and an online reasoning module, wherein:
[0021] The knowledge base comprises a vector knowledge base and a graph knowledge base, and the graph knowledge base is obtained by knowledge extraction and entity recognition on a traditional Chinese original text data set by a large language model (LLM) through prompt engineering; wherein, 13 types of entities are contained, including drugs, drug components, diseases, symptoms, syndromes, disease groups, foods, food groups, populations, drug groups, drug dosage forms, drug properties and Chinese medicine effects;
[0022] In a specific implementation, the above traditional Chinese original text data set is derived from the following: “Traditional Chinese Clinical Diagnosis and Treatment Terms”, CPubMed-KG and TCM-SD traditional Chinese medicine field syndrome data set; “Traditional Chinese Clinical Diagnosis and Treatment Terms” comprises three parts of traditional Chinese diseases, syndromes and treatment methods, which respectively stipulate the basic terms and concepts of traditional Chinese clinical common diseases, syndromes and treatment methods, and the content has high authority and accuracy; CPubMed-KG is the largest open Chinese medical knowledge graph in China at present, the knowledge mined is derived from more than 2 million high-quality Chinese core medical journals under the Chinese Medical Association, and is updated in time, the relationship and entity standard is compatible with mainstream Chinese medical standard, the source of entity and relationship is clear, traceable and easy to identify, and the scale of the disease-centered triplets reaches 3.9 million; TCM-SD traditional Chinese medicine field syndrome data set is the first public and real scene collected traditional Chinese medicine syndrome data set, and each record in it is taken from the real scene inquiry record.
[0023] The large language model (LLM) outputs a triple list according to the relationship between the related entities in the original text corpus, and each element in the triple list comprises an entity, another entity and the relationship between the two entities;
[0024] For example, the present application determines that the traditional Chinese knowledge graph entity in the present application comprises 13 types according to the investigation and research of multiple existing traditional Chinese knowledge graphs and the characteristics of the data set, as shown in the following table 1:
[0025] Table 1: Knowledge graph entity example
[0026]
[0027] Then, the large language model (LLM) is used to complete the task of converting the original text corpus into a knowledge graph by the method of prompt engineering, that is, Text2Graph. For example, in the task of Text2Graph, the instruction prompt word input to the large language model is:
[0028] Step 1: As you traverse each sentence, think about the key entities mentioned. Entities can include objects, locations, organizations, people conditions, acronyms, documents, services, concepts, etc.
[0029] Step 2: Think about how these entities relate to each other - the correspondence. Entities mentioned in the same sentence or the same paragraph are usually related to each other. Entity types are limited to drugs, drug ingredients, diseases, symptoms, syndromes, disease groups, foods, food groups, populations, drug groups, drug dosage forms, drug natures, and Chinese medicine effects. If other types of entities are extracted, please automatically filter them out.
[0030] Step 3: Find the relationship between each pair of related entities. Finally, format the output as a json list. Each element in the list contains a pair of entities and their relationship, as follows: "node_1": "concept extracted from the extracted entity" "node_2": "related concept extracted from the extracted entity" "edge": the relationship between node1 and node2 concepts in one or two sentences.
[0031] The text to be converted is as follows: {Chinese medicine text}.
[0032] According to the above prompt words, the text "Heart Yin and Blood Deficiency Syndrome is caused by Yin deficiency and blood loss, resulting in heart and spirit deficiency. Clinically, it is characterized by palpitations, dizziness, irritability, easy fright, insomnia, nightmares, forgetfulness, tongue red, pulse thin and rapid, accompanied by pale face, red cheeks, night sweats, etc. " is converted into a knowledge graph triple, and the result is as follows: "node_1" and "node_2" represent the entities in the triple, and "edge" represents the relationship between the two entities.
[0033] {"node_1":"Heart Yin and Blood Deficiency Syndrome","node_2":"palpitations","edge":"associated symptoms"},{"node_1":"Heart Yin and Blood Deficiency Syndrome","node_2":"dizziness","edge":"associated symptoms"},{"node_1":"Heart Yin and Blood Deficiency Syndrome","node_2":"irritability","edge":"associated symptoms"},{"node_1":"Heart Yin and Blood Deficiency Syndrome","node_2":"easy fright","edge":"associated symptoms"},{"node_1":"Heart Yin and Blood Deficiency Syndrome","node_2":"insomnia","edge":"associated symptoms"},{"node_1":"Heart Yin and Blood Deficiency Syndrome","node_2":"nightmares","edge":"associated symptoms"},{"node_1":"Heart Yin and Blood Deficiency Syndrome","node_2":"forgetfulness",
[0034] "edge": "accompanying symptoms"}, {"node_1": "heart yin blood deficiency", "node_2": "tongue red", "edge": "tongue features"}, {"node_1": "heart yin blood deficiency", "node_2": "pulse thin and rapid", "edge": "pulse features"}}, {"node_1": "heart yin blood deficiency", "node_2": "pale complexion", "edge": "facial features"}, {"node_1": "heart yin blood deficiency", "node_2": "cheek redness", "edge": "facial features"}, {"node_1": "heart yin blood deficiency", "node_2": "night sweats", "edge": "accompanying symptoms"}
[0035] Then, using the fine-tuned M3E-large (Moka Massive Mixed Embedding model-large) vector embedding model, the entities in the atlas knowledge base are vectorized, and an approximate nearest neighbor search algorithm (ANN) is used to cluster the vectors to speed up vector retrieval speed, and finally a vector knowledge base is obtained; wherein M3E-large is a general-purpose vector embedding model;
[0036] In a specific implementation, in order to make the M3E-large vector embedding model achieve better results on the traditional Chinese medicine data set, the application uses contrastive learning for fine-tuning. Contrastive learning fine-tuning requires labeled positive and negative samples, but there is currently no publicly available data set that meets the requirements. Therefore, based on the “TCM Clinical Diagnosis and Treatment Terminology”, this paper uses the method of In-batch negatives to construct 5000 samples, each sample contains a question and its correct answer (i.e. positive sample) and an incorrect answer (negative sample). The specific method is that since the same section of the “TCM Clinical Diagnosis and Treatment Terminology” is the same category of diseases and their explanations, the application tries to put the diseases in the same section in the same batch (batch) sample when constructing the fine-tuning data. Then, for the construction of positive and negative samples, the application rewrites the explanation of the disease into a question, sets the disease as the positive sample answer, and sets the positive sample of other samples in the same batch as the negative sample of the disease question, i.e. the In-batch negatives strategy, by which all positive and negative samples can be constructed. In the training stage, the application uses the commonly used Triplet Loss function as the loss function, i.e. the learning goal is to make the distance between the positive sample and the question smaller and the distance between the negative sample and the question larger, so as to achieve better sample differentiation effect. In order to speed up the retrieval efficiency, the application uses the approximate nearest neighbor search algorithm ANN to complete clustering and storage of the vector knowledge base vectors, i.e. vectors with similar distances are classified into a class. In the subsequent retrieval stage, the target vector only needs to first calculate the distance with the cluster centers of all classes in the vector knowledge base, so as to quickly locate the most similar class.
[0037] The online inference module uses a large language model LLM to perform named entity recognition on the user question to obtain entities related to traditional Chinese medicine, i.e. the 13 entities in Table 1. The fine-tuned M3E-large vector embedding model is used to vectorize the extracted traditional Chinese medicine related entities, and then cosine similarity query is performed with the vectors in the vector knowledge base to obtain the top K entities most related to the disease in the user question. Then, all triples containing these entities are queried in the graph knowledge base. These triples are multi-scale sorted, and the top-scoring triples are taken as known knowledge and concatenated with the user question as an instruction input to the large language model LLM, and the corresponding query result is output by the large language model LLM.
[0038] As Figure 2The overall design framework diagram of the intelligent traditional Chinese medicine auxiliary diagnosis system based on the knowledge graph is shown. In the practice of traditional Chinese medicine, the treatment method usually contains three key elements: population, syndrome, and symptoms. For different patient groups, even if they exhibit similar disease characteristics, the treatment strategy may be very different. For example, the treatment plan for children with cold and fever is often different from that for adults with cold and fever; due to the different body parts where discomfort occurs, the treatment methods are also different, such as pain in the shoulder and back and pain in the eyes, which have completely different treatment methods. Therefore, when screening triplets, the importance of the entity type in the triplet needs to be considered. In the screening of triplets in the online reasoning module, a multi-scale fusion scoring method is used to sort the scores after fusion of different features, and the top-scoring triplets are screened out.
[0039] Specifically, by calculating the cosine similarity distance between the traditional Chinese medicine related entities in the user question and the entities in the vector knowledge base, the top K entities with the smallest distance are found, and then in the graph knowledge base, triplets containing these entities are found, which are defined as candidate triplets. Since there are many retrieved triplets, in order to find the triplet with the strongest relevance to the user question, further screening is needed. First, the candidate triplets are concatenated into sentences, and then the M3E-large model after fine-tuning is used for vectorization, and the cosine similarity with the user question after vectorization is calculated. The cosine similarity result is the initial score of the triplet.
[0040] According to the different entity types contained in the triplet, the score of the triplet is multiplied by different weights. When the user question contains population entities, syndrome entities, and symptom entities, the score of the triplet containing these three entities will also be reduced (the smaller the score, the greater the relevance to the user question).
[0041] Finally, sort the triplets by score from small to large, and delete the top 25% of triplets to complete the retrieval.
[0042] The retrieved triplets are concatenated into sentences as known knowledge that can be used by the large language model to reply to the user question, and are concatenated with the user question as an instruction input to the large language model LLM, and the large language model LLM outputs a reply.
[0043] In specific implementation, the instruction template for the large language model to reply to the question is as follows:
[0044] Please reply to the user question: {user question} based on the known knowledge: {triplet}.
[0045] In a simple scenario, Figure 2The system shown in the embodiment can already meet the requirements. However, in some special cases, such as general questions unrelated to traditional Chinese medicine, the answer cannot be found by searching the knowledge base; for complex questions, multiple rounds of searching are required to obtain the answer. Therefore, this embodiment of the invention designs an intelligent retrieval mechanism, allowing the system to select an appropriate retrieval method based on the user's different intentions and the difficulty of the question, such as... Figure 3 The system, as shown in the schematic diagram, also includes a general intent recognition module and a self-reflection module.
[0046] The intent recognition module is used to determine that when the retrieved user question is unrelated to the content of the knowledge base, it is a general intent question. In this case, the retrieval module is skipped and the Large Language Model (LLM) answers the question based on the corpus learned in the pre-training stage, thereby improving retrieval efficiency. Setting up this module can also prevent information with poor relevance to the question from "misleading" the Large Language Model, causing it to "illusion" and reducing the reliability of the answer.
[0047] The intent recognition module is implemented through a classifier: in completing the named entity recognition task, the large language model LLM additionally answers the entity type. If the entity type belongs to one of the 13 types of entities, it is judged to be a question related to traditional Chinese medicine; otherwise, it is judged to be a general intent question.
[0048] In addition, such as Figure 3 As shown, the system also includes a self-reflection module. When faced with complex problems where a single-round retrieval cannot generate an answer that contains all the knowledge needed to answer the user's question, a discriminator is added before the Large Language Model (LLM) outputs the answer to determine the relevance of the answer to the user's question. If the discriminator determines that the answer is irrelevant, similar entities are added for another iterative retrieval, dynamically expanding the entity list and increasing the number of candidate triples. Specifically:
[0049] The relevance discriminator is implemented by the Large Language Model (LLM) through prompting engineering. For example, the instruction template is: "Given the user question is: {User Question}; Your output is: {Output of the Large Language Model (LLM)}. Does your output answer the user question?" If the answer is no, a second round of retrieval is performed.
[0050] The formulas for dynamically expanding triples are shown in equations (1) and (2). Given a graph knowledge base KG, in the i-th round of retrieval, based on the entity list {e i} Obtain all elements containing {e} from the graph knowledge base KG i Triplet i ,Right now:
[0051] Triplet i =KG(Triplet) i |{e i}) (1)
[0052] Wherein, KG() represents retrieval from the knowledge graph library;
[0053] In the triplets Triplet i , all entities contained in the triplets Triplet i are obtained and used as the retrieval source of the i+1th round of retrieval, that is:
[0054] Triplet i+1 = KG(Triplet i+1 |GetEntity(Triplet i )) (2)
[0055] The triplets Triplet i+1 obtained through formula (1) and (2) are finally the triplets after dynamic expansion;
[0056] The correlation discriminator is used to make the system have a self-reflection mechanism and continuously optimize its answers.
[0057] It should be noted that the contents not described in detail in the embodiments of the present application belong to the prior art known to those skilled in the art.
[0058] In summary, the system described in the embodiments of the present application has the following advantages:
[0059] 1. The system described in the embodiments of the present application does not perform pre-training of a large model, but uses a method of knowledge graph retrieval enhancement generation to obtain relevant traditional Chinese medicine knowledge, which is input to a large language model LLM, and the large language model LLM induces and generates a user's reply. The advantage of this design is that as traditional Chinese medicine technology develops, newly added knowledge and cases can not need to be learned by the large language model LLM through pre-training or fine-tuning, which can greatly save the computing power and time cost of pre-training;
[0060] 2. The present application uses knowledge graph triplets to perform knowledge distillation on original traditional Chinese medicine texts, uses a combination of a graph knowledge base and a vector knowledge base to replace the original vector knowledge base, and achieves the purpose of converting the knowledge base from unstructured data to structured data, to help the large language model LLM better capture key information in the prompt words;
[0061] 3. The intelligent retrieval mechanism used in the present application can allow the system to select a suitable retrieval method according to different intents and problem difficulties of user questions.
[0062] The above description is merely preferred embodiments of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions easily conceived by those skilled in the art within the technical scope disclosed by the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims. The information disclosed in the background section of the present application is merely intended to deepen the understanding of the general background of the present application, and should not be regarded as acknowledging or implying in any form that the information constitutes the prior art known to those skilled in the art.
Claims
1. An intelligent traditional Chinese auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation, characterized in that, The system comprises a knowledge base and an online reasoning module, wherein: The knowledge base comprises a vector knowledge base and a graph knowledge base, and the graph knowledge base is obtained by a large language model (LLM) through prompt engineering on a traditional Chinese medicine (TCM) original text data set for knowledge extraction and entity recognition; The graph knowledge base comprises 13 types of entities, including drugs, drug components, diseases, symptoms, syndromes, disease groups, foods, food groups, populations, drug groups, drug dosage forms, drug natures and flavors, and TCM efficacies; The LLM outputs a list of triples according to the relationships between the relevant entities in the original text corpus, and each element in the list of triples comprises an entity, another entity, and the relationship between the two entities; The M3E-large vector embedding model is then used to vectorize the entities in the graph knowledge base, and an approximate nearest neighbor (ANN) algorithm is used to cluster the vectors to speed up vector retrieval, and finally a vector knowledge base is obtained; the M3E-large is a general vector embedding model; The online reasoning module uses the LLM to perform named entity recognition on the user's question to obtain TCM-related entities, uses the M3E-large vector embedding model to vectorize the extracted TCM-related entities, and then performs cosine similarity query on the vectors in the vector knowledge base to obtain the top K entities most relevant to the disease in the user's question; then, all triples containing these entities are queried in the graph knowledge base, the triples are sorted in multiple dimensions, and the triples with high scores are taken as known knowledge and concatenated with the user's question as an instruction input to the LLM, and the LLM outputs the corresponding query result; In the triple screening step of the online reasoning module, a multi-scale fusion scoring method is used to sort the scores after feature fusion to screen the triples with high scores; The cosine similarity distance between the TCM-related entities in the user's question and the entities in the vector knowledge base is calculated to find the top K entities with the smallest distance, and then the triples containing these entities are found in the graph knowledge base, which are defined as candidate triples; After the candidate triples are concatenated into sentences, the M3E-large model is used for vectorization, and the cosine similarity between the vectorized user's question and the vectorized triples is calculated, and the cosine similarity result is the initial score of the triples; According to the different types of entities contained in the triples, the score of the triples is multiplied by different weights, and when the user's question contains population entities, syndrome entities, and symptom entities, the score weights of the triples containing these three types of entities are also reduced; Finally, the triples are sorted in ascending order of scores, and the triples with scores ranking in the last 25% are deleted to complete the retrieval; The retrieved triples are concatenated into sentences as known knowledge for the LLM to reply to the user's question, and the concatenated triples and the user's question are input to the LLM as an instruction, and the LLM outputs the corresponding answer.
2. The intelligent traditional Chinese auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation according to claim 1, characterized in that, The system also comprises a general intent recognition module, which is used to determine that the user question is a general intent question when it is found that the user question is irrelevant to the knowledge base content, then directly skip the retrieval module, and answer by the large language model LLM relying on the corpus learned in the pre-training stage, to improve the retrieval efficiency; The intent recognition module is implemented by a classifier, specifically: in the completion of the named entity recognition task, let the large language model LLM additionally answer the entity type, if the entity type belongs to one of the 13 entities, it is determined to be a traditional Chinese medicine related question; If not, the user question is determined to be a general intent question. 3.The intelligent traditional Chinese auxiliary diagnosis system based on knowledge graph retrieval and enhanced generation of claim 1, wherein, The system also comprises a self-reflection module, which is used to add a relevance discriminator for judging the relevance of the answer to the user question before the large language model LLM outputs the answer when the single round retrieval generates an answer that does not contain all the knowledge to answer the user question, if it is determined to be irrelevant, then add similar entities and do another iteration retrieval, which dynamically expands the entity list and increases the number of candidate triples, specifically: The relevance discriminator is completed by the large language model LLM through prompt engineering; The formula of dynamically expanding triplets is shown as formulas (1) and (2). Given a graph knowledge base KG, in the i-th round of retrieval, based on the entity list {e i} all triplets Triplet i} containing {e i} in the graph knowledge base KG are obtained, that is: (1) Wherein, KG() represents retrieval from the graph knowledge base; In the triplet Triplet i , all entities contained in this triplet Triplet i are obtained and used as the search source for the (i+1)th round of search, i.e.: (2) Finally, the triplet Triplet obtained by formula (1) and (2) i+1 is the dynamic expansion of the triplet result; The use of the relevance discriminator enables the system to have a self-reflection mechanism, which can continuously optimize its own answers.