An agent-skill-based traditional Chinese medicine personalized interrogation method and system
By constructing a TCM consultation knowledge base, a personalized consultation module, a Skills orchestration and execution module, and a reflection and optimization module, the problems of incomplete multimodal information collection, unreliable static knowledge base, and lack of dynamic closed loop in the TCM consultation system have been solved, realizing the standardization, intelligence, and closed-loop controllability of TCM consultation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN UNIV OF TECH
- Filing Date
- 2026-04-15
- Publication Date
- 2026-07-14
AI Technical Summary
Existing TCM consultation systems suffer from problems such as incomplete multimodal information collection, unreliable static knowledge base support, lack of dynamic closed-loop consultation process, lack of systematic risk verification, and lack of self-reflection and iterative correction mechanism for output results.
The method and system of personalized TCM consultation based on Agent-Skills are adopted. The TCM consultation knowledge base module is used to extract and index knowledge elements, the personalized consultation module is used to process and jointly represent multimodal data, the Skills orchestration and execution module is used to decompose the consultation process into skill units, and the consistency assessment and security verification are carried out through the reflection and optimization module. The interactive consultation interface generation module dynamically generates the user interface.
It significantly improves the completeness of consultation information collection and the interpretability of the reasoning process, reduces unfounded output and risk omissions, enhances the reliability and security of system output, and realizes the standardization, intelligence and closed-loop control of TCM pre-diagnosis consultation.
Smart Images

