ShenNongDiet: a medicine diet recommendation system based on graph-semantic hybrid retrieval and evidence constraint generation - Xiangying Yan; Zhuang Guo; Na Lin; Yanqiong Zhang (Chinese Medicine, 2026)
Abstract Background Medicinal diet, a core practice in Traditional Chinese medicine (TCM) rooted in the principle of “medicine and food homology”, offers potential for chronic disease management and sub-health regulation. However, the broader adoption is constrained by fragmented knowledge, poor personalization, and safety risks arising from improper ingredient combinations or constitution-therapy mismatches. Objective We developed and validated ShenNongDiet, a knowledge graph (KG) and retrieval-augmented generation (RAG) system for TCM dietary recommendation that explicitly models constitution suitability and ingredient contraindications. Methods A Neo4j KG was constructed from the “ Guoyi Jinghua Yao Shan ” book series encompassing 3376 medicinal diets, 2110 ingredients, 1176 effects, 1122 population groups, 1078 symptoms, 459 diseases, 38,669 relationships. The system integrates dual-pathway retrieval (symbolic reasoning from KG + dense vector search using Qwen3-embedding-8B), RAG-based evidence packaging, and Low-Rank Adaptation (LoRA) fine-tuning of Qwen3-8B on 8509 evidence-constrained instruction samples to reduce the risk of the model generating unsupported content. A multi-scenario test set was constructed to evaluate system effectiveness and robustness. Results ShenNongDiet achieved Hit@1, Hit@3, and Hit@5 of 84.00%, 90.00%, and 92.67% respectively, with a Mean Reciprocal Rank (MRR) of 0.8778. RAGAs evaluation yielded a faithfulness score of 0.831 and context recall of 0.526. Expert human evaluation further confirmed the system’s strong performance in recommendation accuracy, evidence relevance, and generation faithfulness. Ablation experiments confirmed that the hybrid architecture significantly outperformed every single retrieval channel ( P < 0.001), validating the complementary benefit of the symbolic and semantic retrieval. Conclusion This study systematically constructs an explicit-semantics knowledge model of TCM medicinal diet and integrates KG reasoning with language model generation under evidence constraints. ShenNongDiet offers an expandable and safety-constrained solution for intelligent dietary services, facilitating the digital preservation of traditional dietary culture and artificial intelligence-driven personalized health management.