Abstract
This study introduces Yaoshi-RAG, a novel framework designed to enhance Large Language Models (LLMs) in generating dietary recommendations based on Traditional Chinese Medicine (TCM) principles of Medicine Food Homology (MFH). By integrating a structured Uncertain Knowledge Graph (UKG), the framework effectively synthesizes traditional wisdom with advanced language modeling. Experimental results demonstrate that Yaoshi-RAG facilitates personalized, evidence-based dietary advice that significantly outperforms standard LLM generation in accuracy and reasoning.
Introduction: Bridging Ancient Wisdom and Modern AI
The concept of Medicine Food Homology (MFH) is a cornerstone of TCM, positing that many common foods—such as ginger, lily bulbs, and mung beans—possess therapeutic properties. While this holistic approach to nutrition is highly valued, its practical application requires deep expertise. General-purpose LLMs often struggle in this specialized domain, frequently "hallucinating" advice that contradicts TCM principles (e.g., recommending "cold" foods for "cold-type" ailments).
To solve this, researchers developed Yaoshi-RAG, a framework that grounds LLMs in a structured database of over 29,000 medical-food facts, ensuring recommendations are both personalized and theoretically sound.
The Yaoshi-RAG Framework
The authors introduce a two-module framework designed to bridge the gap between unstructured LLM generation and structured TCM logic:
- Knowledge Graph Construction: The system uses an LLM-driven "Open Information Extraction" (OpenIE) approach to build a comprehensive MFH Knowledge Graph (KG). Crucially, this is treated as an Uncertain Knowledge Graph (UKG), where every relationship is assigned a confidence score. This accounts for the inherent "gray areas" and conflicting evidence found in historical medical texts.
- Path-Based Retrieval & Ranking: Instead of retrieving isolated facts, Yaoshi-RAG identifies reasoning paths. For example, a query about insomnia might trigger a path: Symptom (Insomnia) → Constitution (Yin-deficient) → Suitable Food (Lily Bulb). These paths are ranked using a Weighted PageRank algorithm that prioritizes the most reliable logic chains.
Data and Knowledge Graph Construction
The framework is powered by the MFH Corpus, a collection of 1,359 documents including ancient classical literature, modern TCM textbooks, and contemporary research papers. The resulting MFH Knowledge Graph is extensive, containing:
- 24,984 entities
- 22 relations
- 29,292 triples
This structured knowledge base allows the system to move beyond simple keyword matching to true semantic reasoning based on TCM theory.
Key Results and Performance
The integration of the MFH KG led to substantial performance gains across multiple LLM architectures. On average, the framework improved performance by 14.5% in Hits@1 and 8.7% in F1-score.
Key findings include:
- Top Performer: DeepSeek-R1 emerged as the strongest base model within the Yaoshi-RAG framework, achieving 84.2% Hits@1 and 71.5% F1-score.
- Human Validation: In blind tests with TCM experts and general users, Yaoshi-RAG consistently outperformed baseline models in rationality, explainability, user acceptability, and personalization.
- The Power of Uncertainty: Ablation studies confirmed that modeling "uncertainty" in the KG is vital; treating all TCM facts as 100% certain actually decreased the model's real-world accuracy.
Conclusion and Future Directions
Yaoshi-RAG demonstrates that Retrieval-Augmented Generation, when combined with domain-specific knowledge graphs, can effectively translate complex traditional knowledge into accessible, personalized advice. While the current system is robust, future work will focus on refining the automated extraction process to reduce noise and expanding the graph to cover a broader range of TCM health conditions.
Summary updated