Figure CN122392883A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent medical information technology and artificial intelligence interaction technology, and in particular to a personalized TCM consultation method and system based on Agent-Skills. Background Technology
[0002] In recent years, with the deep application of Large Language Models (LLMs) in the medical field, intelligent consultation systems based on multi-agent collaboration have become a research hotspot. These systems typically cover complex task chains by configuring multiple dedicated agents for tasks such as consultation data collection, knowledge retrieval, syndrome reasoning, and risk control, aiming to improve the comprehensiveness and automation level of consultation.
[0003] However, while multi-agent architecture brings enhanced capabilities, it also significantly increases the engineering complexity of the system. Specifically: frequent communication of context and intermediate conclusions between agents can easily lead to information loss, inconsistent states, and blurred responsibility boundaries; different agents have different prompt word designs and tool invocation methods, lacking unified input / output constraints, resulting in poor stability and reproducibility of the collaboration chain, and the same input may produce unpredictable process paths; furthermore, the implementation of engineering mechanisms such as parallel and serial scheduling, failure retries, and rollback degradation for multi-agent systems, if relying solely on natural language protocols or temporary rules, will lead to high maintenance costs, difficult debugging, uncontrollable performance, and compliance auditing challenges when the system is deployed at scale.
[0004] The aforementioned problems are particularly prominent in the specific field of TCM consultation. TCM clinical practice relies heavily on the comprehensive collection and diagnostic analysis of multidimensional information, including the patient's chief complaint, accompanying symptoms, past medical history, allergy history, medication history, and tongue and pulse examination. Existing online consultation or pre-consultation solutions generally suffer from the following shortcomings: First, the input format is limited, mainly consisting of text forms, making it difficult to effectively integrate multimodal information such as voice descriptions, tongue / facial images, and vital sign scales, resulting in incomplete information collection and a lack of objective evidence. Second, there is insufficient knowledge support; traditional rule bases or static question-answering databases are costly to update and cannot provide reliable dynamic evidence for generative question answering, easily leading to unfounded inferences or contradictions. Third, the consultation process lacks dynamism, failing to provide targeted follow-up questions based on changes in patient descriptions; the fixed interface makes it difficult to form a closed loop of "collection-reasoning-re-collection." Fourth, there is a lack of systematic security verification mechanisms; there is a lack of effective risk identification and explainable prompts for red flag symptoms, acute and severe risks, or contraindications for medication in special populations. Fifth, there is a lack of self-reflection and iteration mechanisms; when evidence is insufficient or the model output has high uncertainty, it is unable to conduct confidence assessments, evidence consistency verification, and iterative correction of the output results. Summary of the Invention
[0005] This invention provides a personalized TCM consultation method and system based on Agent-Skills to address the technical problems in existing TCM consultation systems, such as incomplete multimodal information collection, unreliable static knowledge base support, lack of dynamic closed-loop consultation process, lack of systematic risk verification, and lack of self-reflection and iterative correction mechanism for output results.
[0006] In a first aspect, embodiments of the present invention provide a personalized TCM consultation system based on Agent-Skills, comprising: The TCM consultation knowledge base construction module is used to identify and extract TCM diagnosis and treatment knowledge elements from TCM knowledge sources, and to build a knowledge retrieval index based on the TCM diagnosis and treatment knowledge elements; the TCM diagnosis and treatment knowledge elements include symptoms, signs, tongue appearance, pulse appearance, syndrome, treatment method, prescription, drugs and contraindications. The personalized consultation module is used to receive multimodal data collected during the consultation process, including text, voice, and image data; to sequentially perform multimodal processing and parsing, modal feature extraction and fusion on the received multimodal data to obtain a joint representation; and to perform information retrieval and context enhancement in the knowledge retrieval index based on the joint representation, and output an evidence set. The Skills orchestration and execution module is used to break down the consultation process into skill units, execute the skill links composed of the skill units based on the structured skill definition and strategy routing mechanism, and output the consultation reasoning results. The reflection and optimization module is used to perform consistency assessment and security verification on the diagnosis reasoning results, and trigger an iterative correction signal when the verification fails; the consistency assessment and security verification includes confidence estimation, evidence alignment consistency verification and rule constraint security verification; The interactive consultation interface generation module is used to dynamically generate user interface (UI) components based on the progress of the consultation, receive interaction events generated by the user interacting with the UI components, and send the interaction events back to the Skills orchestration and execution module to drive the execution of subsequent skill chains.
[0007] Preferably, the TCM consultation knowledge base construction module includes: The knowledge element extraction submodule is used to standardize and map professional terms in TCM knowledge sources and normalize synonyms. It establishes ontology relation constraints that include at least symptoms, signs, tongue appearance, pulse appearance, syndrome, treatment method, prescription, drugs and contraindications, and outputs a structured knowledge element set. The knowledge entry submodule is used to take the set of structured knowledge elements as knowledge entries, perform multi-granularity segmentation and standardization of the knowledge entries at the article level, paragraph level, question and answer level, case level or prescription level, and configure source identifier, applicable conditions, topic tags, confidence information and version information for the segmented knowledge fragments; the version information includes at least one of version number, creation time and change record. The knowledge retrieval index submodule is used to construct vector indexes and keyword indexes for the knowledge fragments, and to perform multi-way recall fusion ranking on the knowledge fragments using semantic similarity recall, keyword recall, and rule recall.
[0008] Preferably, the knowledge element extraction submodule further performs semantic alignment of TCM diagnosis and treatment knowledge elements based on terminology standardization and ontology modeling, and outputs a structured knowledge element set containing the TCM diagnosis and treatment knowledge elements and the relationships between them.
[0009] Preferably, the personalized consultation module includes: The multimodal data processing and parsing submodule is used to clean, standardize, and align the text statements, speech-to-text, tongue images, and structured vital signs data in the multimodal data, and output a unified data representation. The modal feature extraction and fusion submodule is used to generate vector representations for different modal data, and to perform cross-modal alignment and fusion on the generated vector representations to construct a joint representation; The information retrieval and enhancement generation submodule is used to retrieve and recall knowledge fragments in the knowledge retrieval index submodule based on the joint representation, and to perform reordering, redundancy removal and conflict resolution on the recalled knowledge fragments, and output an evidence set.
[0010] Preferably, the Skills orchestration and execution module includes: The structured skill definition and task encapsulation submodule is used to define the input, output, parameter constraints, dependencies and failure fallback strategies of skill units using structured skill description files, and encapsulate the collection of chief complaints, follow-up questions on accompanying symptoms, completion of tongue and pulse information, generation of syndrome candidates, risk warnings and medical advice into corresponding skill units. The strategy routing and task scheduling execution submodule is used to obtain consultation context information, dynamically determine the execution order and execution path of skill units based on the consultation context information, and execute at least one of the following strategies: parallel execution, timeout control, retry mechanism and rollback; the consultation context information includes user profile, dialogue state, evidence coverage and risk level information; The MCP external integration submodule is used to call external services through a unified tool protocol. These external services include knowledge base retrieval service, speech-to-text service, image analysis service, scale service, and tabu verification service.
[0011] Preferably, the reflection and optimization module includes: The output self-testing submodule is used to perform confidence quantification assessment and uncertainty detection on the syndrome judgment, suggestion generation and risk warning in the diagnosis reasoning results, and to execute follow-up questioning strategy, supplementary retrieval strategy or assertion downgrade strategy when the confidence is lower than the preset threshold or the uncertainty is higher than the preset threshold. The evidence verification submodule is used to verify whether the key assertions in the consultation reasoning results are supported by the evidence set, and to perform evidence completion, assertion downgrading, reordering or regeneration strategies for key assertions that are not supported by the evidence set. The risk control submodule is used to perform constraint checks based on the rule base for red flag symptoms, acute and severe disease risks, drug interactions, and contraindications for specific populations, and to generate medical advice or prompts for manual processing when risks are triggered; the specific populations include children, the elderly, and pregnant women.
[0012] Preferably, the interactive consultation interface generation module includes: The task parsing submodule is used to obtain dialogue records and consultation context information from the Skills orchestration and execution module, and receive iterative correction signals from the reflection and optimization module. Based on the obtained dialogue records, consultation context information and iterative correction signals, it derives the fields to be collected, follow-up questions, upload items and result display strategies, and generates a set of interface component generation instructions. The UI generation submodule is used to call input form components, image upload components, scale components, evidence reference cards and risk warning cards from the standardized component library according to the instruction set, and combine them to generate a renderable interface layout structure. The interaction submodule is used to establish a two-way binding relationship between UI components and consultation data, and to send user input events, upload events and confirmation events back to the Skills orchestration and execution module; The efficient update submodule is used to perform differential calculations on changes to the interface layout structure and consultation data, and to incrementally render and update them asynchronously.
[0013] Preferably, the task parsing submodule is further configured to perform joint parsing on the received user-input consultation text, speech-to-text text, image analysis results, and consultation context information, extract and structure a representation of at least one of the following from the parsing results: chief complaint, accompanying symptoms, duration, triggering factors, past medical history, allergy history, medication history, physical examination requirements, tongue or pulse examination requirements, and risk warning triggering conditions. The structured representation is then mapped to the interface component generating instruction set, which includes at least field type, collection priority, mandatory constraints, validation rules, display conditions, and jump logic.
[0014] Preferably, the UI generation submodule is further used to call dynamic form components, single or multiple selection components, scale components, image upload components, voice input components, evidence citation display components, risk prompt components, and consultation summary components from the standardized component library, and combine them to generate an interface tree structure. The interface tree structure is generated through a layout framework. The layout framework executes an adaptive layout strategy according to the consultation stage or risk level. The adaptive layout strategy includes component grouping, collapsing and expanding, step-by-step guidance, and highlighting prompts.
[0015] Secondly, embodiments of the present invention provide a personalized TCM consultation method based on Agent-Skills, including: S1. Identify and extract TCM diagnostic and treatment knowledge elements from TCM knowledge sources, and construct a knowledge retrieval index based on the TCM diagnostic and treatment knowledge elements; the TCM diagnostic and treatment knowledge elements include symptoms, signs, tongue appearance, pulse appearance, syndrome, treatment method, prescription, drugs and contraindications. S2. Receive multimodal data collected during the consultation process, including text, voice, and image data; sequentially perform multimodal processing and parsing, modal feature extraction and fusion on the received multimodal data to obtain a joint representation; based on the joint representation, perform information retrieval and context enhancement in the knowledge retrieval index to output an evidence set; S3. Decompose the consultation process into skill units, execute the skill link composed of the skill units based on the structured skill definition and strategy routing mechanism, and output the consultation reasoning result; S4. Perform consistency assessment and security verification on the consultation reasoning results, and trigger an iterative correction signal if the verification fails; the consistency assessment and security verification includes confidence estimation, evidence alignment consistency verification and rule constraint security verification; S5. Dynamically generate UI components based on the progress of the consultation, receive interaction events generated by the user interacting with the UI components, and drive the execution of subsequent skill links based on the interaction events.
[0016] This invention provides a personalized TCM (Traditional Chinese Medicine) consultation method and system based on Agent-Skills. The system uses a TCM consultation knowledge base construction module to structurally extract and index diagnostic knowledge elements such as symptoms, tongue and pulse, syndromes, and prescriptions, forming a standardized knowledge retrieval foundation. Based on this, a personalized consultation module performs unified processing and joint representation of collected multimodal data, including text, voice, and images. Based on this representation, it performs information retrieval and context enhancement within the knowledge retrieval index, outputting an evidence set. Subsequently, a Skills orchestration and execution module decomposes the consultation process into reusable and composable skill units, executing skill links according to preset structured contracts and dynamic routing strategies, outputting inference results. A reflection and optimization module performs confidence estimation, evidence consistency verification, and security constraint verification on these results, triggering iterative correction signals when failures occur, thus forming a closed-loop optimization. Finally, an interactive consultation interface generation module dynamically generates UI components based on the consultation progress and sends user interaction events back to the Skills orchestration module to drive subsequent links. By leveraging multimodal RAG and structured skill links, the completeness of consultation information collection and the interpretability of the reasoning process are significantly improved. The reflective verification mechanism effectively reduces unfounded output and risk omissions, enhancing the reliability and security of the system output. Meanwhile, the dynamically generated interactive interface can adaptively adjust according to the consultation stage, reducing invalid questions and manual intervention, thereby achieving standardization, intelligence, and closed-loop controllability of TCM pre-diagnosis consultation. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a block diagram of the Agent-Skills-based personalized TCM consultation system provided in an embodiment of the present invention. Figure 2 The flowchart of the agent-skills-based personalized TCM consultation method provided in this embodiment of the invention is shown. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Figure 1 This is a structural block diagram of a personalized TCM consultation system based on Agent-Skills according to an embodiment of the present invention, with reference to... Figure 1 The system includes: The TCM consultation knowledge base construction module 100 is used to identify and extract TCM diagnosis and treatment knowledge elements from TCM knowledge sources, and to construct a knowledge retrieval index based on the TCM diagnosis and treatment knowledge elements; the TCM diagnosis and treatment knowledge elements include symptoms, signs, tongue appearance, pulse appearance, syndrome, treatment method, prescription, drugs and contraindications.
[0021] Among them, TCM knowledge sources refer to TCM ancient books, TCM pharmacopoeias, clinical diagnosis and treatment guidelines, medical records of famous doctors, medical records, and other sources of knowledge related to TCM diagnosis and treatment. Specific TCM diagnosis and treatment knowledge elements include symptoms (such as headache, fever), signs (such as pale complexion), tongue appearance (such as red tongue with yellow coating), pulse appearance (such as wiry and rapid pulse), syndromes (such as liver qi stagnation), treatment methods (such as soothing the liver and relieving stagnation), prescriptions (such as Xiaoyao San), drugs (such as Bupleurum and Angelica), and contraindications (such as contraindications for pregnant women, drug interactions). Terminology standardization refers to the unified mapping and merging of synonyms, colloquialisms, and ancient book variants of symptoms, signs, tongue appearance, pulse appearance, syndromes, treatment methods, prescriptions, drugs, and contraindications in TCM knowledge sources, forming a unique standard terminology expression. Ontology modeling refers to constructing entity relationship constraints based on TCM diagnosis and treatment logic, namely "symptoms-signs-tongue appearance-pulse appearance-syndrome-treatment method-prescription-drug-contraindications-risk," clarifying the association rules and attribute constraints between various knowledge elements.
[0022] In this embodiment, the TCM consultation knowledge base construction module 100 accurately identifies and extracts various TCM diagnosis and treatment knowledge elements from TCM knowledge sources, eliminates ambiguity of multi-source knowledge terms through terminology standardization, realizes synonym unification and relation modeling of knowledge elements through ontology modeling, and constructs a knowledge retrieval index based on the standardized knowledge elements. This achieves the structured integration and efficient retrieval of multi-source heterogeneous TCM knowledge, solving the technical problems of insufficient knowledge support, high knowledge update costs, low retrieval accuracy, and inability to provide reliable knowledge basis for consultation in existing TCM consultation systems. It can construct a searchable, traceable, and scalable TCM consultation knowledge base, providing standardized and high-quality knowledge support for subsequent multimodal retrieval enhancement and consultation reasoning.
[0023] The personalized consultation module 200 is used to receive multimodal data collected during the consultation process, including text, voice and image data; to sequentially perform multimodal processing and parsing, modal feature extraction and fusion on the received multimodal data to obtain a joint representation; to perform information retrieval and context enhancement in the knowledge retrieval index based on the joint representation, and to output an evidence set.
[0024] The multimodal data comprises structured and unstructured data from TCM (Traditional Chinese Medicine) consultation scenarios, including textual complaints, voice descriptions, tongue / facial images, vital sign scales, and temperature and blood pressure readings. Multimodal processing and parsing involves cleaning, formatting, structuring fields, and aligning timestamps to output a unified data representation. Modal feature extraction and fusion generate vector representations for different modalities such as text, voice, and images, achieving cross-modal alignment and fusion to generate a unified feature vector that integrates multimodal semantics, adapting to the semantic expression needs of retrieval and reasoning tasks. Information retrieval and context enhancement recall knowledge fragments based on joint representations, which are then reordered, redundancy removed, and conflict resolved to form structured evidence.
[0025] This invention employs Multimodal Retrieval-Augmented Generation (RAG) technology to receive, in real-time, structured vital sign data collected during consultations, including textual complaints, speech-to-text transcription, tongue / facial images, and body temperature and blood pressure. The data is cleaned, formatted, structured, and timestamp-aligned, resulting in a unified data representation. Secondly, vector representations are generated for different modalities: text is encoded using a pre-trained language model, images have features extracted via a convolutional neural network, and structured data is transformed through an embedding layer. Then, cross-modal alignment and fusion techniques are used to construct a joint representation, enabling semantically relevant textual descriptions and image features to be compared within the same vector space. Finally, based on this joint representation, similarity retrieval is performed in a pre-built knowledge retrieval index to recall candidate knowledge fragments. These fragments are then reordered, deredundant, conflict-resolved, and context-enhanced to form a structured evidence set, serving as a key input for downstream skill-link reasoning.
[0026] Skills orchestration and execution module 300 is used to decompose the consultation process into skill units, execute the skill links composed of the skill units based on the structured skill definition and strategy routing mechanism, and output the consultation reasoning results.
[0027] The skill unit is a modular, reusable execution unit that breaks down the consultation process, including chief complaint collection, follow-up questioning of accompanying symptoms, completion of tongue and pulse information (i.e., tongue and pulse appearance), generation of syndrome candidates, risk warnings, and medical advice. A structured skill is defined as a standardized skill contract that constrains the skill's input, output, parameters, dependencies, and failure fallback strategies using a structured skill description file. Strategy routing dynamically selects the skill execution path by integrating context such as user profile, dialogue state, evidence coverage, and risk level. The skill link is a standardized, programmable execution flow formed by combining multiple skill units according to consultation logic. The MCP (Model Context Protocol) is a standardized calling protocol that unifies and integrates external tools such as speech-to-text, image analysis, knowledge base retrieval, and scale services. The consultation reasoning result is a structured consultation summary, syndrome candidates, risk warnings, and medical advice output through the skill link execution.
[0028] The Skills orchestration and execution module 300 of this invention decomposes the complete consultation process into composable and reusable skill units, forms standardized skill contracts based on structured skill definitions, dynamically schedules and executes skill links by combining strategy routing and context-driven mechanisms, and integrates external tools and services through the MCP protocol to achieve data interoperability and capability collaboration, and finally outputs structured consultation reasoning results.
[0029] The reflection and optimization module 400 is used to perform consistency assessment and security verification on the diagnosis reasoning results, and trigger an iterative correction signal when the verification fails; the consistency assessment and security verification include confidence estimation, evidence alignment consistency verification and rule constraint security verification.
[0030] The system comprises the following components: Consistency Assessment, which involves quantifying the confidence level of the reasoning results from the consultation, detecting the consistency of evidence, and evaluating the reliability of the output; Safety Verification, which performs compliance checks on red flag symptoms, acute and severe illnesses, medication contraindications, and contraindications for special populations based on a risk rule base; Confidence Estimation, which quantifies the confidence level of syndrome judgments, medical advice, and risk warnings, and identifies low-confidence outputs; Evidence Alignment Consistency Verification, which verifies the matching degree between the output assertion and the retrieved evidence set, and identifies outputs without basis or evidence; Rule Constraint Safety Verification, which provides a safety net for the identification of acute and severe illnesses, medication contraindications, and protection of special populations based on preset risk rules; and Iterative Correction Signal, which triggers supplementary retrieval, regeneration, and follow-up question completion instructions when verification fails or uncertainty exceeds the threshold.
[0031] In this embodiment of the invention, the reflection and optimization module 400 performs confidence estimation, evidence alignment consistency verification, and rule constraint security verification on the diagnostic reasoning results output by the Skills orchestration and execution module 300 in sequence; it accurately identifies low-confidence, no-evidence, and high-risk output content, and triggers an iterative correction signal when the verification fails or the uncertainty exceeds the threshold, driving secondary retrieval, reordering, regeneration, or follow-up questioning and completion.
[0032] The interactive consultation interface generation module 500 is used to dynamically generate user interface (UI) components according to the progress of the consultation, receive interaction events generated by the user interacting with the UI components, and send the interaction events back to the Skills orchestration and execution module 300 to drive the execution of subsequent skill links.
[0033] The UI (User Interface) components include standardized interactive components such as dynamic forms, image uploads, scales, voice input, risk warnings, evidence citations, and consultation summaries. Dynamic generation automatically generates and combines UI components based on consultation progress, reflection feedback, and task requirements. Interactive events are structured event messages triggered by user input, uploads, confirmations, navigation, and follow-up questions. Two-way data binding establishes a real-time synchronization mechanism between the interface state and the consultation data model, ensuring data consistency. The Virtual DOM (Document Object Model) performs differential calculations on the interface structure to optimize rendering efficiency and update performance. Asynchronous rendering / incremental updates achieve low-latency interface response through partial refresh and asynchronous rendering.
[0034] Based on the above embodiments, as a preferred implementation, the TCM consultation knowledge base construction module 100 includes: The knowledge element extraction submodule 110 is used to standardize and map professional terms in TCM knowledge sources (that is, to map heterogeneous and non-standard professional terms such as symptoms, tongue appearance, and pulse appearance in the TCM field into unified standard terms) and unify synonyms, that is, to merge different expressions, alternative names, and common names of the same TCM concept into standard terms. It establishes ontology relation constraints that include at least symptoms, signs, tongue appearance, pulse appearance, syndrome, treatment method, prescription, drug, and contraindications, that is, to form hierarchical semantic association and attribute limitation rules, and output a set of structured knowledge elements, that is, a set of structured, searchable, and reasonable TCM core knowledge units formed after standardization and relational modeling.
[0035] In this embodiment, TCM knowledge sources refer to the original knowledge sources used to construct the consultation knowledge base, such as classic TCM texts, clinical guidelines, treatment standards, and the experience of renowned doctors. The knowledge element extraction submodule 110 identifies all professional terms from the massive TCM knowledge sources and uses entity recognition and terminology mapping technologies in natural language processing to unify different terms from different regions and periods into standard terms. Then, based on the clinical logic of TCM syndrome differentiation and treatment, it establishes causal relationships and compatibility constraints between symptoms, tongue appearance, pulse appearance, syndromes, treatment methods, and prescriptions, forming an ontology network. Finally, it outputs a structured set of knowledge elements that eliminates ambiguity and has clear semantic relationships. This solves the problems of terminology confusion, retrieval failures due to synonyms, and the inability to support reasoning due to the lack of syndrome-treatment-prescription-medicine association relationships in existing TCM knowledge representations. Its technical effect is that it provides a semantically consistent and clearly defined knowledge foundation for subsequent knowledge entry and retrieval, significantly improves the efficiency and accuracy of cross-knowledge source integration, and enables the system to accurately deduce relevant syndromes and treatment plans based on patient symptoms.
[0036] The knowledge entry submodule 120 is used to take the set of structured knowledge elements as knowledge entries, perform multi-granularity segmentation and standardization of the knowledge entries at the article level, paragraph level, question and answer level, case level or prescription level and enter them into the database, and configure source identifier, applicable conditions, topic tags, confidence information and version information for the segmented knowledge fragments; the version information includes at least one of version number, creation time and change record.
[0037] Among them, knowledge entries are original text blocks extracted from knowledge sources and structured carriers of TCM knowledge elements after standardization and ontology modeling, such as a medical case or a prescription description; multi-granularity segmentation refers to breaking down knowledge entries into reusable knowledge units of different scales at the article level, paragraph level, question-and-answer level, case level, and prescription level: article level is like a single disease article, paragraph level is like a paragraph, question-and-answer level is like a FAQ, case level is like a complete medical record, and prescription level is like a prescription; knowledge fragments are the smallest reusable knowledge units formed after segmentation; source identifiers record which classic text, physician, and era the knowledge fragment comes from; applicable conditions indicate the scope of diseases, constitution type, season, etc., to which the knowledge is applicable; topic tags are classification tags such as headache, gynecology, and febrile diseases; confidence information is a score for the reliability of the knowledge fragment, such as 0.95 from authoritative guidelines and 0.6 from folk remedies; version information includes version number, creation time, and change history, used for knowledge iteration and management, supporting the traceability and continuous updating of the knowledge base. In this embodiment of the invention, the knowledge entry submodule 120 uses the structured knowledge element set output by the knowledge element extraction submodule 110 as the original knowledge entries, and segments them according to different business granularities. For example, a medical case can be segmented into fragments of different granularities, such as the patient's chief complaint, tongue and pulse (tongue appearance, pulse appearance) records, dialectical analysis questions and answers, complete medical records, and prescription composition. Then, each fragment is attached with metadata tags, including source, applicable conditions, topic, confidence level, and version information, forming independently searchable and traceable knowledge units. This solves the problems of traditional knowledge bases, such as difficulty in supporting fine-grained retrieval, inability to trace back to old versions after knowledge updates, and lack of applicability annotation leading to cross-scenario misuse. It enables the knowledge base to support flexible retrieval from keywords to specific fragments, version management ensures the controllability of knowledge evolution, and the applicability and confidence level annotations provide important weighting criteria for subsequent evidence set construction, significantly improving knowledge reuse efficiency and clinical adaptability.
[0038] The knowledge retrieval index submodule 130 is used to construct vector indexes and keyword indexes for the knowledge fragments, and to perform multi-way recall fusion ranking on the knowledge fragments using semantic similarity recall, keyword recall and rule recall.
[0039] Among them, the vector index maps knowledge fragments into high-dimensional semantic vectors, transforming knowledge fragments into a semantic retrieval index constructed from vector representations, which is used to calculate text similarity; the keyword index builds an exact matching index for terms, topic tags, etc. based on an inverted table; semantic similarity recall obtains relevant knowledge fragments through vector similarity matching; keyword recall obtains knowledge fragments through precise term matching, matching the positions of terms in the patient's input, such as headache and red tongue, in the keyword index; rule recall recalls knowledge fragments in a targeted manner based on the relationship between TCM diagnosis and treatment rules and ontology, such as recalling pregnancy-related fragments if the patient is pregnant; multi-path recall fusion ranking merges the three recall results of semantic, keyword, and rule and ranks them according to relevance.
[0040] In this embodiment of the invention, the knowledge retrieval index submodule 130 constructs vector indexes and keyword indexes for the segmented knowledge fragments. It comprehensively employs three methods—semantic similarity recall, keyword recall, and rule recall—to perform multi-path recall fusion and ranking processing on the recalled knowledge fragments. This addresses the shortcomings of existing technologies in TCM knowledge retrieval, such as single methods, low accuracy, insufficient coverage, and inability to adapt to the retrieval needs of consultation scenarios. It solves the technical problems of low efficiency, poor relevance, and incomplete evidence acquisition in TCM consultation knowledge retrieval, significantly improving the coverage and accuracy of TCM knowledge retrieval and providing efficient and accurate index support for multimodal RAG retrieval enhancement.
[0041] Based on one or more of the above embodiments, as a preferred implementation, the knowledge element extraction submodule 110 further performs semantic alignment on TCM diagnosis and treatment knowledge elements based on terminology standardization and ontology modeling, and outputs a structured knowledge element set containing the TCM diagnosis and treatment knowledge elements and the relationships between them.
[0042] In this embodiment, the knowledge element extraction submodule 110 performs semantic alignment operations on TCM diagnosis and treatment knowledge elements, unifying the multi-source heterogeneous TCM diagnosis and treatment knowledge elements into a standard semantic system. The final output is a structured set of knowledge elements containing TCM diagnosis and treatment knowledge elements and the relationships between them. This addresses the shortcomings of existing technologies, such as inconsistent semantics among multiple TCM knowledge sources, missing relationships between knowledge elements, and insufficient structured extraction. It solves the technical problems of semantic heterogeneity, lack of association modeling, and low structuring degree in TCM diagnosis and treatment knowledge, achieving semantic unification and standardized modeling of association relationships among multi-source TCM knowledge. This provides a semantically consistent and fully correlated standardized knowledge foundation for subsequent knowledge segmentation, retrieval index construction, and diagnostic reasoning. Based on one or more of the above embodiments, as a preferred implementation, the personalized consultation module 200 includes: The multimodal data processing and parsing submodule 210 is used to clean, standardize, and align the text complaints, speech-to-text, tongue images, and structured physical sign data in the multimodal data, and output a unified data representation. The multimodal data refers to the collective text, speech, image, and structured physical sign data collected in a traditional Chinese medicine (TCM) consultation scenario; the text complaints are the patient's written description of their core discomfort symptoms; the speech-to-text is the oral consultation text converted from speech recognition; the tongue images are the patient's tongue image data collected for TCM tongue diagnosis; and the structured physical sign data includes quantitative physical sign data such as body temperature and blood pressure. Cleaning includes removing noise, invalid values, and abnormal content from the multimodal data; format standardization converts heterogeneous multimodal data into a unified standard format; timestamp alignment marks the multimodal data with a unified time sequence identifier to ensure the consistency of the consultation information's time sequence; and the unified data representation is the standardized, time-ordered multimodal data format output after processing. The multimodal data processing and parsing submodule 210 performs cleaning, format standardization, and timestamp alignment on the textual complaints, speech-to-text, tongue images, and structured physical signs data in the multimodal data, and outputs a unified data representation. It addresses the shortcomings of existing TCM consultation systems, such as the single input format, lack of standardized processing of multimodal data, and incomplete information collection caused by data noise and temporal disorder. It solves the technical problems of non-standardized preprocessing, inconsistent formats, and inconsistent temporal sequences of multimodal data in TCM consultation, and provides high-quality and standardized data support for subsequent modal feature extraction and fusion.
[0043] The modal feature extraction and fusion submodule 220 is used to generate vector representations for different modal data and perform cross-modal alignment and fusion on the generated vector representations to construct a joint representation. Vector representation refers to converting modal data such as text, image, and speech into vector-like features that the model can recognize; cross-modal alignment refers to mapping different modal vectors to the same semantic space to eliminate modal semantic differences; cross-modal fusion refers to integrating the aligned multimodal vector features to enhance semantic expression; and joint representation refers to the unified multimodal semantic features obtained through cross-modal alignment and fusion. In this embodiment, the modal feature extraction and fusion submodule 220 generates vector representations for different modal data such as text, speech, image, and structured physical signs, performs cross-modal alignment and fusion on the vector representations, and constructs a joint representation. This addresses the shortcomings of existing TCM consultation systems, such as the inability to integrate multimodal features, semantic fragmentation between modalities, and weak semantic expression capabilities for complex consultations. It solves the technical problems of the inability to uniformly represent multimodal features and the lack of cross-modal semantic alignment, improving the system's ability to express complex consultation semantics and its cross-modal evidence alignment capabilities.
[0044] The information retrieval and enhancement generation submodule 230 is used to retrieve and recall knowledge fragments in the knowledge retrieval index submodule 130 based on the joint representation, and to perform reordering, redundancy removal, and conflict resolution on the recalled knowledge fragments, outputting an evidence set. This embodiment of the invention addresses the shortcomings of existing TCM consultation systems, such as disorganized retrieval results, redundancy conflicts, and unreliable evidence support due to a lack of contextual enhancement. It solves the technical problems of low-quality retrieved knowledge, lack of enhancement processing, and non-standard evidence sets, providing accurate, reliable, and conflict-free structured evidence support for subsequent skill link execution and reflective optimization.
[0045] Based on one or more of the above embodiments, as a preferred implementation, the Skills orchestration and execution module 300 includes: The structured skill definition and task encapsulation submodule 310 is used to define the input, output, parameter constraints, dependencies, and failure fallback strategies of skill units using a structured skill description file. It encapsulates tasks such as chief complaint collection, follow-up questioning of accompanying symptoms, tongue and pulse information completion, syndrome candidate generation, risk warning, and medical advice generation into corresponding skill units. Here, input refers to the data received for skill execution, output refers to the result returned after skill execution, parameter constraints refer to the restrictions on input values, dependencies refer to the pre-execution order between skills, and failure fallback strategies refer to backup handling methods when skill execution fails. In this embodiment, diagnostic tasks such as chief complaint collection, follow-up questioning of accompanying symptoms, tongue and pulse information completion, syndrome candidate generation, risk warning, and medical advice generation are encapsulated into corresponding skill units. This transforms the originally loose multi-Agent natural language collaboration into a controllable process driven by skill contracts. Standardized skill definitions make the behavior of each skill unit predictable and reusable, solving the technical problem of unstable reproducibility of the collaboration chain due to the lack of unified constraints on prompts, tool invocation methods, and output formats for different agents. This improves the determinism, testability, and maintainability of task execution.
[0046] The strategy routing and task scheduling execution submodule 320 is used to acquire consultation context information, dynamically determine the execution order and path of skill units based on the consultation context information, and execute at least one of the following strategies: parallelism, timeout control, retry mechanism, and rollback. The consultation context information includes user profile, dialogue state, evidence coverage, and risk level information. Parallel execution refers to running multiple independent skill units simultaneously; timeout control refers to setting a maximum response time for each skill; the retry mechanism refers to automatically re-executing when a skill call fails; and rollback refers to reverting to the previous skill for re-execution when a subsequent skill detects an anomaly. This embodiment of the invention dynamically schedules skill links by integrating context information and employs an engineering-based fault-tolerance mechanism to ensure execution stability, solving the technical problem that multi-Agent scheduling involves parallel-serial hybrid, failure retries, and rollback degradation mechanisms that are difficult to stably implement. It achieves stable scheduling and controllable execution of complex consultation tasks.
[0047] The MCP external integration submodule 330 is used to call external services through a unified tool protocol. These external services include knowledge base retrieval services, speech-to-text services, image analysis services, scale services, and tabu verification services. MCP is the unified tool protocol used to call these external services. This embodiment of the invention standardizes and traces the external call results, converting heterogeneous data returned by different external services into a unified data structure recognizable within the system. Traceability records the time, parameters, return results, and time consumed for each external call. By using a unified protocol to mask the interface differences of different external services, the collaboration between the skill chain and external capabilities is achieved. This MCP external integration submodule 330 solves the technical problems of diverse external service interfaces, high integration costs, and the difficulty in auditing the black-box calling process. It supports closed-loop execution and auditable management of the skill chain, improving the system's deployment adaptability in different institutions.
[0048] Based on one or more of the above embodiments, as a preferred implementation, the reflection and optimization module 400 includes: The output self-checking submodule 410 is used to perform confidence quantification assessment and uncertainty detection on the syndrome judgment, suggestion generation, and risk warning in the consultation reasoning results. When the confidence level is lower than a preset threshold or the uncertainty is higher than a preset threshold, it executes a follow-up questioning strategy, a supplementary retrieval strategy, or an assertion downgrading strategy. Specifically, the confidence quantification assessment outputs a specific confidence score for the syndrome judgment, suggestion generation, and risk warning in the consultation reasoning results; uncertainty detection measures the degree of uncertainty of the reasoning results using entropy or internal model variance. The preset thresholds are a pre-set lower limit for confidence and an upper limit for uncertainty. The follow-up questioning strategy involves asking the patient additional questions to obtain more information when the confidence level is low; the supplementary retrieval strategy involves expanding the knowledge base search scope to obtain more evidence; and the assertion downgrading strategy involves reducing a definitive statement such as "confirmed" to a probabilistic statement such as "suspected." The output self-checking submodule 410 of this invention performs confidence quantification and uncertainty detection on the syndrome judgment, suggestion generation, and risk warning in the consultation reasoning results. When the confidence level is lower than a preset threshold or the uncertainty level is higher than a preset threshold, it executes one or more of the following strategies: follow-up questioning, supplementary retrieval, or assertion downgrading. This solves the technical problems of existing solutions lacking confidence assessment and uncertainty detection for output, and failing to identify low-confidence conclusions. It identifies low-reliability outputs and triggers corresponding correction operations, improving the robustness of the consultation results.
[0049] The evidence verification submodule 420 is used to verify whether key assertions in the consultation reasoning results are supported by the evidence set, and to perform evidence completion, assertion downgrading, reordering, or regeneration strategies on key assertions not supported by the evidence set. Here, key assertions refer to core conclusions in the consultation reasoning results that have diagnostic or treatment guidance significance, and the evidence set refers to the set of structured knowledge fragments output by the personalized consultation module 200. Evidence completion refers to re-retrieve missing knowledge fragments for key assertions not supported by evidence; assertion downgrading refers to reducing the certainty of the assertion; reordering refers to adjusting the priority of knowledge fragments in the evidence set and regenerating the assertion; and regeneration refers to re-performing reasoning based on the revised evidence set to generate new assertions. The evidence verification submodule 420 verifies whether key assertions in the consultation reasoning results are supported by the evidence set and performs one or more of the following strategies on key assertions not supported by the evidence set: evidence completion, assertion downgrading, reordering, or regeneration. This solves the technical problem that existing solutions cannot verify the consistency between generated content and the retrieved evidence set. Reduce output without evidence and improve the interpretability and credibility of consultation results.
[0050] The risk control submodule 430 is used to perform constraint checks based on a rule base for red flag symptoms, acute and critical illness risks, drug interactions, and contraindications for specific populations, and to generate medical advice or prompts for manual processing when a risk is triggered. The specific populations include children, the elderly, and pregnant women. The rule base refers to a pre-constructed set of rules including a list of red flag symptoms, acute and critical illness risk rules, drug interaction rules, and contraindications for specific populations. Red flag symptoms refer to warning clinical manifestations indicating potential critical illness; acute and critical illness risks refer to conditions requiring emergency medical intervention; drug interactions refer to changes in efficacy or toxicity resulting from the simultaneous use of different drugs; and contraindications for specific populations refer to restrictions on medication or treatment for special groups such as children, the elderly, and pregnant women. Constraint checks refer to the item-by-item examination of risk points in the consultation reasoning results based on the rule base. In this embodiment of the invention, the risk control submodule 430 performs constraint checks based on a rule base for red flag symptoms, acute and critical illness risks, drug interactions, and contraindications for specific populations, including children, the elderly, and pregnant women, and generates medical advice or prompts for manual processing when a risk is triggered. This solution addresses the technical issue of existing solutions lacking a systematic risk identification and rule-based constraint mechanism. It provides a safety net, ensuring the safety and compliance of TCM consultation output.
[0051] Based on one or more of the above embodiments, as a preferred implementation, the interactive consultation interface generation module 500 includes: The task parsing submodule 510 is used to obtain dialogue records and consultation context information from the Skills orchestration and execution module 300, and receive iterative correction signals from the reflection and optimization module 400. Based on the obtained dialogue records, consultation context information, and iterative correction signals, it derives the fields to be collected, follow-up questions, upload items, and result display strategies, and generates an interface component generation instruction set. The dialogue records refer to the completed question-and-answer content between the patient and the system. The consultation context information includes the current skill link execution position, collected fields, and evidence coverage status. The iterative correction signals refer to the instructions output by the reflection and optimization module 400 that require supplementary retrieval, regeneration, or follow-up questions. The fields to be collected refer to the symptom or sign information that the patient needs to provide in the next step. Follow-up questions refer to questions that require further refinement of existing information. Upload items refer to the types of images or files that the patient needs to upload. The result display strategy refers to the presentation method of the consultation results, such as prioritizing risk warnings or evidence citations. The interface component generation instruction set is a structured description, including field types, collection priorities, mandatory constraints, validation rules, display conditions, and jump logic. In this embodiment of the invention, the task parsing submodule 510 obtains dialogue records and consultation context information from the Skills orchestration and execution module 300, and receives iterative correction signals from the reflection and optimization module 400. Based on the obtained dialogue records, consultation context information, and iterative correction signals, it derives the fields to be collected, follow-up questions, upload items, and result display strategies, and generates a set of interface component generation instructions. This solves the technical problem of existing consultation systems having fixed interfaces and being unable to dynamically generate fields and follow-up questions based on the consultation stage and risk status. It enables dynamic derivation of the collection strategy, providing an instruction basis for the on-demand generation of subsequent UI components.
[0052] The UI generation submodule 520 is used to call input form components, image upload components, scale components, evidence reference cards, and risk warning cards from the standardized component library according to the instruction set, and combine them to generate a renderable interface layout structure. The standardized component library refers to a pre-built collection of UI components including input forms, image uploads, scales, evidence reference cards, and risk warning cards. The instruction set is the interface component generation instruction set output by the task parsing submodule 510. The input form component is used to collect text or option data, the image upload component is used to receive photos of the tongue or complexion, the scale component is used to present rating scales such as TCM constitution identification, the evidence reference card is used to display the original text of retrieved knowledge fragments, and the risk warning card is used to highlight acute or severe illnesses or contraindications. The renderable interface layout structure refers to the interface tree structure generated after the components are organized according to the layout framework. In this embodiment of the invention, the UI generation submodule 520 calls input form components, image upload components, scale components, evidence reference cards, and risk warning cards from the standardized component library according to the instruction set, and combines them to generate a renderable interface layout structure. This solution addresses the technical challenge of traditional online consultation interfaces being unable to dynamically combine different UI components based on task requirements. It enables on-demand invocation and flexible combination of UI components, improving the targeting and completeness of consultation data collection.
[0053] The interaction submodule 530 is used to establish a two-way binding relationship between UI components and consultation data, and to send user input events, upload events, and confirmation events back to the Skills orchestration and execution module 300. UI components refer to various interactive elements in the interface, such as input boxes, buttons, and upload controls. Consultation data refers to internal data objects that store patient input information, evidence sets, and reasoning results. The two-way binding relationship refers to a real-time synchronization mechanism between interface components and consultation data; that is, changes in interface input values automatically update consultation data, and changes in consultation data are automatically reflected in interface components. User input events refer to the patient's actions of filling in or selecting in a form, upload events refer to the patient's actions of submitting image files, and confirmation events refer to the patient's actions of clicking the submit or confirm button. This embodiment of the invention's interaction submodule 530 establishes a two-way binding relationship between UI components and consultation data, and sends user input events, upload events, and confirmation events back to the Skills orchestration and execution module 300. This solves the technical problems of asynchronous interface states and consultation data, and the inability of interactive events to drive backend processes. It ensures data consistency and transforms user interactions into execution trigger signals for the skill chain, forming a closed-loop interaction.
[0054] The efficient update submodule 540 performs differential calculations on changes to the interface layout structure and consultation data, and updates them incrementally using asynchronous rendering. The interface layout structure refers to the component arrangement and hierarchy output by the UI generation submodule 520, while changes to consultation data refer to changes in data objects caused by patient input or system updates. Differential calculation compares the differences in the virtual DOM tree before and after the interface change, identifying only the changed parts. Asynchronous rendering means that the rendering operation does not block the main thread, and incremental rendering means updating only the changed parts of the interface instead of a complete refresh. This embodiment of the invention's efficient update submodule 540 performs differential calculations on changes to the interface layout structure and consultation data, and updates them incrementally using asynchronous rendering. This solves the technical problems of response latency and performance degradation in high-concurrency scenarios caused by traditional full-screen interface refreshes. It achieves low-latency response and high-performance rendering of the interface, ensuring the smoothness of the consultation interaction process.
[0055] Based on one or more of the above embodiments, as a preferred implementation, the task parsing submodule 510 is further configured to perform joint parsing on the received user-input consultation text, speech-to-text text, image analysis results, and consultation context information, extract and structure a representation from the parsing results of at least one of the following: chief complaint, accompanying symptoms, duration, triggering factors, past medical history, allergy history, medication history, physical sign collection requirements, tongue or pulse image collection requirements, and risk warning triggering conditions, and map the structured representation to the interface component generation instruction set, wherein the interface component generation instruction set includes at least field type, collection priority, mandatory constraints, validation rules, display conditions, and jump logic.
[0056] In this embodiment, the consultation text refers to the patient's chief complaint or answer in text form; the speech-to-text refers to the text content converted from the patient's speech by the speech-to-text service; the image analysis result refers to the structured information output after feature recognition of the tongue or facial color image uploaded by the patient; and the consultation context information includes the current skill link execution position, the collected fields, and the evidence coverage status. Joint parsing refers to the comprehensive understanding and semantic fusion of the above multi-source inputs.
[0057] The specific content extracted and structured from the analysis results by the task parsing submodule 510 includes: chief complaint (the patient's core description of discomfort), accompanying symptoms (other symptoms that occur simultaneously with the chief complaint), duration (the length of time the symptoms have been present), triggering factors (factors that trigger or aggravate the symptoms), past medical history (the patient's past medical history), allergy history (the patient's allergies to drugs or foods), medication history (the patient's recent or long-term medication records), vital sign collection requirements (the vital signs that need to be measured, such as body temperature and blood pressure), tongue or pulse collection requirements (the tongue images or pulse information that need to be collected), and risk warning triggering conditions (the clinical warning rules that need to be output for medical advice or transferred to manual processing). The task parsing submodule 510 maps the above structured representation into a set of instructions for generating interface components. This instruction set includes at least the following: field type to define the input format of the component (e.g., single or multiple selection); collection priority to determine the display order of the component; mandatory constraints to mark whether an item is required for collection; validation rules to check the legality of input values (e.g., body temperature range); display conditions to control the visibility of the component in the consultation state; and jump logic to determine the next interface switching path after completing the current component. This achieves a structured transformation from the patient's raw input to a refined collection task, enabling interface components to accurately match the collection needs of the current consultation stage, reducing invalid questions and improving information collection efficiency.
[0058] Based on one or more of the above embodiments, as a preferred implementation, the UI generation submodule 520 is further configured to call dynamic form components, single or multiple selection components, scale components, image upload components, voice input components, evidence citation display components, risk prompt components, and consultation summary components from the standardized component library, and combine them to generate an interface tree structure. The interface tree structure is generated through a layout framework, and the layout framework executes an adaptive layout strategy according to the consultation stage or risk level. The adaptive layout strategy includes component grouping, collapsing and expanding, step-by-step guidance, and highlighting prompts.
[0059] Among them, the dynamic form component refers to a form that dynamically generates the number and type of fields according to the instruction set; the single-choice or multiple-choice component is used to select one or more items from preset options; the scale component is used to present rating scales such as TCM constitution identification; the image upload component is used to receive photos of the tongue or complexion; the voice input component is used to collect the patient's voice description and trigger the transcription service; the evidence citation display component is used to present the original text of the retrieved knowledge fragments to support the reasoning basis; the risk warning component is used to highlight warnings of acute and severe illnesses or medication contraindications; and the consultation summary component is used to summarize the patient information and reasoning conclusions that have been collected. The interface tree structure refers to the renderable data structure formed by organizing the above components according to hierarchical relationships. The layout framework is used to define the arrangement and interaction behavior of components in the interface. The consultation stage refers to the current collection stage, such as the chief complaint collection stage or the syndrome confirmation stage; and the risk level refers to the degree of urgency assessed based on the patient's symptoms, such as low risk or high risk. The adaptive layout strategy includes component grouping (grouping related components by theme), collapsing / expanding (allowing users to collapse or expand component groups to save interface space), step-by-step guidance (breaking down the consultation process into multiple steps for gradual presentation), and highlighting (visually highlighting high-risk or required components). The adaptive layout strategy supported by the UI generation sub-components in this invention solves the technical problem of existing consultation systems having fixed interfaces and being unable to dynamically adjust the layout according to the progress and risk status of the consultation. This improves the efficiency and completeness of consultation data collection, ensuring that the interface presentation matches the clinical urgency and data collection stage, and guaranteeing the timely acquisition and presentation of high-risk information.
[0060] Secondly, embodiments of the present invention provide a personalized TCM consultation method based on Agent-Skills. The method of this embodiment executes the data processing flow corresponding to the system modules in the above embodiments, and the method includes: S1. Identify and extract TCM diagnostic and treatment knowledge elements from TCM knowledge sources, and construct a knowledge retrieval index based on the TCM diagnostic and treatment knowledge elements; the TCM diagnostic and treatment knowledge elements include symptoms, signs, tongue appearance, pulse appearance, syndrome, treatment method, prescription, drugs and contraindications.
[0061] S2. Receive multimodal data collected during the consultation process, including text, voice and image data; sequentially perform multimodal processing and parsing, modal feature extraction and fusion on the received multimodal data to obtain a joint representation; based on the joint representation, perform information retrieval and context enhancement in the knowledge retrieval index to output an evidence set.
[0062] S3. Decompose the consultation process into skill units, execute the skill link composed of the skill units based on the structured skill definition and strategy routing mechanism, and output the consultation reasoning results.
[0063] S4. Perform consistency assessment and security verification on the diagnosis reasoning results, and trigger an iterative correction signal when the verification fails; the consistency assessment and security verification include confidence estimation, evidence alignment consistency verification and rule constraint security verification.
[0064] S5. Dynamically generate UI components based on the progress of the consultation, receive interaction events generated by the user interacting with the UI components, and drive the execution of subsequent skill links based on the interaction events.
[0065] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
[0066] 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 personalized TCM consultation system based on Agent-Skills, characterized in that, include: The TCM consultation knowledge base construction module is used to identify and extract TCM diagnosis and treatment knowledge elements from TCM knowledge sources, and to construct a knowledge retrieval index based on the TCM diagnosis and treatment knowledge elements. The TCM diagnostic and treatment knowledge elements include symptoms, signs, tongue appearance, pulse appearance, syndromes, treatment methods, prescriptions, drugs, and contraindications. The personalized consultation module is used to receive multimodal data collected during the consultation process, including text, voice, and image data; to sequentially perform multimodal processing and parsing, modal feature extraction and fusion on the received multimodal data to obtain a joint representation; and to perform information retrieval and context enhancement in the knowledge retrieval index based on the joint representation, and output an evidence set. The Skills orchestration and execution module is used to break down the consultation process into skill units, execute the skill links composed of the skill units based on the structured skill definition and strategy routing mechanism, and output the consultation reasoning results. The reflection and optimization module is used to perform consistency evaluation and security verification on the diagnosis reasoning results, and trigger an iterative correction signal when the verification fails. The consistency assessment and security verification include confidence estimation, evidence alignment consistency verification, and rule constraint security verification. The interactive consultation interface generation module is used to dynamically generate user interface (UI) components based on the progress of the consultation, receive interaction events generated by the user interacting with the UI components, and send the interaction events back to the Skills orchestration and execution module to drive the execution of subsequent skill chains.
2. The personalized TCM consultation system based on Agent-Skills according to claim 1, characterized in that, The TCM consultation knowledge base construction module includes: The knowledge element extraction submodule is used to standardize and map professional terms in TCM knowledge sources and normalize synonyms. It establishes ontology relation constraints that include at least symptoms, signs, tongue appearance, pulse appearance, syndrome, treatment method, prescription, drugs and contraindications, and outputs a structured knowledge element set. The knowledge entry submodule is used to take the set of structured knowledge elements as knowledge entries, perform multi-granularity segmentation and standardization of the knowledge entries at the article level, paragraph level, question and answer level, case level or prescription level, and configure source identifier, applicable conditions, topic tags, confidence information and version information for the segmented knowledge fragments; the version information includes at least one of version number, creation time and change record. The knowledge retrieval index submodule is used to construct vector indexes and keyword indexes for the knowledge fragments, and to perform multi-way recall fusion ranking on the knowledge fragments using semantic similarity recall, keyword recall, and rule recall.
3. The agent-skills-based personalized TCM consultation system according to claim 2, characterized in that, The knowledge element extraction submodule also performs semantic alignment of TCM diagnosis and treatment knowledge elements based on terminology standardization and ontology modeling, and outputs a structured knowledge element set containing the TCM diagnosis and treatment knowledge elements and the relationships between them.
4. The personalized TCM consultation system based on Agent-Skills according to claim 2, characterized in that, The personalized consultation module includes: The multimodal data processing and parsing submodule is used to clean, standardize, and align the text statements, speech-to-text, tongue images, and structured vital signs data in the multimodal data, and output a unified data representation. The modal feature extraction and fusion submodule is used to generate vector representations for different modal data, and to perform cross-modal alignment and fusion on the generated vector representations to construct a joint representation; The information retrieval and enhancement generation submodule is used to retrieve and recall knowledge fragments in the knowledge retrieval index submodule based on the joint representation, and to perform reordering, redundancy removal and conflict resolution on the recalled knowledge fragments, and output an evidence set.
5. The personalized TCM consultation system based on Agent-Skills according to claim 1, characterized in that, The Skills orchestration and execution module includes: The structured skill definition and task encapsulation submodule is used to define the input, output, parameter constraints, dependencies and failure fallback strategies of skill units using structured skill description files, and encapsulate the collection of chief complaints, follow-up questions on accompanying symptoms, completion of tongue and pulse information, generation of syndrome candidates, risk warnings and medical advice into corresponding skill units. The strategy routing and task scheduling execution submodule is used to obtain consultation context information, dynamically determine the execution order and execution path of skill units based on the consultation context information, and execute at least one of the following strategies: parallel execution, timeout control, retry mechanism and rollback; the consultation context information includes user profile, dialogue state, evidence coverage and risk level information; The MCP external integration submodule is used to call external services through a unified tool protocol. These external services include knowledge base retrieval service, speech-to-text service, image analysis service, scale service, and tabu verification service.
6. The personalized TCM consultation system based on Agent-Skills according to claim 1, characterized in that, The reflection and optimization module includes: The output self-testing submodule is used to perform confidence quantification assessment and uncertainty detection on the syndrome judgment, suggestion generation and risk warning in the diagnosis reasoning results, and to execute follow-up questioning strategy, supplementary retrieval strategy or assertion downgrade strategy when the confidence is lower than the preset threshold or the uncertainty is higher than the preset threshold. The evidence verification submodule is used to verify whether the key assertions in the consultation reasoning results are supported by the evidence set, and to perform evidence completion, assertion downgrading, reordering or regeneration strategies for key assertions that are not supported by the evidence set. The risk control submodule is used to perform constraint checks based on the rule base for red flag symptoms, acute and severe disease risks, drug interactions, and contraindications for specific populations, and to generate medical advice or prompts for manual processing when risks are triggered; the specific populations include children, the elderly, and pregnant women.
7. The personalized TCM consultation system based on Agent-Skills according to claim 5, characterized in that, The interactive consultation interface generation module includes: The task parsing submodule is used to obtain dialogue records and consultation context information from the Skills orchestration and execution module, and receive iterative correction signals from the reflection and optimization module. Based on the obtained dialogue records, consultation context information and iterative correction signals, it derives the fields to be collected, follow-up questions, upload items and result display strategies, and generates a set of interface component generation instructions. The UI generation submodule is used to call input form components, image upload components, scale components, evidence reference cards and risk warning cards from the standardized component library according to the instruction set, and combine them to generate a renderable interface layout structure. The interaction submodule is used to establish a two-way binding relationship between UI components and consultation data, and to send user input events, upload events and confirmation events back to the Skills orchestration and execution module; The efficient update submodule is used to perform differential calculations on changes to the interface layout structure and consultation data, and to incrementally render and update them asynchronously.
8. The agent-skills-based personalized TCM consultation system according to claim 7, characterized in that, The task parsing submodule is also used to perform joint parsing on the received user-input consultation text, speech-to-text text, image analysis results, and consultation context information. It extracts and structures at least one of the following from the parsing results: chief complaint, accompanying symptoms, duration, triggering factors, past medical history, allergy history, medication history, physical sign collection requirements, tongue or pulse image collection requirements, and risk warning triggering conditions. The structured representation is then mapped to the interface component generating instruction set, which includes at least field type, collection priority, mandatory constraints, validation rules, display conditions, and jump logic.
9. The agent-skills-based personalized TCM consultation system according to claim 7, characterized in that, The UI generation submodule is also used to call dynamic form components, single or multiple selection components, scale components, image upload components, voice input components, evidence citation display components, risk prompt components, and consultation summary components from the standardized component library, and combine them to generate an interface tree structure. The interface tree structure is generated by a layout framework. The layout framework executes an adaptive layout strategy according to the consultation stage or risk level. The adaptive layout strategy includes component grouping, collapsing and expanding, step-by-step guidance, and highlighting prompts.
10. A personalized TCM consultation method based on Agent-Skills, characterized in that, include: S1. Identify and extract TCM diagnosis and treatment knowledge elements from TCM knowledge sources, and construct a knowledge retrieval index based on the TCM diagnosis and treatment knowledge elements; The TCM diagnostic and treatment knowledge elements include symptoms, signs, tongue appearance, pulse appearance, syndromes, treatment methods, prescriptions, drugs, and contraindications. S2. Receive multimodal data collected during the consultation process, including text, voice, and image data; sequentially perform multimodal processing and parsing, modal feature extraction and fusion on the received multimodal data to obtain a joint representation; based on the joint representation, perform information retrieval and context enhancement in the knowledge retrieval index to output an evidence set; S3. Decompose the consultation process into skill units, execute the skill link composed of the skill units based on the structured skill definition and strategy routing mechanism, and output the consultation reasoning result; S4. Perform consistency assessment and security verification on the diagnosis reasoning results, and trigger an iterative correction signal if the verification fails; The consistency assessment and security verification include confidence estimation, evidence alignment consistency verification, and rule constraint security verification. S5. Dynamically generate UI components based on the progress of the consultation, receive interaction events generated by the user interacting with the UI components, and drive the execution of subsequent skill links based on the interaction events.