<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.0 20040830//EN" "journalpublishing.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="2.0" xml:lang="en" article-type="research-article"><front><journal-meta><journal-id journal-id-type="nlm-ta">JMIR Med Inform</journal-id><journal-id journal-id-type="publisher-id">medinform</journal-id><journal-id journal-id-type="index">7</journal-id><journal-title>JMIR Medical Informatics</journal-title><abbrev-journal-title>JMIR Med Inform</abbrev-journal-title><issn pub-type="epub">2291-9694</issn><publisher><publisher-name>JMIR Publications</publisher-name><publisher-loc>Toronto, Canada</publisher-loc></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">v13i1e75279</article-id><article-id pub-id-type="doi">10.2196/75279</article-id><article-categories><subj-group subj-group-type="heading"><subject>Original Paper</subject></subj-group></article-categories><title-group><article-title>Leveraging Retrieval-Augmented Large Language Models for Dietary Recommendations With Traditional Chinese Medicine&#x2019;s Medicine Food Homology: Algorithm Development and Validation</article-title></title-group><contrib-group><contrib contrib-type="author" equal-contrib="yes"><name name-style="western"><surname>Sha</surname><given-names>Hangyu</given-names></name><degrees>BEng</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="fn" rid="equal-contrib1">*</xref></contrib><contrib contrib-type="author" equal-contrib="yes"><name name-style="western"><surname>Gong</surname><given-names>Fan</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff3">3</xref><xref ref-type="fn" rid="equal-contrib1">*</xref></contrib><contrib contrib-type="author" equal-contrib="yes"><name name-style="western"><surname>Liu</surname><given-names>Bo</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff4">4</xref><xref ref-type="fn" rid="equal-contrib1">*</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Liu</surname><given-names>Runfeng</given-names></name><degrees>BEng</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Wang</surname><given-names>Haofen</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff5">5</xref></contrib><contrib contrib-type="author" corresp="yes"><name name-style="western"><surname>Wu</surname><given-names>Tianxing</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref></contrib></contrib-group><aff id="aff1"><institution>School of Computer Science and Engineering, Southeast University</institution><addr-line>2 Southeast University Road, Jiangning District</addr-line><addr-line>Nanjing</addr-line><country>China</country></aff><aff id="aff2"><institution>Key Laboratory of New Generation Artificial Intelligence Technology and Its Interdisciplinary Applications (Southeast University), Ministry of Education</institution><country>China</country></aff><aff id="aff3"><institution>Department of Endocrinology, Shuguang Hospital Affiliated to Shanghai University of Traditional Chinese Medicine</institution><addr-line>Shanghai</addr-line><country>China</country></aff><aff id="aff4"><institution>Informatization Office, Shanghai University of Traditional Chinese Medicine</institution><addr-line>Shanghai</addr-line><country>China</country></aff><aff id="aff5"><institution>College of Design and Innovation, Tongji University</institution><addr-line>Shanghai</addr-line><country>China</country></aff><contrib-group><contrib contrib-type="editor"><name name-style="western"><surname>Luo</surname><given-names>Ling</given-names></name></contrib><contrib contrib-type="editor"><name name-style="western"><surname>Jin</surname><given-names>Qiao</given-names></name></contrib></contrib-group><contrib-group><contrib contrib-type="reviewer"><name name-style="western"><surname>Zhang</surname><given-names>Ningyu</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>He</surname><given-names>Xinyu</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>Chen</surname><given-names>Yubo</given-names></name></contrib></contrib-group><author-notes><corresp>Correspondence to Tianxing Wu, PhD, School of Computer Science and Engineering, Southeast University, 2 Southeast University Road, Jiangning District, Nanjing, 210096, China, 86 15077889931; <email>tianxingwu@seu.edu.cn</email></corresp><fn fn-type="equal" id="equal-contrib1"><label>*</label><p>these authors contributed equally</p></fn></author-notes><pub-date pub-type="collection"><year>2025</year></pub-date><pub-date pub-type="epub"><day>21</day><month>8</month><year>2025</year></pub-date><volume>13</volume><elocation-id>e75279</elocation-id><history><date date-type="received"><day>31</day><month>03</month><year>2025</year></date><date date-type="rev-recd"><day>24</day><month>06</month><year>2025</year></date><date date-type="accepted"><day>01</day><month>07</month><year>2025</year></date></history><copyright-statement>&#x00A9; Hangyu Sha, Fan Gong, Bo Liu, Runfeng Liu, Haofen Wang, Tianxing Wu. Originally published in JMIR Medical Informatics (<ext-link ext-link-type="uri" xlink:href="https://medinform.jmir.org">https://medinform.jmir.org</ext-link>), 21.8.2025. </copyright-statement><copyright-year>2025</copyright-year><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (<ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link>), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in JMIR Medical Informatics, is properly cited. The complete bibliographic information, a link to the original publication on <ext-link ext-link-type="uri" xlink:href="https://medinform.jmir.org/">https://medinform.jmir.org/</ext-link>, as well as this copyright and license information must be included.</p></license><self-uri xlink:type="simple" xlink:href="https://medinform.jmir.org/2025/1/e75279"/><abstract><sec><title>Background</title><p>Traditional Chinese Medicine (TCM) emphasizes the concept of medicine food homology (MFH), which integrates dietary therapy into health care. However, the practical application of MFH principles relies heavily on expert knowledge and manual interpretation, posing challenges for automating MFH-based dietary recommendations. Although large language models (LLMs) have shown potential in health care decision support, their performance in specialized domains such as TCM is often hindered by hallucinations and a lack of domain knowledge. The integration of uncertain knowledge graphs (UKGs) with LLMs via retrieval-augmented generation (RAG) offers a promising solution to overcome these limitations by enabling a structured and faithful representation of MFH principles while enhancing LLMs&#x2019; ability to understand the inherent uncertainty and heterogeneity of TCM knowledge. Consequently, it holds potential to improve the reliability and accuracy of MFH-based dietary recommendations generated by LLMs.</p></sec><sec><title>Objective</title><p>This study aimed to introduce Yaoshi-RAG, a framework that leverages UKGs to enhance LLMs' capabilities in generating accurate and personalized MFH-based dietary recommendations.</p></sec><sec sec-type="methods"><title>Methods</title><p>The proposed framework began by constructing a comprehensive MFH knowledge graph (KG) through LLM-driven open information extraction, which extracted structured knowledge from multiple sources. To address the incompleteness and uncertainty within the MFH KG, UKG reasoning was used to measure the confidence of existing triples and to complete missing triples. When processing user queries, query entities were identified and linked to the MFH KG, enabling retrieval of relevant reasoning paths. These reasoning paths were then ranked based on triple confidence scores and entity importance. Finally, the most informative reasoning paths were encoded into prompts using prompt engineering, enabling the LLM to generate personalized dietary recommendations that aligned with both individual health needs and MFH principles. The effectiveness of Yaoshi-RAG was evaluated through both automated metrics and human evaluation.</p></sec><sec sec-type="results"><title>Results</title><p>The constructed MFH KG comprised 24,984 entities, 22 relations, and 29,292 triples. Extensive experiments demonstrate the superiority of Yaoshi-RAG in different evaluation metrics. Integrating the MFH KG significantly improved the performance of LLMs, yielding an average increase of 14.5% in Hits@1 and 8.7% in <italic>F</italic><sub>1</sub>-score, respectively. Among the evaluated LLMs, DeepSeek-R1 achieved the best performance, with 84.2% in Hits@1 and 71.5% in <italic>F</italic><sub>1</sub>-score, respectively. Human evaluation further validated these results, confirming that Yaoshi-RAG consistently outperformed baseline models across all assessed quality dimensions.</p></sec><sec sec-type="conclusions"><title>Conclusions</title><p>This study shows Yaoshi-RAG, a new framework that enhances LLMs&#x2019; capabilities in generating MFH-based dietary recommendations through the knowledge retrieved from a UKG. By constructing a comprehensive TCM knowledge representation, our framework effectively extracts and uses MFH principles. Experimental results demonstrate the effectiveness of our framework in synthesizing traditional wisdom with advanced language models, facilitating personalized dietary recommendations that address individual health conditions while providing evidence-based explanations.</p></sec></abstract><kwd-group><kwd>Traditional Chinese Medicine</kwd><kwd>medicine food homology</kwd><kwd>large language model</kwd><kwd>retrieval-augmented generation</kwd><kwd>uncertain knowledge graph</kwd><kwd>dietary recommendation</kwd></kwd-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><sec id="s1-1"><title>Background</title><p>The concept of &#x201C;medicine food homology&#x201D; (MFH) in Traditional Chinese Medicine (TCM) means that certain substances can function as both nutritional food and therapeutic medicines depending on their application and dosage [<xref ref-type="bibr" rid="ref1">1</xref>]. This ancient philosophy has gained considerable traction in modern health care systems [<xref ref-type="bibr" rid="ref2">2</xref>], offering approaches to disease prevention and management through dietary interventions [<xref ref-type="bibr" rid="ref3">3</xref>]. However, the practical implementation of MFH principles remains largely dependent on the expert knowledge of TCM practitioners, leading to inconsistent application and limited accessibility. The absence of automated and systematic approaches to using MFH principles for dietary recommendation generation has hindered its broader integration into contemporary health care frameworks and constrained its potential benefits for public health.</p><p>Recent advances in large language models (LLMs) [<xref ref-type="bibr" rid="ref4">4</xref>] have demonstrated their remarkable performance across a variety of medical tasks [<xref ref-type="bibr" rid="ref5">5</xref>], including automated clinical decision support [<xref ref-type="bibr" rid="ref6">6</xref>], medical education [<xref ref-type="bibr" rid="ref7">7</xref>], and health care information retrieval [<xref ref-type="bibr" rid="ref8">8</xref>]. These capabilities are primarily derived from extensive pretraining on large-scale corpora, which encode rich knowledge from diverse textual sources. The application of MFH principles heavily depends on the domain knowledge documented in TCM literature, including foods, herbs, and formulations. Given that many LLMs have been pretrained on the corpora, which incorporate such TCM literature, combined with their strong natural language generation abilities, they present promising potential for automating MFH-based dietary recommendations. Nonetheless, LLMs exhibit substantial limitations as they often produce hallucinations that refer to factually incorrect information [<xref ref-type="bibr" rid="ref9">9</xref>]. This problem is especially evident when generating information related to the medicinal properties of food in the context of TCM. For example, when querying with &#x201C;I have stomach discomfort recently, can you recommend some summer drinks?&#x201D; the LLMs respond: &#x201C;Mung bean soup clears heat and is suitable for heat-related discomfort.&#x201D; However, according to MFH principles, mung beans are cold (yin), and their consumption may aggravate stomach discomfort. Such inaccuracies significantly affect the safety and reliability of LLMs in practical health care applications [<xref ref-type="bibr" rid="ref10">10</xref>].</p><p>Retrieval-augmented generation (RAG) has emerged as a promising strategy to mitigate these limitations by incorporating external knowledge into LLMs, thereby enhancing factual accuracy and reducing hallucinations [<xref ref-type="bibr" rid="ref11">11</xref>]. However, using TCM knowledge as the retrieval source of RAG presents unique challenges. TCM knowledge is sourced from diverse and heterogeneous materials, including ancient and classical literature, modern TCM literature, food and herbs information, regulatory documents, research papers, and TCM formulations. This multisource nature results in inconsistent knowledge representation, terminological ambiguities, and varying levels of evidence quality. Furthermore, MFH principles inherently involve uncertainties arising from dosage effects, individual variability, and context-dependent applications [<xref ref-type="bibr" rid="ref12">12</xref>]. Currently, there is no comprehensive and structured knowledge base specifically tailored for supporting RAG grounded in MFH principles, creating a significant gap between traditional wisdom and modern technologies.</p></sec><sec id="s1-2"><title>Related Work</title><sec id="s1-2-1"><title>Dietary Recommendation Systems</title><p>Dietary recommendation systems provide personalized food and nutrition suggestions based on individual health status and preferences. Traditional approaches have primarily relied on rule-based methods using expert knowledge and predefined guidelines, often lacking personalization and accessibility. Recent advancements in artificial intelligence have transformed this field through deep learning and knowledge graphs (KGs). Chen et al [<xref ref-type="bibr" rid="ref13">13</xref>] defined food recommendation as constrained question answering over a food KG, integrating user preferences with health guidelines. PPKG [<xref ref-type="bibr" rid="ref14">14</xref>] is a cancer-specific dietary recommendation system that combines a KG with time-aware long short-term memory networks to dynamically adjust recommendations for cancer prevention and rehabilitation. Ma et al [<xref ref-type="bibr" rid="ref15">15</xref>] proposed a nutrition-related KG method based on graph convolutional networks to enhance food recommendation diversity while promoting more healthy eating habits. LLMs have further advanced dietary recommendation capabilities. ChatDiet [<xref ref-type="bibr" rid="ref16">16</xref>] integrates personal and population models with causal inference to enhance personalization and explainability. Jin et al [<xref ref-type="bibr" rid="ref17">17</xref>] demonstrated the clinical effectiveness of a GPT-based dietary recommendation system for patients with hemodialysis, successfully reducing serum potassium levels. Kopitar et al [<xref ref-type="bibr" rid="ref18">18</xref>] created a generative artificial intelligence system for personalized inpatient meal planning that incorporates electronic health records and clinical guidelines.</p><p>However, we still do not have methods to integrate MFH principles with LLMs for dietary recommendation. Our framework bridges this gap by combining MFH KG with LLMs to develop more comprehensive and culturally informed dietary recommendations.</p></sec><sec id="s1-2-2"><title>The Interplay Between LLMs and KGs</title><p>KGs serve as structured representations of factual knowledge, providing an excellent complement to parameterized language models [<xref ref-type="bibr" rid="ref19">19</xref>,<xref ref-type="bibr" rid="ref20">20</xref>]. With the emergence of LLMs, research has evolved along 2 complementary trajectories: leveraging LLMs to construct KGs and enhancing LLMs with KG integration. Several approaches have emerged for LLM-assisted KG construction. Extract-define-canonicalize [<xref ref-type="bibr" rid="ref21">21</xref>] addresses scalability through open information extraction (OpenIE) and post hoc canonicalization. BEAR [<xref ref-type="bibr" rid="ref22">22</xref>] leverages LLMs for zero-shot knowledge extraction in service-oriented domains. LLM-TIKG [<xref ref-type="bibr" rid="ref23">23</xref>] applies few-shot learning for constructing threat intelligence KGs, while Yang et al [<xref ref-type="bibr" rid="ref24">24</xref>] presented an approach for medical ontology expansion using LLMs to generate competency questions.</p><p>Researchers have also explored integrating KGs to enhance LLMs&#x2019; capabilities. GraphGPT [<xref ref-type="bibr" rid="ref25">25</xref>] combines LLMs with graph structural knowledge through instruction tuning. GaLM [<xref ref-type="bibr" rid="ref26">26</xref>] transforms KGs into text representations to improve reasoning while reducing hallucinations. Think-on-Graph [<xref ref-type="bibr" rid="ref27">27</xref>] is a training-free framework that uses iterative beam search to enable interactive reasoning, while StructGPT [<xref ref-type="bibr" rid="ref28">28</xref>] enhances zero-shot reasoning through an iterative Reading-then-Reasoning approach. Our work builds upon these dual research trajectories by proposing a framework that leverages LLMs for KG construction and uses KGs to enhance the capabilities of LLMs specifically within the domain of TCM, thereby providing reliable dietary recommendations grounded in MFH principles.</p></sec></sec><sec id="s1-3"><title>Objectives</title><p>To overcome the limitations of existing methods, we propose a new framework that enhances LLMs&#x2019; capability to generate MFH dietary recommendations by using an uncertain knowledge graph (UKG) as an external resource. This framework uses multistep LLM calls for OpenIE [<xref ref-type="bibr" rid="ref29">29</xref>] to automatically construct an MFH KG from unstructured and heterogeneous literature sources. It then implements UKG reasoning to measure the confidence of existing triples and complete missing triples. To improve knowledge retrieval, the framework adopts a reasoning path&#x2013;based knowledge retrieval strategy, extracting relevant knowledge from the MFH KG and refining the results through ranking and filtering based on triple confidence scores and entity importance. By encoding domain-specific knowledge and addressing uncertainties related to MFH, the MFH KG empowers LLMs to deliver more personalized, evidence-based, and reliable dietary recommendations.</p><p>The key contributions of this study are as follows: (1) an integrated framework that leverages KG-augmented LLMs to generate personalized and evidence-based MFH dietary recommendations, (2) an LLM-driven OpenIE methodology for automatically constructing a UKG specifically tailored to TCM&#x2019;s MFH from heterogeneous multisource data, (3) a systematic evaluation of several mainstream LLMs for the generation of MFH dietary recommendations, and (4) experimental results and case studies that demonstrate the capability of the proposed framework to deliver personalized and professional MFH-based dietary recommendations.</p></sec></sec><sec id="s2" sec-type="methods"><title>Methods</title><sec id="s2-1"><title>Overview</title><p>This study proposed Yaoshi-RAG, an RAG framework designed to enhance LLMs&#x2019; capabilities in generating evidence-based dietary recommendations based on MFH principles. As illustrated in <xref ref-type="fig" rid="figure1">Figure 1</xref>, the framework consists of 2 modules:</p><list list-type="order"><list-item><p>Knowledge graph construction: A comprehensive corpus was compiled from multiple sources, and an MFH KG was constructed using LLM-driven OpenIE. Then, UKG reasoning was applied to measure the confidence of extracted triples and complete missing triples.</p></list-item><list-item><p>Retrieval-augmented generation: Given a user query, the framework first identified and linked query entities to the MFH KG. The LLM then constructed relation paths to facilitate the retrieval of reasoning paths. Subsequently, these candidate reasoning paths were refined through postprocessing, including ranking and filtering, to extract the top-<inline-formula><mml:math id="ieqn1"><mml:mi>k</mml:mi></mml:math></inline-formula> most relevant reasoning paths, thereby improving retrieval accuracy. The retrieved knowledge was integrated with the user query through prompt engineering, guiding the LLM to generate personalized dietary recommendations that aligned with both the user&#x2019;s needs and MFH principles.</p></list-item></list><fig position="float" id="figure1"><label>Figure 1.</label><caption><p>The architecture of the proposed framework. KG: knowledge graph; LLM: large language model; MFH: medicine food homology; OpenIE: open information extraction; TCM: Traditional Chinese Medicine; UKG: uncertain knowledge graph.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="medinform_v13i1e75279_fig01.png"/></fig><p>A comprehensive corpus was compiled from multiple sources, and an MFH KG was constructed using LLM-driven OpenIE. Then, UKG reasoning was applied to measure the confidence of extracted triples and complete missing triples. In the following sections, we provide a detailed explanation of both modules, outlining their design, implementation, and contributions to the overall framework.</p></sec><sec id="s2-2"><title>KG Construction</title><sec id="s2-2-1"><title>Corpus Collection</title><p>To construct an MFH KG, we systematically constructed a corpus from diverse sources, including ancient and classical literature, modern TCM literature, food and herbs information, regulatory documents, research papers, and TCM formulations. This process results in a corpus of 1359 relevant documents. <xref ref-type="table" rid="table1">Table 1</xref> shows the statistical distribution of documents across different source categories.</p><table-wrap id="t1" position="float"><label>Table 1.</label><caption><p>The statistical distribution of 1359 documents.</p></caption><table id="table1" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Source category</td><td align="left" valign="bottom">Number of documents</td></tr></thead><tbody><tr><td align="left" valign="top">Ancient and classical literature</td><td align="left" valign="top">75</td></tr><tr><td align="left" valign="top">Modern TCM<sup><xref ref-type="table-fn" rid="table1fn1">a</xref></sup> literature</td><td align="left" valign="top">228</td></tr><tr><td align="left" valign="top">Food and herbs information</td><td align="left" valign="top">400</td></tr><tr><td align="left" valign="top">Regulatory documents</td><td align="left" valign="top">42</td></tr><tr><td align="left" valign="top">Research papers</td><td align="left" valign="top">432</td></tr><tr><td align="left" valign="top">TCM formulations</td><td align="left" valign="top">182</td></tr><tr><td align="left" valign="top">Total</td><td align="left" valign="top">1359</td></tr></tbody></table><table-wrap-foot><fn id="table1fn1"><p><sup>a</sup>TCM: Traditional Chinese Medicine.</p></fn></table-wrap-foot></table-wrap><p>To improve the efficiency and accuracy of entity-relation triple extraction, each document was segmented into passages of 300 tokens. These passages were then input into LLMs with a carefully designed prompt (Textbox S1 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>) to resolve pronominal references by incorporating information from document titles and neighboring passages. Additionally, irrelevant content within passages was filtered out to ensure domain-specific focus.</p></sec><sec id="s2-2-2"><title>MFH Knowledge Graph</title><p>Based on the collected corpus, we constructed an MFH KG <inline-formula><mml:math id="ieqn2"><mml:mi>G</mml:mi></mml:math></inline-formula>, as shown in <xref ref-type="fig" rid="figure2">Figure 2</xref>, which illustrates the detailed process. Formally, the graph is defined as a triple <inline-formula><mml:math id="ieqn3"><mml:mi>G</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:mi>E</mml:mi><mml:mo>,</mml:mo><mml:mi>R</mml:mi><mml:mo>,</mml:mo><mml:mi>F</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula>, where <inline-formula><mml:math id="ieqn4"><mml:mi>E</mml:mi></mml:math></inline-formula> represents the set of entities, <inline-formula><mml:math id="ieqn5"><mml:mi>R</mml:mi></mml:math></inline-formula> represents the set of relations, and <inline-formula><mml:math id="ieqn6"><mml:mi>F</mml:mi><mml:mo>&#x2286;</mml:mo><mml:mi>E</mml:mi><mml:mo>&#x00D7;</mml:mo><mml:mi>R</mml:mi><mml:mo>&#x00D7;</mml:mo><mml:mi>E</mml:mi></mml:math></inline-formula> represents the fact set. Each fact in <inline-formula><mml:math id="ieqn7"><mml:mi>F</mml:mi></mml:math></inline-formula> is represented as a quadruple <inline-formula><mml:math id="ieqn8"><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>,</mml:mo><mml:mi>r</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>s</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula>, where <inline-formula><mml:math id="ieqn9"><mml:mi>h</mml:mi></mml:math></inline-formula> is the head entity, <inline-formula><mml:math id="ieqn10"><mml:mi>r</mml:mi></mml:math></inline-formula> is the relation, <inline-formula><mml:math id="ieqn11"><mml:mi>t</mml:mi></mml:math></inline-formula> is the tail entity, and <inline-formula><mml:math id="ieqn12"><mml:mi>s</mml:mi></mml:math></inline-formula> is the confidence score reflecting the likelihood that the triple <inline-formula><mml:math id="ieqn13"><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>,</mml:mo><mml:mi>r</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> holds true. For instance, consider the quadruple (<inline-formula><mml:math id="ieqn14"><mml:mi>h</mml:mi></mml:math></inline-formula>: Insomnia and Vivid Dreams, <inline-formula><mml:math id="ieqn15"><mml:mi>r</mml:mi></mml:math></inline-formula>: Related Constitution, <inline-formula><mml:math id="ieqn16"><mml:mi>t</mml:mi></mml:math></inline-formula>: Yin-Deficient Constitution, <inline-formula><mml:math id="ieqn17"><mml:mi>s</mml:mi></mml:math></inline-formula>: 0.87). This quadruple indicates that Insomnia and Vivid Dreams are associated with the Yin-Deficient Constitution, with a confidence score of 0.87.</p><fig position="float" id="figure2"><label>Figure 2.</label><caption><p>The detailed process of medicine food homology knowledge graph construction. KG: knowledge graph; MFH: medicine food homology.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="medinform_v13i1e75279_fig02.png"/></fig><p>We used LLM-driven OpenIE to extract triples <inline-formula><mml:math id="ieqn18"><mml:mi> </mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>h</mml:mi><mml:mo>,</mml:mo><mml:mi> </mml:mi><mml:mi>r</mml:mi><mml:mo>,</mml:mo><mml:mi> </mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfenced></mml:math></inline-formula> from each passage within the corpus. Specifically, we first integrated predefined relation definitions into a prompt (Textbox S2 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>), guiding the LLM to identify and extract potential relations. These candidate relations, along with existing ones, were subsequently processed using another prompt (Textbox S3 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>), where the LLM determined whether to retain new relations or filter out redundant ones. This process resulted in the construction of a relation set <inline-formula><mml:math id="ieqn19"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mrow><mml:mi mathvariant="normal">s</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula>, which was incorporated into OpenIE prompts, instructing the LLM to extract entity-relation triples. The relations of extracted triples were strictly constrained to the relation set <inline-formula><mml:math id="ieqn20"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mrow><mml:mi mathvariant="normal">s</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula>.</p><p>Specifically, during the OpenIE, we instructed the LLM to extract attributes of food entities and dish entities (Textboxes S4 and S5 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>). For food entities, LLMs referenced their source passages to update attributes, including name, primary effects, consumption methods, indications, and contraindications. Similarly, for dish entities, attributes such as name, ingredient composition, cooking method, and dietary benefits were updated.</p><p>The automated construction of the MFH KG inevitably introduced noise, incompleteness, and factual inaccuracies, making absolute factual correctness unattainable. To mitigate these issues, we adopted UKG reasoning to measure the confidence of extracted triples and complete missing triples. Specifically, we first used unKR [<xref ref-type="bibr" rid="ref30">30</xref>], an open-source Python library for UKG reasoning, to learn vector representations of entities and relations. Based on these representations, we applied the triple confidence measurement method [<xref ref-type="bibr" rid="ref31">31</xref>], integrating heterogeneous evidences to measure confidence of each triple. For each given head entity <inline-formula><mml:math id="ieqn21"><mml:mi>h</mml:mi></mml:math></inline-formula> and relation <inline-formula><mml:math id="ieqn22"><mml:mi>r</mml:mi></mml:math></inline-formula>, candidate tail entities were enumerated to construct new triples absent from the current graph. The triples with confidence scores larger than 0.85 were added to the MFH KG.</p></sec></sec><sec id="s2-3"><title>Retrieval-Augmented Generation</title><sec id="s2-3-1"><title>The Retrieval Strategy</title><p>Given a user query <inline-formula><mml:math id="ieqn23"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">Q</mml:mi></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, we first constructed a prompt (<xref ref-type="other" rid="box1">Textbox 1</xref>) to guide the LLM to extract a set of relevant keywords <inline-formula><mml:math id="ieqn24"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">E</mml:mi></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> from <inline-formula><mml:math id="ieqn25"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">Q</mml:mi></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>. We then encoded both the keywords and all entities from the MFH KG into dense vector representations, denoted as <inline-formula><mml:math id="ieqn26"><mml:msub><mml:mrow><mml:mi>H</mml:mi></mml:mrow><mml:mrow><mml:mi>R</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> and <inline-formula><mml:math id="ieqn27"><mml:msub><mml:mrow><mml:mi>H</mml:mi></mml:mrow><mml:mrow><mml:mi>G</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, respectively. Considering that SBERT [<xref ref-type="bibr" rid="ref32">32</xref>] has demonstrated superior performance over BERT [<xref ref-type="bibr" rid="ref33">33</xref>] and RoBERTa [<xref ref-type="bibr" rid="ref34">34</xref>] on semantic textual similarity tasks while maintaining lower computational overhead [<xref ref-type="bibr" rid="ref35">35</xref>], we adopted SBERT for embedding both the extracted keywords and entities. Subsequently, we computed the cosine similarities between the embeddings of each keyword and all entities. For each keyword, we retrieved the top-10 most similar entities from the MFH KG based on cosine similarity scores. These candidate entities were then presented to the LLM, which was instructed to identify the matched entity (<xref ref-type="other" rid="box2">Textbox 2</xref>). The selected entity corresponding to each keyword constitutes the query entity set <inline-formula><mml:math id="ieqn28"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>E</mml:mi><mml:mrow><mml:mi mathvariant="normal">Q</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>&#x2009;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, which serves as the starting point for subsequent reasoning path retrieval.</p><boxed-text id="box1"><title> Prompt for keyword extraction.</title><p>You are a medical knowledge assistant specialized in Traditional Chinese Medicine. Given a user query, extract a concise set of keywords that represent the user's core health-related intent and information needs. These keywords will be used to retrieve relevant knowledge from a medicine-food homology knowledge graph to answer the user query.</p><p>User query: {user_query}</p><p>Please return the output as a Python-style set of keywords:</p></boxed-text><boxed-text id="box2"><title> Prompt for entity linking.</title><p>Given a keyword and a list of candidate entities retrieved from the medicine food homology knowledge graph, select the entity that most accurately matches the keyword based on contextual meaning and traditional usage. If none of the entities are appropriate matches, return "None."</p><p>Keyword: {keyword}</p><p>Candidate entities: {candidate_entities}</p><p>Please return the output as a JSON list:</p></boxed-text><p>This study used path-based retrieval from the MFH KG rather than retrieving contextual subgraphs for linked entities. This is motivated by the advantages reasoning paths offer in generating MFH-based dietary recommendations. Specifically, reasoning paths provide structured knowledge by capturing direct relations between query entities and answer entities. For example, the reasoning path &#x201C;(Insomnia and Vivid Dreams, Related Constitution, Qi-deficient Constitution); (Qi-deficient Constitution, Suitable Food, Codonopsis)<italic>&#x201D;</italic> enables LLMs to clearly infer the relations between a user&#x2019;s symptoms, their constitution, and the recommended food, thereby enhancing the interpretability. In contrast, subgraph-based retrieval in long-hop reasoning tasks often introduces irrelevant information [<xref ref-type="bibr" rid="ref36">36</xref>]. This not only leads to significant computational overhead but also hinders LLMs from effectively extracting relevant information from the retrieval results.</p><p>Built upon the previous work [<xref ref-type="bibr" rid="ref37">37</xref>], we first provided the LLM with a structured prompt (<xref ref-type="other" rid="box3">Textbox 3</xref>) listing all relations in <inline-formula><mml:math id="ieqn29"><mml:mi>G</mml:mi></mml:math></inline-formula>. The LLM then generated multiple relation paths <inline-formula><mml:math id="ieqn30"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mtext>&#x00A0;</mml:mtext><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msubsup></mml:mrow><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, where each <inline-formula><mml:math id="ieqn31"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:mstyle></mml:math></inline-formula> is an ordered sequence of relations<inline-formula><mml:math id="ieqn32"><mml:mi> </mml:mi><mml:mfenced open="{" close="}" separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>r</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>r</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>r</mml:mi></mml:mrow><mml:mrow><mml:mi>l</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math></inline-formula>. These relation paths serve as guides for retrieving knowledge essential to answering user queries. Given that the MFH KG contained considerably fewer relations compared with large-scale KGs such as FreeBase [<xref ref-type="bibr" rid="ref38">38</xref>], we did not fine-tune the LLM for relation path generation. Instead, we used few-shot prompting to enhance the LLM&#x2019;s ability to generate meaningful relation paths.</p><boxed-text id="box3"><title> Prompt for relation paths generation.</title><p>Task instructions:</p><list list-type="order"><list-item><p>Please generate multiple relation paths (sequences of relations) based on the existing relation types. Each relation path should contain relations that are connected through the same entity.</p></list-item><list-item><p>The purpose of the relation paths is to assist in retrieving relevant entities that can answer the user query.</p></list-item></list><p>Relation types: {existing_relations}</p><p>User query: {user_query}</p><p>Query entities: {query_entities}</p><p>Few-shot examples: {examples}</p><p>Please strictly follow the task instructions and return only the required JSON list:</p></boxed-text><p>Subsequently, starting from each entity in the <inline-formula><mml:math id="ieqn33"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="normal">E</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Q</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula>, we followed each generated relation path <inline-formula><mml:math id="ieqn34"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:mstyle></mml:math></inline-formula> to retrieve a set of reasoning paths <inline-formula><mml:math id="ieqn35"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mo>&#x200B;</mml:mo></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">a</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">a</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">a</mml:mi></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow></mml:msubsup></mml:mrow><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> from <inline-formula><mml:math id="ieqn36"><mml:mi>G</mml:mi></mml:math></inline-formula>, where each reasoning path <inline-formula><mml:math id="ieqn37"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msubsup><mml:mi>p</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">a</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mn>3</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>l</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mrow><mml:mi>l</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>l</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> consists of multiple triples <inline-formula><mml:math id="ieqn38"><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>r</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math></inline-formula> and represents an instance of one of the relation paths.</p></sec><sec id="s2-3-2"><title>Retrieval Result Postprocessing</title><p>In our initial experiment, we noticed that the reasoning paths in <inline-formula><mml:math id="ieqn39"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mo>&#x200B;</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> contained redundant and irrelevant information. To enhance the quality of these reasoning paths, we computed a score for each reasoning path in <inline-formula><mml:math id="ieqn40"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mo>&#x200B;</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> by considering both the entity importance and the triple confidence within the reasoning path. These scores enabled us to filter out less relevant reasoning paths.</p><p>The importance of each entity in the reasoning path was calculated using a weighted PageRank [<xref ref-type="bibr" rid="ref39">39</xref>] algorithm. Traditional PageRank ignored the confidence of triples, which could lead to equivalent treatment of false and true relations, thus causing inaccuracies in entity importance. To overcome this limitation, we constructed a subgraph using entities from the <inline-formula><mml:math id="ieqn41"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mo>&#x200B;</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> along with their one-hop neighbors and incorporated confidence scores of triples as edge weights in the PageRank computation. The weighted PageRank formula is defined as:</p><disp-formula id="E1"><label>(1)</label><mml:math id="eqn1"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mtable rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mrow><mml:mi mathvariant="normal">P</mml:mi><mml:mi mathvariant="normal">R</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>&#x22C5;</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mi>N</mml:mi></mml:mfrac><mml:mo>+</mml:mo><mml:mi>d</mml:mi><mml:mo>&#x22C5;</mml:mo><mml:munder><mml:mo>&#x2211;</mml:mo><mml:mrow><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>&#x2282;</mml:mo><mml:mi>I</mml:mi><mml:mi>n</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:munder><mml:mfrac><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:munder><mml:mo>&#x2211;</mml:mo><mml:mi>k</mml:mi></mml:munder><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>&#x22C5;</mml:mo><mml:mrow><mml:mi mathvariant="normal">P</mml:mi><mml:mi mathvariant="normal">R</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mstyle></mml:mrow></mml:mstyle></mml:math></disp-formula><p>where <inline-formula><mml:math id="ieqn42"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">P</mml:mi><mml:mi mathvariant="normal">R</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> represents the weighted PageRank score of entity <inline-formula><mml:math id="ieqn43"><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, <inline-formula><mml:math id="ieqn44"><mml:mi>d</mml:mi></mml:math></inline-formula> is the damping factor, and <inline-formula><mml:math id="ieqn45"><mml:mi>N</mml:mi></mml:math></inline-formula> is the total number of entities in the graph. The term <inline-formula><mml:math id="ieqn46"><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>&#x2192;</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> denotes the edge weight from entity <inline-formula><mml:math id="ieqn47"><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> to <inline-formula><mml:math id="ieqn48"><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, derived from the confidence score of the corresponding triples. When multiple relations exist between <inline-formula><mml:math id="ieqn49"><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> and <inline-formula><mml:math id="ieqn50"><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> with different confidence scores, their influence was aggregated by averaging these scores. For scoring the reasoning paths, we integrated entity importance and triple confidence scores to formulate the following path-scoring function:</p><disp-formula id="E2"><label>(2)</label><mml:math id="eqn2"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mtable rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mrow><mml:mi mathvariant="normal">P</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">h</mml:mi><mml:mi mathvariant="normal">S</mml:mi><mml:mi mathvariant="normal">c</mml:mi><mml:mi mathvariant="normal">o</mml:mi><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mi>P</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">&#x220F;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:munderover><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x00D7;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mfrac><mml:mn>1</mml:mn><mml:mi>n</mml:mi></mml:mfrac><mml:munder><mml:mo>&#x2211;</mml:mo><mml:mrow><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>&#x2208;</mml:mo><mml:mi>P</mml:mi></mml:mrow></mml:munder><mml:mrow><mml:mi mathvariant="normal">P</mml:mi><mml:mi mathvariant="normal">R</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mstyle></mml:mrow></mml:mstyle></mml:math></disp-formula><p>where <inline-formula><mml:math id="ieqn51"><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn><mml:mo>&#x2192;</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> represents the confidence score of the relation from entity <inline-formula><mml:math id="ieqn52"><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> to <inline-formula><mml:math id="ieqn53"><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, <inline-formula><mml:math id="ieqn54"><mml:mi>n</mml:mi></mml:math></inline-formula> denotes the total number of entities in the path, and <inline-formula><mml:math id="ieqn55"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">P</mml:mi><mml:mi mathvariant="normal">R</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> is the weighted PageRank score of entity <inline-formula><mml:math id="ieqn56"><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> within the reasoning path. This scoring methodology captured both the confidence of triples within the reasoning path and the importance of the entities involved, striking a balance between path reliability and informational importance. Finally, we ranked the reasoning paths based on their scores and retained only the top-<inline-formula><mml:math id="ieqn57"><mml:mi>k</mml:mi></mml:math></inline-formula> reasoning paths for subsequent inference.</p></sec><sec id="s2-3-3"><title>Answer Generation</title><p>We used prompt engineering to improve the accuracy and relevance of generated answers of LLM. Prompt engineering involves constructing carefully designed prompts to guide LLMs toward generating high-quality and task-specific responses. Specifically, we constructed a prompt template (<xref ref-type="other" rid="box4">Textbox 4</xref>) comprising four key components: (1) task specification, (2) user query, (3) retrieved reasoning paths, and (4) attributes of food and dish entities. This structured prompt facilitates the integration of external knowledge, improves the LLMs&#x2019; comprehension of MFH principles, and supports the generation of more accurate responses.</p><boxed-text id="box4"><title> Prompt for answer generation.</title><p>You are a professional Traditional Chinese Medicine doctor, providing dietary recommendations using the concept of &#x201C;medicine food homology.&#x201D; Given a user query and the relevant reasoning paths and entity attributes, generate an answer.</p><p>Task instructions:</p><list list-type="order"><list-item><p>Please provide a detailed, accurate, and concise response based on the information provided.</p></list-item><list-item><p>The response should be well-structured and ensure logical consistency with the given reasoning paths and entity attributes.</p></list-item><list-item><p>Incorporate medicine food homology principles in your recommendations.</p></list-item><list-item><p>Output format: {&#x201C;answer&#x201D;: &#x201C;(Your answer here.)&#x201D;}. The answer must be written in Chinese.</p></list-item></list><p>User query: {user_query}</p><p>Reasoning paths: {reasoning_paths}</p><p>Entity attributes: {entity_attributes}</p><p>Please strictly follow the task instructions and return only the required JSON format:</p></boxed-text></sec></sec><sec id="s2-4"><title>LLM Selection</title><p>To identify the most suitable LLM for MFH dietary recommendation tasks, we evaluated several mainstream LLMs, including GPT-4 [<xref ref-type="bibr" rid="ref40">40</xref>], LLaMA2-Chat-7B [<xref ref-type="bibr" rid="ref41">41</xref>], Qwen2.5-7B [<xref ref-type="bibr" rid="ref42">42</xref>], and DeepSeek-R1 [<xref ref-type="bibr" rid="ref43">43</xref>]. Additionally, we considered the influence of model size, incorporating both large-scale models (GPT-4 and DeepSeek-R1) and 7B-parameter models (LLaMA2-Chat-7B and Qwen2.5-7B). During the experiment, we implemented the same prompt set across all models to ensure comparative evaluation under identical input conditions. All models were integrated with our proposed framework for dietary recommendation generation based on the MFH principles.</p></sec><sec id="s2-5"><title>Evaluation Metrics</title><sec id="s2-5-1"><title>Automated Evaluation</title><p>To quantitatively assess the effectiveness and accuracy of the model&#x2019;s dietary recommendations, we used 2 evaluation metrics: <inline-formula><mml:math id="ieqn58"><mml:mi mathvariant="normal">H</mml:mi><mml:mi mathvariant="normal">i</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mo>@</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula> and <italic>F</italic><sub>1</sub>-score. <inline-formula><mml:math id="ieqn59"><mml:mi mathvariant="normal">H</mml:mi><mml:mi mathvariant="normal">i</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mo>@</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula> measures the proportion of queries where the top-ranked predicted recommendation matches a ground truth answer. This metric evaluates the model&#x2019;s ability to prioritize the most relevant dietary recommendation. <italic>F</italic><sub>1</sub>-score captures the harmonic mean of precision (P) and recall (R), offering a balanced evaluation of both aspects. This metric is particularly appropriate in scenarios where multiple valid recommendations may exist for a single query. It is defined as follows:</p><disp-formula id="E3"><label>(3)</label><mml:math id="eqn3"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mtable rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:msub><mml:mi>F</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn>2</mml:mn><mml:mo>&#x00D7;</mml:mo><mml:mfrac><mml:mrow><mml:mi>P</mml:mi><mml:mo>&#x00D7;</mml:mo><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>P</mml:mi><mml:mo>+</mml:mo><mml:mi>R</mml:mi></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mstyle></mml:math></disp-formula><p>where precision and recall are defined as:</p><disp-formula id="E4"><label>(4)</label><mml:math id="eqn4"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mtable rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mi>P</mml:mi><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mi mathvariant="normal">T</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">T</mml:mi><mml:mi mathvariant="normal">P</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">F</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:mrow></mml:mfrac><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:mi>R</mml:mi><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mi mathvariant="normal">T</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">T</mml:mi><mml:mi mathvariant="normal">P</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">F</mml:mi><mml:mi mathvariant="normal">N</mml:mi></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mstyle></mml:math></disp-formula><p>In this context, <italic><inline-formula><mml:math id="ieqn60"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">T</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula></italic> (true positives) represents the number of dietary recommendations correctly suggested, <inline-formula><mml:math id="ieqn61"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">F</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> (false positives) indicates inappropriate dietary recommendations incorrectly suggested, and <inline-formula><mml:math id="ieqn62"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">F</mml:mi><mml:mi mathvariant="normal">N</mml:mi></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> (false negatives) refers to appropriate dietary recommendations that the model failed to suggest.</p></sec><sec id="s2-5-2"><title>Human Evaluation</title><p>While automated evaluation methods are widely applied in natural language processing tasks, they have certain limitations in the context of dietary recommendations. Automated metrics struggle to assess the effectiveness of recommendations, specifically whether the suggested food and their combinations align with MFH principles. Moreover, user acceptability and explainability of the generated dietary recommendations are difficult to accurately assess using automated methods. Therefore, we incorporated human evaluation, integrating subjective ratings from both experts and general users to provide a more comprehensive assessment of the generated dietary recommendations.</p><p>Specifically, we assessed the generated dietary plans based on the following five evaluation criteria: (1) rationality, (2) explainability, (3) user acceptability, (4) personalization, and (5) consistency. Rationality assesses whether the recommended dietary plan adhered to both TCM principles and modern nutritional standards. Explainability evaluates whether the recommendations included clear TCM-based justifications. A higher score indicates that the system provided reasonable and understandable explanations rather than simply outputting ingredient combinations. User acceptability measures how well the recommendations aligned with users&#x2019; subjective preferences, including taste, cultural adaptability, and feasibility. Personalization assesses whether the system provided tailored recommendations based on an individual&#x2019;s constitution and health conditions. Consistency examines whether the model produced stable recommendations under similar inputs.</p><p>Among these evaluation criteria, rationality, explainability, user acceptability, and personalization were assessed using a 5-point Likert scale (1&#x2010;5, where 1 represented the lowest score and 5 represented the highest). Consistency was evaluated using a binary judgment (Yes=5 points and No=0 points).</p><p>To conduct the evaluation, we recruited 5 experts with backgrounds in TCM or nutrition, along with 20 general users. Participants followed a structured human evaluation guideline to rate the generated dietary recommendations. The evaluation was conducted using a survey system, where assessors were provided with the user queries along with the corresponding dietary recommendations generated by LLMs. Finally, we computed the mean scores for each evaluation criterion.</p></sec></sec><sec id="s2-6"><title>Ethical Considerations</title><p>Institutional review board approval was not required for this study, as it did not involve direct research with human participants. All corpora used, such as research papers and TCM formulations, were publicly available [<xref ref-type="bibr" rid="ref44">44</xref>-<xref ref-type="bibr" rid="ref46">46</xref>], and no identifiable private or sensitive information was accessed or recorded. Annotators involved in the human evaluation participated voluntarily, provided informed consent prior to participation, and were informed of their right to withdraw at any time. No compensation was provided, and no private information was collected.</p></sec></sec><sec id="s3" sec-type="results"><title>Results</title><p>We constructed an MFH KG comprising 24,984 entities, 22 relations, and 29,292 triples. To evaluate the LLMs&#x2019; performance in dietary recommendation tasks, we developed a specialized question answering dataset consisting of 2000 queries focused on MFH principles. This dataset was designed to ensure balanced coverage across diverse health conditions and TCM constitutional types.</p><p><xref ref-type="table" rid="table2">Table 2</xref> shows a comparative analysis of LLMs with or with no augmentation by the MFH KG on dietary recommendation tasks. Overall, the integration of the MFH KG substantially improved model performance across all evaluated metrics, with an average increase of 14.5% in Hits@1 and 8.7% in <italic>F</italic><sub>1</sub>-score, respectively. Among the baseline LLMs, DeepSeek-R1 achieved the best performance (Hits@1: 70.4%, <italic>F</italic><sub>1</sub>-score: 64.1%), followed by GPT-4 (Hits@1: 68.6%, <italic>F</italic><sub>1</sub>-score: 55.8%), Qwen2.5-7B (Hits@1: 58.7%, <italic>F</italic><sub>1</sub>-score: 53.2%), and LLaMA2-Chat-7B (Hits@1: 54.1%, <italic>F</italic><sub>1</sub>-score: 49.3%). The performance ranking remained consistent after MFH KG augmentation, with DeepSeek-R1 outperforming the others (Hits@1: 84.2%, <italic>F</italic><sub>1</sub>-score: 71.5%). Due to its superior performance in the above automated evaluation, DeepSeek-R1 was selected as the LLM for all subsequent experiments.</p><table-wrap id="t2" position="float"><label>Table 2.</label><caption><p>The performance comparison between large language models and medicine food homology knowledge graph&#x2013;augmented large language models on dietary recommendation tasks.</p></caption><table id="table2" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Model</td><td align="left" valign="bottom">Hits@1</td><td align="left" valign="bottom"><italic>F</italic><sub>1</sub>-score</td></tr></thead><tbody><tr><td align="left" valign="top">LLMs<sup><xref ref-type="table-fn" rid="table2fn1">a</xref></sup></td><td align="left" valign="top"/><td align="left" valign="top"/></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>GPT-4</td><td align="left" valign="top">68.6</td><td align="left" valign="top">55.8</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>LLaMA2-Chat-7B</td><td align="left" valign="top">54.1</td><td align="left" valign="top">49.3</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Qwen2.5-7B</td><td align="left" valign="top">58.7</td><td align="left" valign="top">53.2</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>DeepSeek-R1</td><td align="left" valign="top">70.4</td><td align="left" valign="top">64.1</td></tr><tr><td align="left" valign="top">MFH<sup><xref ref-type="table-fn" rid="table2fn2">b</xref></sup> KG<sup><xref ref-type="table-fn" rid="table2fn3">c</xref></sup>+ LLMs</td><td align="left" valign="top"/><td align="left" valign="top"/></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>GPT-4</td><td align="left" valign="top">82.6</td><td align="left" valign="top">69.4</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>LLaMA2-Chat-7B</td><td align="left" valign="top">70.3</td><td align="left" valign="top">55.6</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Qwen2.5-7B</td><td align="left" valign="top">72.8</td><td align="left" valign="top">60.6</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>DeepSeek-R1</td><td align="left" valign="top"><italic>84.2</italic><sup><xref ref-type="table-fn" rid="table2fn4"><italic>d</italic></xref></sup></td><td align="left" valign="top"><italic>71.5</italic></td></tr></tbody></table><table-wrap-foot><fn id="table2fn1"><p><sup>a</sup>LLM: large language model.</p></fn><fn id="table2fn2"><p><sup>b</sup>MFH: medicine food homology.</p></fn><fn id="table2fn3"><p><sup>c</sup>KG: knowledge graph.</p></fn><fn id="table2fn4"><p><sup>d</sup>Values in italics indicate the best performance for each metric.</p></fn></table-wrap-foot></table-wrap><p>In human evaluation, we conducted a comparative assessment between LLMs and MFH KG&#x2013;augmented LLMs across 5 key metrics. As shown in <xref ref-type="table" rid="table3">Table 3</xref>, the MFH KG&#x2013;augmented DeepSeek-R1 consistently outperformed the baseline DeepSeek-R1 model across all evaluation criteria. The MFH KG&#x2013;augmented model achieved substantially higher scores in rationality (4.1 vs 3.2), explainability (4.3 vs 2.9), user acceptability (4.4 vs 3.6), personalization (4.2 vs 3.3), and consistency (4.6 vs 3.4). These results provide compelling evidence that augmenting DeepSeek-R1 with the specialized MFH KG significantly improves the quality of dietary recommendations based on MFH principles.</p><table-wrap id="t3" position="float"><label>Table 3.</label><caption><p>The performance comparison between DeepSeek-R1 and medicine food homology knowledge graph&#x2013;augmented DeepSeek-R1 by human evaluation.</p></caption><table id="table3" frame="hsides" rules="groups"><thead><tr><td align="left" valign="top">Models</td><td align="left" valign="top">Rationality</td><td align="left" valign="top">Explainability</td><td align="left" valign="top">User acceptability</td><td align="left" valign="top">Personalization</td><td align="left" valign="top">Consistency</td></tr></thead><tbody><tr><td align="left" valign="top">DeepSeek-R1</td><td align="left" valign="top">3.2</td><td align="left" valign="top">2.9</td><td align="left" valign="top">3.6</td><td align="left" valign="top">3.3</td><td align="left" valign="top">3.4</td></tr><tr><td align="left" valign="top">MFH<sup><xref ref-type="table-fn" rid="table3fn1">a</xref></sup> KG<sup><xref ref-type="table-fn" rid="table3fn2">b</xref></sup> + DeepSeek&#x2212;R1</td><td align="left" valign="top">4.1</td><td align="left" valign="top">4.3</td><td align="left" valign="top">4.4</td><td align="left" valign="top">4.2</td><td align="left" valign="top">4.6</td></tr></tbody></table><table-wrap-foot><fn id="table3fn1"><p><sup>a</sup>MFH: medicine food homology.</p></fn><fn id="table3fn2"><p><sup>b</sup>KG: knowledge graph.</p></fn></table-wrap-foot></table-wrap><p>We analyzed the impact of parameter <inline-formula><mml:math id="ieqn63"><mml:mi>k</mml:mi></mml:math></inline-formula>, which controls the number of retrieved reasoning paths in the RAG module. The evaluation across <inline-formula><mml:math id="ieqn64"><mml:mi>k</mml:mi></mml:math></inline-formula> values [1, 3, 5, 10, 20, and 30] is shown in <xref ref-type="fig" rid="figure3">Figure 3</xref>. The <italic>F</italic><sub>1</sub>-scores indicate that small increases in <inline-formula><mml:math id="ieqn65"><mml:mi>k</mml:mi></mml:math></inline-formula> initially improved performance, but after reaching an optimal point (<inline-formula><mml:math id="ieqn66"><mml:mi>k</mml:mi></mml:math></inline-formula>=10), further increases led to gradual accuracy decline. This pattern demonstrates the effectiveness of our reasoning path postprocessing, as it successfully prioritizes the most relevant reasoning paths while filtering out potentially misleading or irrelevant information.</p><fig position="float" id="figure3"><label>Figure 3.</label><caption><p>Different knowledge retrieval settings and the corresponding <italic>F</italic><sub>1</sub>-scores.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="medinform_v13i1e75279_fig03.png"/></fig><p>To study the impact of the damping factor <inline-formula><mml:math id="ieqn67"><mml:mi>d</mml:mi></mml:math></inline-formula>, where 1-<italic>d</italic> is the probability of randomly jumping to other nodes, we varied <inline-formula><mml:math id="ieqn68"><mml:mi>d</mml:mi></mml:math></inline-formula> within the range of [0.1, 0.9]. As shown in <xref ref-type="fig" rid="figure4">Figure 4</xref>, the performance of Yaoshi-RAG initially improved with increasing <inline-formula><mml:math id="ieqn69"><mml:mi>d</mml:mi></mml:math></inline-formula>, reached the peak (<inline-formula><mml:math id="ieqn70"><mml:mi>d</mml:mi></mml:math></inline-formula>=0.8), and subsequently declined. This trend aligns with the commonly adopted value (<inline-formula><mml:math id="ieqn71"><mml:mi>d</mml:mi></mml:math></inline-formula>=0.85) proposed by Page et al [<xref ref-type="bibr" rid="ref47">47</xref>] and is consistent with previous findings [<xref ref-type="bibr" rid="ref48">48</xref>,<xref ref-type="bibr" rid="ref49">49</xref>]. Specifically, when <inline-formula><mml:math id="ieqn72"><mml:mi>d</mml:mi></mml:math></inline-formula> is too small, the resulting PageRank distribution is dominated by random jumps, which weakens the influence of the graph structure and yields less meaningful entity rankings. Conversely, when <inline-formula><mml:math id="ieqn73"><mml:mi>d</mml:mi></mml:math></inline-formula> approaches 1, the distribution becomes nearly uniform, and the convergence of the power iteration method slows significantly, posing computational challenges.</p><fig position="float" id="figure4"><label>Figure 4.</label><caption><p>Different damping factor settings and the corresponding <italic>F</italic><sub>1</sub>-scores.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="medinform_v13i1e75279_fig04.png"/></fig><p>We evaluated the effectiveness of Yaoshi-RAG&#x2019;s retrieval strategy against multiple baselines. For sparse retrieval, we used BM25 [<xref ref-type="bibr" rid="ref50">50</xref>] and followed DecAF [<xref ref-type="bibr" rid="ref51">51</xref>] by transforming 1-hop subgraphs of topic entities into text. In KG embedding&#x2013;based methods (TransE [<xref ref-type="bibr" rid="ref52">52</xref>] RAG and RotatE [<xref ref-type="bibr" rid="ref53">53</xref>] RAG), we ranked triples by embedding similarity. We also extracted the 2-hop subgraph to prioritize semantically relevant triples from query entities&#x2019; neighborhood. All baseline methods retained the top 30 triples as retrieval results. <xref ref-type="table" rid="table4">Table 4</xref> shows the performance comparison of different retrieval strategies. Yaoshi-RAG achieved superior performance with the highest Hits@1 (84.2%) and <italic>F</italic><sub>1</sub>-score (71.5%).</p><table-wrap id="t4" position="float"><label>Table 4.</label><caption><p>The performance comparison of retrieval strategies.</p></caption><table id="table4" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Retrieval strategies</td><td align="left" valign="bottom">Hits@1</td><td align="left" valign="bottom"><italic>F</italic><sub>1</sub>-score</td></tr></thead><tbody><tr><td align="left" valign="top">BM25 (2009)</td><td align="left" valign="top">72.8</td><td align="left" valign="top">65.3</td></tr><tr><td align="left" valign="top">TransE RAG (2013)</td><td align="left" valign="top">82.6</td><td align="left" valign="top">69.9</td></tr><tr><td align="left" valign="top">RotatE RAG (2019)</td><td align="left" valign="top">81.9</td><td align="left" valign="top">68.5</td></tr><tr><td align="left" valign="top">2-Hop Subgraph</td><td align="left" valign="top">75.4</td><td align="left" valign="top">67.2</td></tr><tr><td align="left" valign="top">Yaoshi-RAG (Ours)</td><td align="left" valign="top"><italic>84.2</italic><sup><xref ref-type="table-fn" rid="table4fn1"><italic>a</italic></xref></sup></td><td align="left" valign="top"><italic>71.5</italic></td></tr></tbody></table><table-wrap-foot><fn id="table4fn1"><p><sup>a</sup>Values in italics indicate the best performance for each metric.</p></fn></table-wrap-foot></table-wrap><p>To evaluate the impact of key modules in Yaoshi-RAG, we compared three variants: (1) a variant replacing the UKG with a deterministic KG, in which all triples were assumed to be fully reliable (ie, confidence scores were set to 1); (2) a variant removing the postprocessing of retrieval results, in which all retrieved reasoning paths from the UKG were directly input into the LLM without ranking or filtering; and (3) a variant randomly generating relation paths to guide the retrieval of reasoning paths.</p><p>As shown in <xref ref-type="table" rid="table5">Table 5</xref>, using a deterministic KG leads to a performance decline, highlighting the importance of incorporating uncertainty information derived from the UKG. Performance degrades further when postprocessing is removed, due to the inclusion of noisy and irrelevant reasoning paths. This confirms the effectiveness of leveraging weighted PageRank and triple confidence scores in identifying relevant reasoning paths. The variant using randomly generated relation paths for retrieval performs the worst among all settings, emphasizing the necessity of a retrieval strategy that generates faithful relation paths.</p><table-wrap id="t5" position="float"><label>Table 5.</label><caption><p>Ablation studies of Yaoshi-RAG.</p></caption><table id="table5" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Model</td><td align="left" valign="bottom">Hits@1</td><td align="left" valign="bottom"><italic>F</italic><sub>1</sub>-score</td></tr></thead><tbody><tr><td align="left" valign="top">Yaoshi-RAG (Ours)</td><td align="left" valign="top"><italic>84.2</italic><sup><xref ref-type="table-fn" rid="table5fn1"><italic>a</italic></xref></sup></td><td align="left" valign="top"><italic>71.5</italic></td></tr><tr><td align="left" valign="top">w/o UKG<sup><xref ref-type="table-fn" rid="table5fn2">b</xref></sup></td><td align="left" valign="top">80.7</td><td align="left" valign="top">67.9</td></tr><tr><td align="left" valign="top">w/o post-processing</td><td align="left" valign="top">75.3</td><td align="left" valign="top">66.2</td></tr><tr><td align="left" valign="top">w/ random relation paths</td><td align="left" valign="top">65.4</td><td align="left" valign="top">54.2</td></tr></tbody></table><table-wrap-foot><fn id="table5fn1"><p><sup>a</sup>Values in italics indicate the best performance for each metric.</p></fn><fn id="table5fn2"><p><sup>b</sup>UKG: uncertain knowledge graph.</p></fn></table-wrap-foot></table-wrap><p><xref ref-type="other" rid="box5">Textbox 5</xref> demonstrates an actual case of a dietary question and the answer generated by our proposed framework. The framework delivers a comprehensive response to a patient presenting peripheral heat sensations and sleep disturbances. By leveraging reasoning paths derived from the MFH KG, the framework establishes clear relations between reported symptoms, underlying constitutional patterns, and appropriate dietary recommendations. The framework also enriches its recommendations by incorporating detailed food entities&#x2019; attributes from the KG into the LLM, thereby enhancing the specificity of guidance regarding consumption methods and other relevant details. This case demonstrates how Yaoshi-RAG effectively translates MFH principles into clear and practical guidance, helping patients better understand the recommendations and adhere to the suggested treatments.</p><boxed-text id="box5"><title> An actual case of a dietary question and the answer generated by our proposed framework.</title><p>User query:</p><p>Lately my hands and feet keep feeling hot, and I&#x2019;m having trouble sleeping with lots of dreams. Are there any food you&#x2019;d recommend for this?</p><p>&#x6211;&#x6700;&#x8FD1;&#x624B;&#x8DB3;&#x5FC3;&#x70ED;&#x3001;&#x5931;&#x7720;&#x591A;&#x68A6;&#xFF0C;&#x8BF7;&#x7ED9;&#x6211;&#x63A8;&#x8350;&#x4E00;&#x4E9B;&#x98DF;&#x6750;&#x3002; <underline/>Top-3 reasoning paths:</p><list list-type="order"> <list-item><p>(Heat in Hands and Feet, Related Constitution, Yin-deficient Constitution) &#x2192; (Yin-deficient Constitution, Suitable Food, Lily Bulb)</p></list-item> <list-item><p>(Heat in Hands and Feet, Related Constitution, Yin-deficient Constitution) &#x2192; (Yin-deficient Constitution, Suitable Food, White Fungus)</p></list-item> <list-item><p>(Insomnia and Vivid Dreams, Influencing Factor, Disharmony between Heart and Kidney) &#x2192; (Disharmony between Heart and Kidney, Suitable Food, Mulberry)</p></list-item> </list><list list-type="order"> <list-item><p>(&#x624B;&#x8DB3;&#x5FC3;&#x70ED;, &#x5173;&#x8054;&#x4F53;&#x8D28;, &#x9634;&#x865A;&#x8D28;) &#x2192; (&#x9634;&#x865A;&#x8D28;, &#x9002;&#x5B9C;&#x98DF;&#x7269;, &#x767E;&#x5408;)</p></list-item> <list-item><p>(&#x624B;&#x8DB3;&#x5FC3;&#x70ED;, &#x5173;&#x8054;&#x4F53;&#x8D28;, &#x9634;&#x865A;&#x8D28;) &#x2192; (&#x9634;&#x865A;&#x8D28;, &#x9002;&#x5B9C;&#x98DF;&#x7269;, &#x94F6;&#x8033;)</p></list-item> <list-item><p>(&#x5931;&#x7720;&#x591A;&#x68A6;, &#x5F71;&#x54CD;&#x56E0;&#x7D20;, &#x5FC3;&#x80BE;&#x4E0D;&#x4EA4;) &#x2192; (&#x5FC3;&#x80BE;&#x4E0D;&#x4EA4;, &#x9002;&#x5B9C;&#x98DF;&#x7269;, &#x6851;&#x845A;)</p></list-item> </list><p>Attributes of related food entities:</p><p>[Name], [Primary Effects], [Consumption Methods], [Indications], [Contraindications]</p><p>Generated answer:</p><p>Based on the symptoms you described&#x2014;Heat in Hands and Feet, along with Insomnia and Vivid Dreams&#x2014;the following analysis and dietary recommendations are provided according to Traditional Chinese Medicine (TCM) principles:</p><p>TCM syndrome differentiation analysisHeat in Hands and Feet is a typical manifestation of &#x201C;Five-Center Heat&#x201D; syndrome. When accompanied by Insomnia and Vivid Dreams, the condition may be attributed to three primary constitution types: (1) Yin Deficiency with Excessive Fire: Insufficient Yin fluids in the body lead to internal heat, disturbing the Shen (spirit) and causing insomnia. (2) Disharmony between Heart and Kidney: The inability of Kidney Water to balance Heart Fire results in excessive Heart Fire, affecting sleep quality. (3) Liver Blood Deficiency: A deficiency in Yin and Blood leads to an unsettled spirit, causing frequent dreams and light sleep. These syndromes often intertwine, requiring dietary adjustments to nourish Yin, reduce internal heat, and harmonize the Heart and Kidney.Recommended food and recipes</p><list list-type="bullet"><list-item><p>Lily, lotus seed, and white fungus soup: Efficacy: Lily calms the mind, Tremella nourishes Yin and moistens dryness, and lotus seed strengthens the kidney and astringes essence. Together, they create a &#x201C;Metal-Water Mutual Generation&#x201D; effect. Preparation: Soak 15 grams of Tremella in cold water until fully expanded, then tear it into small pieces. Add 30 grams of fresh lily and 20 grams of decored lotus seeds to 800 mL of water and simmer for 1 hour. Add rock sugar before serving. Best time to consume: Between 3 and 5 PM (Shen Hour), when the bladder meridian is active, enhancing Yin nourishment.</p></list-item> <list-item><p>Mulberry and black sesame paste: Efficacy: Mulberries nourish the liver and kidneys, while black sesame replenishes blood and moisturizes dryness, making them an ideal pairing for dual liver-kidney nourishment. Preparation: Lightly toast 50 grams of black sesame over low heat and then blend it with 20 grams of dried mulberries and 30 grams of glutinous rice with 600 mL of water into a smooth paste. Best time to consume: About 2 hours before bedtime for a calming effect.</p></list-item></list><p>Precautions and lifestyle adjustments</p><list list-type="bullet"> <list-item><p>Dietary restrictions: Avoid spicy and heat-inducing food (eg, chili and Sichuan pepper), warming tonics (eg, lamb and longan), and stimulants such as strong tea and coffee.</p></list-item> <list-item><p>Lifestyle recommendations: Prepare for sleep before 9 and 11 PM (Hai Hour). Practice the &#x201C;Shaking Head and Wagging Tail to Reduce Heart Fire&#x201D; movement from the Eight-Section Brocade (Ba Duan Jin). Engage in calligraphy or meditation to calm the mind.</p></list-item></list><p>The above plan should be followed continuously for at least 2 weeks to see effects. If diarrhea occurs, discontinue the use of Poria. For patients with diabetes, it is recommended to substitute rock sugar with xylitol. If symptoms persist, seek medical attention promptly for tongue and pulse diagnosis.</p><p/><p>&#x6839;&#x636E;&#x60A8;&#x63CF;&#x8FF0;&#x7684;&#x624B;&#x8DB3;&#x5FC3;&#x70ED;&#x3001;&#x5931;&#x7720;&#x591A;&#x68A6;&#x75C7;&#x72B6;&#xFF0C;&#x7ED3;&#x5408;&#x4E2D;&#x533B;&#x8FA8;&#x8BC1;&#x53CA;&#x98DF;&#x6750;&#x7279;&#x6027;&#x5206;&#x6790;&#x5982;&#x4E0B;:</p><p>&#x4E2D;&#x533B;&#x8FA8;&#x8BC1;&#x5206;&#x6790;</p><p>&#x624B;&#x8DB3;&#x5FC3;&#x70ED;&#x5C5E;&#x4E8E;&#x201C;&#x4E94;&#x5FC3;&#x70E6;&#x70ED;&#x201D;&#x7684;&#x5178;&#x578B;&#x8868;&#x73B0;&#xFF0C;&#x4F34;&#x968F;&#x5931;&#x7720;&#x591A;&#x68A6;&#x53EF;&#x7EFC;&#x5408;&#x8FA8;&#x8BC1;&#x4E3A;&#x4E09;&#x7C7B;&#x4F53;&#x8D28;&#x95EE;&#x9898;&#xFF1A;&#x5176;&#x4E00;&#x4E3A;&#x9634;&#x865A;&#x706B;&#x65FA;&#xFF0C;&#x56E0;&#x4F53;&#x5185;&#x9634;&#x6DB2;&#x4E0D;&#x8DB3;&#x5BFC;&#x81F4;&#x865A;&#x706B;&#x5185;&#x751F;&#xFF0C;&#x4E0A;&#x6270;&#x5FC3;&#x795E;&#x5F15;&#x53D1;&#x5931;&#x7720;&#xFF1B;&#x5176;&#x4E8C;&#x5C5E;&#x5FC3;&#x80BE;&#x4E0D;&#x4EA4;&#xFF0C;&#x80BE;&#x6C34;&#x65E0;&#x6CD5;&#x4E0A;&#x6D4E;&#x5FC3;&#x706B;&#xFF0C;&#x81F4;&#x4F7F;&#x5FC3;&#x706B;&#x4EA2;&#x76DB;&#x5F71;&#x54CD;&#x7761;&#x7720;&#x8D28;&#x91CF;&#xFF1B;&#x5176;&#x4E09;&#x4E0E;&#x809D;&#x8840;&#x4E0D;&#x8DB3;&#x76F8;&#x5173;&#xFF0C;&#x9634;&#x8840;&#x4E8F;&#x865A;&#x81F4;&#x4F7F;&#x9B42;&#x4E0D;&#x5B88;&#x820D;&#xFF0C;&#x51FA;&#x73B0;&#x591A;&#x68A6;&#x6613;&#x9192;&#x75C7;&#x72B6;&#x3002;&#x8FD9;&#x4E09;&#x79CD;&#x8BC1;&#x578B;&#x5E38;&#x76F8;&#x4E92;&#x4EA4;&#x7EC7;&#xFF0C;&#x9700;&#x901A;&#x8FC7;&#x6ECB;&#x9634;&#x964D;&#x706B;&#x3001;&#x4EA4;&#x901A;&#x5FC3;&#x80BE;&#x7684;&#x98DF;&#x7597;&#x8C03;&#x7406;&#x3002;</p><p>&#x63A8;&#x8350;&#x98DF;&#x6750;&#x4E0E;&#x70F9;&#x996A;&#x65B9;&#x6848;</p><list list-type="bullet"><list-item><p>&#x767E;&#x5408;&#x83B2;&#x5B50;&#x94F6;&#x8033;&#x7FB9;&#xFF1A;&#x529F;&#x6548;&#x914D;&#x4F0D;&#xFF1A;&#x767E;&#x5408;&#x6E05;&#x5FC3;&#x5B89;&#x795E;&#xFF0C;&#x94F6;&#x8033;&#x6ECB;&#x9634;&#x6DA6;&#x71E5;&#xFF0C;&#x83B2;&#x5B50;&#x56FA;&#x80BE;&#x6DA9;&#x7CBE;&#xFF0C;&#x4E09;&#x8005;&#x534F;&#x540C;&#x5F62;&#x6210;&#x201C;&#x91D1;&#x6C34;&#x76F8;&#x751F;&#x201D;&#x4E4B;&#x6548;&#x3002;&#x5236;&#x4F5C;&#x65B9;&#x6CD5;&#xFF1A;&#x53D6;&#x94F6;&#x8033;15&#x514B;&#x51B7;&#x6C34;&#x6CE1;&#x53D1;&#x540E;&#x6495;&#x5C0F;&#x6735;&#xFF0C;&#x914D;&#x9C9C;&#x767E;&#x5408;30&#x514B;&#x3001;&#x53BB;&#x82AF;&#x83B2;&#x5B50;20&#x514B;&#xFF0C;&#x52A0;&#x6C34;800&#x6BEB;&#x5347;&#x7096;&#x716E;1&#x5C0F;&#x65F6;&#xFF0C;&#x8D77;&#x9505;&#x524D;&#x52A0;&#x51B0;&#x7CD6;&#x8C03;&#x5473;&#x3002;&#x5EFA;&#x8BAE;&#x7533;&#x65F6;&#xFF08;&#x4E0B;&#x5348;3-5&#x70B9;&#xFF09;&#x98DF;&#x7528;&#xFF0C;&#x6B64;&#x65F6;&#x8180;&#x80F1;&#x7ECF;&#x5F53;&#x4EE4;&#xFF0C;&#x53EF;&#x589E;&#x5F3A;&#x6ECB;&#x9634;&#x6548;&#x679C;&#x3002;</p></list-item><list-item><p>&#x6851;&#x845A;&#x9ED1;&#x829D;&#x9EBB;&#x7CCA;&#xFF1A;&#x529F;&#x6548;&#x914D;&#x4F0D;&#xFF1A;&#x6851;&#x845A;&#x6ECB;&#x8865;&#x809D;&#x80BE;&#x4E4B;&#x9634;&#xFF0C;&#x9ED1;&#x829D;&#x9EBB;&#x517B;&#x8840;&#x6DA6;&#x71E5;&#xFF0C;&#x4E24;&#x8005;&#x642D;&#x914D;&#x5B9E;&#x73B0;&#x809D;&#x80BE;&#x540C;&#x8865;&#x3002;&#x5236;&#x4F5C;&#x65B9;&#x6CD5;&#xFF1A;&#x5C06;&#x6587;&#x706B;&#x7092;&#x9999;&#x7684;50&#x514B;&#x9ED1;&#x829D;&#x9EBB;&#x4E0E;20&#x514B;&#x6851;&#x845A;&#x5E72;&#x3001;30&#x514B;&#x7CEF;&#x7C73;&#x6DF7;&#x5408;&#xFF0C;&#x52A0;600&#x6BEB;&#x5347;&#x6C34;&#x7528;&#x7834;&#x58C1;&#x673A;&#x6253;&#x6210;&#x7C73;&#x7CCA;&#x3002;&#x9002;&#x5B9C;&#x7761;&#x524D;2&#x5C0F;&#x65F6;&#x6E29;&#x670D;&#xFF0C;&#x6709;&#x52A9;&#x5B81;&#x795E;&#x52A9;&#x7720;&#x3002;</p></list-item></list><p>&#x6CE8;&#x610F;&#x4E8B;&#x9879;&#x4E0E;&#x751F;&#x6D3B;&#x8C03;&#x6444;</p><list list-type="bullet"><list-item><p>&#x996E;&#x98DF;&#x7981;&#x5FCC;&#xFF1A;&#x907F;&#x514D;&#x8F9B;&#x8FA3;&#x52A9;&#x706B;&#x4E4B;&#x7269;&#xFF08;&#x5982;&#x8FA3;&#x6912;&#x3001;&#x82B1;&#x6912;&#xFF09;&#x3001;&#x6E29;&#x70ED;&#x8865;&#x54C1;&#xFF08;&#x5982;&#x7F8A;&#x8089;&#x3001;&#x6842;&#x5706;&#xFF09;&#x53CA;&#x5496;&#x5561;&#x6D53;&#x8336;&#x7B49;&#x5174;&#x594B;&#x6027;&#x996E;&#x54C1;&#x3002;</p></list-item><list-item><p>&#x751F;&#x6D3B;&#x5EFA;&#x8BAE;&#xFF1A;&#x4FDD;&#x8BC1;&#x4EA5;&#x65F6;&#xFF08;21-23&#x70B9;&#xFF09;&#x524D;&#x51C6;&#x5907;&#x5165;&#x7761;&#xFF0C;&#x65E5;&#x5E38;&#x7EC3;&#x4E60;&#x516B;&#x6BB5;&#x9526;&#x201C;&#x6447;&#x5934;&#x6446;&#x5C3E;&#x53BB;&#x5FC3;&#x706B;&#x201D;&#x62DB;&#x5F0F;&#xFF0C;&#x5E76;&#x901A;&#x8FC7;&#x4E66;&#x6CD5;&#x3001;&#x51A5;&#x60F3;&#x5B89;&#x795E;&#x5B9A;&#x5FD7;&#x3002;</p></list-item></list><p>&#x4EE5;&#x4E0A;&#x65B9;&#x6848;&#x9700;&#x8FDE;&#x7EED;&#x98DF;&#x7528;2&#x5468;&#x4EE5;&#x4E0A;&#x89C1;&#x6548;&#xFF0C;&#x82E5;&#x51FA;&#x73B0;&#x8179;&#x6CFB;&#x53EF;&#x6682;&#x505C;&#x832F;&#x82D3;&#xFF0C;&#x7CD6;&#x5C3F;&#x75C5;&#x60A3;&#x8005;&#x5EFA;&#x8BAE;&#x4EE5;&#x6728;&#x7CD6;&#x9187;&#x66FF;&#x4EE3;&#x51B0;&#x7CD6;&#x3002;&#x75C7;&#x72B6;&#x6301;&#x7EED;&#x8005;&#x5E94;&#x53CA;&#x65F6;&#x5C31;&#x533B;&#x8FDB;&#x884C;&#x820C;&#x8109;&#x8BCA;&#x5BDF;&#x3002;</p></boxed-text></sec><sec id="s4" sec-type="discussion"><title>Discussion</title><sec id="s4-1"><title>Principal Findings</title><p>Evaluation results indicate that our framework improved the performance of all evaluated LLMs, showcasing its robust adaptability. High-performing models, such as DeepSeek-R1, exhibited marked improvements when enhanced by the MFH KG. This suggests that the MFH KG offers valuable context about ingredient relations, therapeutic properties, and dietary principles, which might not be fully captured during the models&#x2019; pretraining. Remarkably, even LLMs with fewer parameters showed performance improvement when integrated with the MFH KG. These results highlight the effectiveness of the proposed framework, which combines the contextual reasoning capabilities of LLMs with the rich and structured knowledge of KGs, making it a powerful tool for MFH-based dietary recommendations.</p><p>The human evaluation results revealed that the KG-augmented LLM demonstrated comprehensive improvements. The augmented LLM exhibited improved rationality through the relations between symptoms and dietary recommendations provided by the MFH KG. It also achieved superior explainability by integrating theoretical reasoning paths. Furthermore, the framework demonstrated increased user acceptability with more clinically applicable suggestions. The augmented LLM also maintained greater consistency across varying inputs. These findings collectively indicate that RAG can effectively enhance LLMs&#x2019; capabilities with domain-specific knowledge.</p><p>The parameter analysis and ablation studies validate the effectiveness of our postprocessing strategy applied to the retrieved reasoning paths. Retrieving more information does not necessarily lead to performance improvement and may instead introduce irrelevant or noisy information [<xref ref-type="bibr" rid="ref54">54</xref>], thereby degrading the quality of recommendations. By incorporating triple confidence scores from UKG reasoning, the framework prioritizes informative reasoning paths for dietary recommendations. The performance decline beyond <inline-formula><mml:math id="ieqn74"><mml:mi>k</mml:mi></mml:math></inline-formula>=10 indicates that confidence-based ranking effectively distinguishes informative reasoning paths from less relevant ones. This underscores the importance of uncertainty modeling in TCM knowledge representation, particularly given the heterogeneous quality of evidence. By measuring confidence scores, the inherent uncertainty in MFH principles can be better managed, prioritizing reliable relations while mitigating the influence of less trustworthy ones.</p></sec><sec id="s4-2"><title>Limitations</title><p>Several limitations of this study should be acknowledged. The MFH KG was constructed using OpenIE, which may introduce inaccuracies and cannot cover all knowledge on MFH principles. Besides, we did not fine-tune the LLMs specifically for relation path generation, which may have constrained the retrieval effectiveness of our framework, particularly for complex cases involving multiple symptoms or conditions. Addressing these limitations in the future would likely further enhance the LLMs&#x2019; clinical uses and recommendation quality.</p></sec><sec id="s4-3"><title>Conclusions</title><p>This study shows Yaoshi-RAG, a new framework that enhances LLMs&#x2019; capabilities in generating MFH dietary recommendations through the integration of a UKG. This framework uses multistep LLM calls for OpenIE to automatically construct an MFH KG, incorporating UKG reasoning to measure the confidence of existing triples and complete missing triples. Upon receiving user queries, the framework implements a reasoning path&#x2013;based knowledge retrieval strategy, extracting relevant reasoning paths from the MFH KG and optimizing the retrieval results through a postprocessing mechanism. Experimental evaluations demonstrate that DeepSeek-R1 is the best-performing base model for MFH-based dietary recommendation generation. This framework facilitates dietary recommendations that adapt to individual health conditions and symptom requirements while considering diverse ingredients and dishes, accompanied by comprehensive explanations grounded in MFH principles. In the future, we plan to focus on implementing more effective knowledge extraction methodologies, expanding our KG through additional MFH literature, exploring optimized retrieval strategies, and fine-tuning open-source LLMs to further improve the accuracy and reliability of the generated dietary recommendations.</p></sec></sec></body><back><ack><p>This paper is supported by the National Natural Science Foundation of China (grants 82104786, 62376058, 52378009, and 62276063), the Southeast University Interdisciplinary Research Program for Young Scholars, and the Big Data Computing Center of Southeast University.</p></ack><fn-group><fn fn-type="con"><p>HS and TW contributed to the algorithm design; HS performed experiments and wrote the paper; RL performed experiments; and FG, TW, BL, and HW provided theoretical guidance and the revision of this paper.</p></fn><fn fn-type="conflict"><p>None declared.</p></fn></fn-group><glossary><title>Abbreviations</title><def-list><def-item><term id="abb1">KG</term><def><p>knowledge graph</p></def></def-item><def-item><term id="abb2">LLM</term><def><p>large language model</p></def></def-item><def-item><term id="abb3">MFH</term><def><p>medicine food homology</p></def></def-item><def-item><term id="abb4">OpenIE</term><def><p>open information extraction</p></def></def-item><def-item><term id="abb5">RAG</term><def><p>retrieval-augmented generation</p></def></def-item><def-item><term id="abb6">TCM</term><def><p>Traditional Chinese Medicine</p></def></def-item><def-item><term id="abb7">UKG</term><def><p>uncertain knowledge graph</p></def></def-item></def-list></glossary><ref-list><title>References</title><ref id="ref1"><label>1</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Zhong</surname><given-names>H</given-names> </name><name name-style="western"><surname>Tang</surname><given-names>ZQ</given-names> </name><name name-style="western"><surname>Li</surname><given-names>YF</given-names> </name><name name-style="western"><surname>Wang</surname><given-names>M</given-names> </name><name name-style="western"><surname>Sun</surname><given-names>WY</given-names> </name><name name-style="western"><surname>He</surname><given-names>RR</given-names> </name></person-group><article-title>The evolution and significance of medicine and food homology</article-title><source>Acupunct Herbal Med</source><year>2024</year><volume>4</volume><issue>1</issue><fpage>19</fpage><lpage>35</lpage><pub-id pub-id-type="doi">10.1097/HM9.0000000000000104</pub-id></nlm-citation></ref><ref id="ref2"><label>2</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Chen</surname><given-names>J</given-names> </name></person-group><article-title>Essential role of medicine and food homology in health and wellness</article-title><source>Chin Herb Med</source><year>2023</year><month>07</month><volume>15</volume><issue>3</issue><fpage>347</fpage><lpage>348</lpage><pub-id pub-id-type="doi">10.1016/j.chmed.2023.05.001</pub-id><pub-id pub-id-type="medline">37538868</pub-id></nlm-citation></ref><ref id="ref3"><label>3</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Gong</surname><given-names>X</given-names> </name><name name-style="western"><surname>Ji</surname><given-names>M</given-names> </name><name name-style="western"><surname>Xu</surname><given-names>J</given-names> </name><name name-style="western"><surname>Zhang</surname><given-names>C</given-names> </name><name name-style="western"><surname>Li</surname><given-names>M</given-names> </name></person-group><article-title>Hypoglycemic effects of bioactive ingredients from medicine food homology and medicinal health food species used in China</article-title><source>Crit Rev Food Sci Nutr</source><year>2020</year><volume>60</volume><issue>14</issue><fpage>2303</fpage><lpage>2326</lpage><pub-id pub-id-type="doi">10.1080/10408398.2019.1634517</pub-id><pub-id pub-id-type="medline">31309854</pub-id></nlm-citation></ref><ref id="ref4"><label>4</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Zhao</surname><given-names>W</given-names> </name><name name-style="western"><surname>Zhou</surname><given-names>K</given-names> </name><name name-style="western"><surname>Li</surname><given-names>J</given-names> </name><etal/></person-group><article-title>A survey of large language models</article-title><source>arXiv</source><comment>Preprint posted online on 2023</comment><pub-id pub-id-type="doi">10.48550/arXiv.2303.18223</pub-id></nlm-citation></ref><ref id="ref5"><label>5</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Thirunavukarasu</surname><given-names>AJ</given-names> </name><name name-style="western"><surname>Ting</surname><given-names>DSJ</given-names> </name><name name-style="western"><surname>Elangovan</surname><given-names>K</given-names> </name><name name-style="western"><surname>Gutierrez</surname><given-names>L</given-names> </name><name name-style="western"><surname>Tan</surname><given-names>TF</given-names> </name><name name-style="western"><surname>Ting</surname><given-names>DSW</given-names> </name></person-group><article-title>Large language models in medicine</article-title><source>Nat Med</source><year>2023</year><month>08</month><volume>29</volume><issue>8</issue><fpage>1930</fpage><lpage>1940</lpage><pub-id pub-id-type="doi">10.1038/s41591-023-02448-8</pub-id><pub-id pub-id-type="medline">37460753</pub-id></nlm-citation></ref><ref id="ref6"><label>6</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Liu</surname><given-names>S</given-names> </name><name name-style="western"><surname>McCoy</surname><given-names>AB</given-names> </name><name name-style="western"><surname>Wright</surname><given-names>AP</given-names> </name><etal/></person-group><article-title>Why do users override alerts? Utilizing large language model to summarize comments and optimize clinical decision support</article-title><source>J Am Med Inform Assoc</source><year>2024</year><month>05</month><day>20</day><volume>31</volume><issue>6</issue><fpage>1388</fpage><lpage>1396</lpage><pub-id pub-id-type="doi">10.1093/jamia/ocae041</pub-id><pub-id pub-id-type="medline">38452289</pub-id></nlm-citation></ref><ref id="ref7"><label>7</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Abd-Alrazaq</surname><given-names>A</given-names> </name><name name-style="western"><surname>AlSaad</surname><given-names>R</given-names> </name><name name-style="western"><surname>Alhuwail</surname><given-names>D</given-names> </name><etal/></person-group><article-title>Large language models in medical education: opportunities, challenges, and future directions</article-title><source>JMIR Med Educ</source><year>2023</year><month>06</month><day>1</day><volume>9</volume><fpage>e48291</fpage><pub-id pub-id-type="doi">10.2196/48291</pub-id><pub-id pub-id-type="medline">37261894</pub-id></nlm-citation></ref><ref id="ref8"><label>8</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Wiest</surname><given-names>IC</given-names> </name><name name-style="western"><surname>Ferber</surname><given-names>D</given-names> </name><name name-style="western"><surname>Zhu</surname><given-names>J</given-names> </name><etal/></person-group><article-title>Privacy-preserving large language models for structured medical information retrieval</article-title><source>NPJ Digit Med</source><year>2024</year><month>09</month><day>20</day><volume>7</volume><issue>1</issue><fpage>257</fpage><pub-id pub-id-type="doi">10.1038/s41746-024-01233-2</pub-id><pub-id pub-id-type="medline">39304709</pub-id></nlm-citation></ref><ref id="ref9"><label>9</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Azamfirei</surname><given-names>R</given-names> </name><name name-style="western"><surname>Kudchadkar</surname><given-names>SR</given-names> </name><name name-style="western"><surname>Fackler</surname><given-names>J</given-names> </name></person-group><article-title>Large language models and the perils of their hallucinations</article-title><source>Crit Care</source><year>2023</year><month>03</month><day>21</day><volume>27</volume><issue>1</issue><fpage>120</fpage><pub-id pub-id-type="doi">10.1186/s13054-023-04393-x</pub-id><pub-id pub-id-type="medline">36945051</pub-id></nlm-citation></ref><ref id="ref10"><label>10</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Kim</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Jeong</surname><given-names>H</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>S</given-names> </name><etal/></person-group><article-title>Medical hallucination in foundation models and their impact on healthcare</article-title><source>medRxiv</source><comment>Preprint posted online on 2025</comment><pub-id pub-id-type="doi">10.1101/2025.02.28.25323115</pub-id></nlm-citation></ref><ref id="ref11"><label>11</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Gao</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Xiong</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Gao</surname><given-names>X</given-names> </name><etal/></person-group><article-title>Retrieval-augmented generation for large language models: a survey</article-title><source>arXiv</source><comment>Preprint posted online on 2023</comment><pub-id pub-id-type="doi">10.48550/arXiv.2312.10997</pub-id></nlm-citation></ref><ref id="ref12"><label>12</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Sun-Waterhouse</surname><given-names>DX</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>XY</given-names> </name><name name-style="western"><surname>Liu</surname><given-names>ZH</given-names> </name><name name-style="western"><surname>I.N. Waterhouse</surname><given-names>G</given-names> </name><name name-style="western"><surname>Kang</surname><given-names>WY</given-names> </name></person-group><article-title>Transformation from traditional medicine-food homology to modern food-medicine homology</article-title><source>Food Med Homology</source><year>2024</year><month>09</month><volume>1</volume><issue>1</issue><fpage>9420014</fpage><pub-id pub-id-type="doi">10.26599/FMH.2024.9420014</pub-id></nlm-citation></ref><ref id="ref13"><label>13</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Chen</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Subburathinam</surname><given-names>A</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>CH</given-names> </name><name name-style="western"><surname>Zaki</surname><given-names>MJ</given-names> </name></person-group><article-title>Personalized food recommendation as constrained question answering over a large-scale food knowledge graph</article-title><conf-name>Proceedings of the 14th ACM International Conference on Web Search and Data Mining</conf-name><conf-date>Mar 8-12, 2021</conf-date><conf-loc>Virtual Event, Israel</conf-loc><fpage>544</fpage><lpage>552</lpage><pub-id pub-id-type="doi">10.1145/3437963.3441816</pub-id></nlm-citation></ref><ref id="ref14"><label>14</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Tang</surname><given-names>J</given-names> </name><name name-style="western"><surname>Huang</surname><given-names>B</given-names> </name><name name-style="western"><surname>Xie</surname><given-names>M</given-names> </name></person-group><article-title>Anticancer recipe recommendation based on cancer dietary knowledge graph</article-title><source>Eur J Cancer Care (Engl)</source><year>2023</year><month>10</month><day>18</day><volume>2023</volume><issue>1</issue><fpage>1</fpage><lpage>13</lpage><pub-id pub-id-type="doi">10.1155/2023/8816960</pub-id></nlm-citation></ref><ref id="ref15"><label>15</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Ma</surname><given-names>W</given-names> </name><name name-style="western"><surname>Li</surname><given-names>M</given-names> </name><name name-style="western"><surname>Dai</surname><given-names>J</given-names> </name><name name-style="western"><surname>Ding</surname><given-names>J</given-names> </name><name name-style="western"><surname>Chu</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>H</given-names> </name></person-group><article-title>Nutrition-related knowledge graph neural network for food recommendation</article-title><source>Foods</source><year>2024</year><month>07</month><day>5</day><volume>13</volume><issue>13</issue><fpage>38998649</fpage><pub-id pub-id-type="doi">10.3390/foods13132144</pub-id><pub-id pub-id-type="medline">38998649</pub-id></nlm-citation></ref><ref id="ref16"><label>16</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Yang</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Khatibi</surname><given-names>E</given-names> </name><name name-style="western"><surname>Nagesh</surname><given-names>N</given-names> </name><etal/></person-group><article-title>ChatDiet: empowering personalized nutrition-oriented food recommender chatbots through an LLM-augmented framework</article-title><source>Smart Health (2014)</source><year>2024</year><month>06</month><volume>32</volume><fpage>100465</fpage><pub-id pub-id-type="doi">10.1016/j.smhl.2024.100465</pub-id></nlm-citation></ref><ref id="ref17"><label>17</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Jin</surname><given-names>H</given-names> </name><name name-style="western"><surname>Lin</surname><given-names>Q</given-names> </name><name name-style="western"><surname>Lu</surname><given-names>J</given-names> </name><etal/></person-group><article-title>Evaluating the effectiveness of a generative pretrained transformer-based dietary recommendation system in managing potassium intake for hemodialysis patients</article-title><source>J Ren Nutr</source><year>2024</year><month>11</month><volume>34</volume><issue>6</issue><fpage>539</fpage><lpage>545</lpage><pub-id pub-id-type="doi">10.1053/j.jrn.2024.04.001</pub-id><pub-id pub-id-type="medline">38615701</pub-id></nlm-citation></ref><ref id="ref18"><label>18</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Kopitar</surname><given-names>L</given-names> </name><name name-style="western"><surname>Stiglic</surname><given-names>G</given-names> </name><name name-style="western"><surname>Bedrac</surname><given-names>L</given-names> </name><name name-style="western"><surname>Bian</surname><given-names>J</given-names> </name></person-group><article-title>Personalized meal planning in inpatient clinical dietetics using generative artificial intelligence: system description</article-title><conf-name>2024 IEEE 12th International Conference on Healthcare Informatics (ICHI)</conf-name><conf-date>Jun 3-6, 2024</conf-date><conf-loc>Orlando, FL, USA</conf-loc><fpage>2024</fpage><lpage>2331</lpage><pub-id pub-id-type="doi">10.1109/ICHI61247.2024.00049</pub-id></nlm-citation></ref><ref id="ref19"><label>19</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Pan</surname><given-names>S</given-names> </name><name name-style="western"><surname>Luo</surname><given-names>L</given-names> </name><name name-style="western"><surname>Wang</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>C</given-names> </name><name name-style="western"><surname>Wang</surname><given-names>J</given-names> </name><name name-style="western"><surname>Wu</surname><given-names>X</given-names> </name></person-group><article-title>Unifying large language models and knowledge graphs: a roadmap</article-title><source>IEEE Trans Knowl Data Eng</source><year>2024</year><month>07</month><volume>36</volume><issue>7</issue><fpage>3580</fpage><lpage>3599</lpage><pub-id pub-id-type="doi">10.1109/TKDE.2024.3352100</pub-id></nlm-citation></ref><ref id="ref20"><label>20</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Pan</surname><given-names>J</given-names> </name><name name-style="western"><surname>Razniewski</surname><given-names>S</given-names> </name><name name-style="western"><surname>Kalo</surname><given-names>JC</given-names> </name><etal/></person-group><article-title>Large language models and knowledge graphs: opportunities and challenges</article-title><source>arXiv</source><comment>Preprint posted online on 2023</comment><pub-id pub-id-type="doi">10.48550/arXiv.2308.06374</pub-id></nlm-citation></ref><ref id="ref21"><label>21</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Zhang</surname><given-names>B</given-names> </name><name name-style="western"><surname>Soh</surname><given-names>H</given-names> </name></person-group><article-title>Extract, define, canonicalize: an LLM-based framework for knowledge graph construction</article-title><year>2024</year><conf-name>Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing</conf-name><conf-date>2024</conf-date><conf-loc>Miami, Florida, USA</conf-loc><fpage>9820</fpage><lpage>9836</lpage><pub-id pub-id-type="doi">10.18653/v1/2024.emnlp-main.548</pub-id></nlm-citation></ref><ref id="ref22"><label>22</label><nlm-citation citation-type="book"><person-group person-group-type="author"><name name-style="western"><surname>Yu</surname><given-names>S</given-names> </name><name name-style="western"><surname>Huang</surname><given-names>T</given-names> </name><name name-style="western"><surname>Liu</surname><given-names>M</given-names> </name><name name-style="western"><surname>Wang Z.</surname><given-names>B</given-names> </name></person-group><article-title>BEAR: revolutionizing service domain knowledge graph construction with LLM</article-title><source>Service-Oriented Computing ICSOC 2023 Lecture Notes in Computer Science</source><year>2023</year><volume>14419</volume><publisher-name>Springer</publisher-name><pub-id pub-id-type="doi">10.1007/978-3-031-48421-6_23</pub-id></nlm-citation></ref><ref id="ref23"><label>23</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Hu</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Zou</surname><given-names>F</given-names> </name><name name-style="western"><surname>Han</surname><given-names>J</given-names> </name><name name-style="western"><surname>Sun</surname><given-names>X</given-names> </name><name name-style="western"><surname>Wang</surname><given-names>Y</given-names> </name></person-group><article-title>LLM-TIKG: Threat intelligence knowledge graph construction utilizing large language model</article-title><source>Comput Secur</source><year>2024</year><month>10</month><volume>145</volume><fpage>103999</fpage><pub-id pub-id-type="doi">10.1016/j.cose.2024.103999</pub-id></nlm-citation></ref><ref id="ref24"><label>24</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Yang</surname><given-names>H</given-names> </name><name name-style="western"><surname>Xiao</surname><given-names>L</given-names> </name><name name-style="western"><surname>Zhu</surname><given-names>R</given-names> </name><name name-style="western"><surname>Liu</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>J</given-names> </name></person-group><article-title>An LLM supported approach to ontology and knowledge graph construction</article-title><conf-name>2024 IEEE International Conference on Bioinformatics and Biomedicine (BIBM)</conf-name><conf-date>Dec 3-6, 2024</conf-date><conf-loc>Lisbon, Portugal</conf-loc><fpage>5240</fpage><lpage>5246</lpage><pub-id pub-id-type="doi">10.1109/BIBM62325.2024.10822222</pub-id></nlm-citation></ref><ref id="ref25"><label>25</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Tang</surname><given-names>J</given-names> </name><name name-style="western"><surname>Yang</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Wei</surname><given-names>W</given-names> </name><etal/></person-group><article-title>GraphGPT: graph instruction tuning for large language models</article-title><year>2024</year><month>07</month><day>10</day><conf-name>Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR &#x2019;24)</conf-name><conf-date>Jul 14-18, 2024</conf-date><conf-loc>Washington, DC, USA</conf-loc><fpage>491</fpage><lpage>500</lpage><pub-id pub-id-type="doi">10.1145/3626772.3657775</pub-id></nlm-citation></ref><ref id="ref26"><label>26</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Dernbach</surname><given-names>S</given-names> </name><name name-style="western"><surname>Agarwal</surname><given-names>K</given-names> </name><name name-style="western"><surname>Zuniga</surname><given-names>A</given-names> </name><name name-style="western"><surname>Henry</surname><given-names>M</given-names> </name><name name-style="western"><surname>Choudhury</surname><given-names>S</given-names> </name></person-group><article-title>GLaM: fine-tuning large language models for domain knowledge graph alignment via neighborhood partitioning and generative subgraph encoding</article-title><source>AAAI-SS</source><year>2024</year><volume>3</volume><issue>1</issue><fpage>82</fpage><lpage>89</lpage><pub-id pub-id-type="doi">10.1609/aaaiss.v3i1.31186</pub-id></nlm-citation></ref><ref id="ref27"><label>27</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Sun</surname><given-names>J</given-names> </name><name name-style="western"><surname>Xu</surname><given-names>C</given-names> </name><name name-style="western"><surname>Tang</surname><given-names>L</given-names> </name><etal/></person-group><article-title>Think-on-graph: deep and responsible reasoning of large language model on knowledge graph</article-title><year>2024</year><month>05</month><access-date>2025-08-08</access-date><conf-name>The Twelfth International Conference on Learning Representations (ICLR</conf-name><comment><ext-link ext-link-type="uri" xlink:href="https://openreview.net/forum?id=nnVO1PvbTv">https://openreview.net/forum?id=nnVO1PvbTv</ext-link></comment></nlm-citation></ref><ref id="ref28"><label>28</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Jiang</surname><given-names>J</given-names> </name><name name-style="western"><surname>Zhou</surname><given-names>K</given-names> </name><name name-style="western"><surname>Dong</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Ye</surname><given-names>K</given-names> </name><name name-style="western"><surname>Zhao</surname><given-names>X</given-names> </name><name name-style="western"><surname>Wen</surname><given-names>JR</given-names> </name></person-group><article-title>StructGPT: a general framework for large language model to reason over structured data</article-title><conf-name>Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing</conf-name><conf-date>2023</conf-date><conf-loc>Singapore</conf-loc><fpage>9237</fpage><lpage>9251</lpage><pub-id pub-id-type="doi">10.18653/v1/2023.emnlp-main.574</pub-id></nlm-citation></ref><ref id="ref29"><label>29</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Niklaus</surname><given-names>C</given-names> </name><name name-style="western"><surname>Cetto</surname><given-names>M</given-names> </name><name name-style="western"><surname>Freitas</surname><given-names>A</given-names> </name><etal/></person-group><article-title>A survey on open information extraction</article-title><access-date>2025-08-08</access-date><conf-name>The 27th International Conference on Computational Linguistics (COLING)</conf-name><conf-date>2018</conf-date><conf-loc>Santa Fe, New Mexico, USA</conf-loc><fpage>3866</fpage><lpage>3878</lpage><comment><ext-link ext-link-type="uri" xlink:href="https://aclanthology.org/C18-1326">https://aclanthology.org/C18-1326</ext-link></comment></nlm-citation></ref><ref id="ref30"><label>30</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Wang</surname><given-names>J</given-names> </name><name name-style="western"><surname>Wu</surname><given-names>T</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>S</given-names> </name><etal/></person-group><article-title>UnKR: a Python library for uncertain knowledge graph reasoning by representation learning</article-title><conf-name>Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR &#x2019;24)</conf-name><conf-date>2024</conf-date><conf-loc>United States</conf-loc><fpage>2822</fpage><lpage>2826</lpage><pub-id pub-id-type="doi">10.1145/3626772.3657661</pub-id></nlm-citation></ref><ref id="ref31"><label>31</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Wu</surname><given-names>T</given-names> </name><name name-style="western"><surname>Yao</surname><given-names>K</given-names> </name><name name-style="western"><surname>Li</surname><given-names>W</given-names> </name><etal/></person-group><article-title>Triple confidence measurement in knowledge graph with multiple heterogeneous evidences</article-title><source>World Wide Web</source><year>2024</year><month>11</month><volume>27</volume><issue>6</issue><fpage>70</fpage><pub-id pub-id-type="doi">10.1007/s11280-024-01307-x</pub-id></nlm-citation></ref><ref id="ref32"><label>32</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Reimers</surname><given-names>N</given-names> </name><name name-style="western"><surname>Gurevych</surname><given-names>I</given-names> </name></person-group><article-title>Sentence-BERT: sentence embeddings using Siamese BERT-networks</article-title><conf-name>Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)</conf-name><conf-date>2019</conf-date><conf-loc>Hong Kong, China</conf-loc><fpage>3982</fpage><lpage>3992</lpage><pub-id pub-id-type="doi">10.18653/v1/D19-1410</pub-id></nlm-citation></ref><ref id="ref33"><label>33</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Devlin</surname><given-names>J</given-names> </name><name name-style="western"><surname>Chang</surname><given-names>MW</given-names> </name><name name-style="western"><surname>Lee</surname><given-names>K</given-names> </name><name name-style="western"><surname>Toutanova</surname><given-names>K</given-names> </name></person-group><article-title>BERT: pre-training of deep bidirectional transformers for language understanding</article-title><conf-name>Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies</conf-name><conf-date>2019</conf-date><conf-loc>Minneapolis, MA, USA</conf-loc><fpage>4171</fpage><lpage>4186</lpage><pub-id pub-id-type="doi">10.18653/v1/N19-1423</pub-id></nlm-citation></ref><ref id="ref34"><label>34</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Liu</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Ott</surname><given-names>M</given-names> </name><name name-style="western"><surname>Goyal</surname><given-names>N</given-names> </name><etal/></person-group><article-title>RoBERTa: a robustly optimized BERT pretraining approach</article-title><source>arXiv</source><comment>Preprint posted online on 2019</comment><pub-id pub-id-type="doi">10.48550/arXiv.1907.11692</pub-id></nlm-citation></ref><ref id="ref35"><label>35</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Bekamiri</surname><given-names>H</given-names> </name><name name-style="western"><surname>Hain</surname><given-names>DS</given-names> </name><name name-style="western"><surname>Jurowetzki</surname><given-names>R</given-names> </name></person-group><article-title>PatentSBERTa: a deep NLP based hybrid model for patent distance and classification using augmented SBERT</article-title><source>Technol Forecast Soc Change</source><year>2024</year><month>09</month><volume>206</volume><fpage>123536</fpage><pub-id pub-id-type="doi">10.1016/j.techfore.2024.123536</pub-id></nlm-citation></ref><ref id="ref36"><label>36</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Li</surname><given-names>M</given-names> </name><name name-style="western"><surname>Miao</surname><given-names>S</given-names> </name><name name-style="western"><surname>Li</surname><given-names>P</given-names> </name></person-group><article-title>Simple is effective: the roles of graphs and large language models in knowledge-graph-based retrieval-augmented generation</article-title><source>arXiv</source><comment>Preprint posted online on 2024</comment><pub-id pub-id-type="doi">10.48550/arXiv.2410.20724</pub-id></nlm-citation></ref><ref id="ref37"><label>37</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Luo</surname><given-names>L</given-names> </name><name name-style="western"><surname>Li</surname><given-names>YF</given-names> </name><name name-style="western"><surname>Haffari</surname><given-names>G</given-names> </name><etal/></person-group><article-title>Reasoning on graphs: faithful and interpretable large language model reasoning</article-title><year>2024</year><access-date>2025-08-08</access-date><conf-name>The Twelfth International Conference on Learning Representations</conf-name><comment><ext-link ext-link-type="uri" xlink:href="https://openreview.net/forum?id=ZGNWW7xZ6Q">https://openreview.net/forum?id=ZGNWW7xZ6Q</ext-link></comment></nlm-citation></ref><ref id="ref38"><label>38</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Bollacker</surname><given-names>K</given-names> </name><name name-style="western"><surname>Evans</surname><given-names>C</given-names> </name><name name-style="western"><surname>Paritosh</surname><given-names>P</given-names> </name><etal/></person-group><article-title>Freebase: a collaboratively created graph database for structuring human knowledge</article-title><year>2008</year><conf-name>Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data (SIGMOD &#x2019;08)</conf-name><conf-date>Jun 9-12, 2008</conf-date><conf-loc>New York, NY</conf-loc><fpage>1247</fpage><lpage>1250</lpage><pub-id pub-id-type="doi">10.1145/1376616.1376746</pub-id></nlm-citation></ref><ref id="ref39"><label>39</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Bianchini</surname><given-names>M</given-names> </name><name name-style="western"><surname>Gori</surname><given-names>M</given-names> </name><name name-style="western"><surname>Scarselli</surname><given-names>F</given-names> </name></person-group><article-title>Inside PageRank</article-title><source>ACM Trans Internet Technol</source><year>2005</year><month>02</month><volume>5</volume><issue>1</issue><fpage>92</fpage><lpage>128</lpage><pub-id pub-id-type="doi">10.1145/1052934.1052938</pub-id></nlm-citation></ref><ref id="ref40"><label>40</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>OpenAI</surname><given-names>AJ</given-names> </name><name name-style="western"><surname>Adler</surname><given-names>S</given-names> </name><etal/></person-group><article-title>GPT-4 technical report</article-title><source>arXiv</source><comment>Preprint posted online on 2024</comment><pub-id pub-id-type="doi">10.48550/arXiv.2303.08774</pub-id></nlm-citation></ref><ref id="ref41"><label>41</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Touvron</surname><given-names>H</given-names> </name><name name-style="western"><surname>Martin</surname><given-names>L</given-names> </name><name name-style="western"><surname>Stone</surname><given-names>K</given-names> </name><etal/></person-group><article-title>LLaMA 2: open foundation and fine-tuned chat models</article-title><comment>Preprint posted online on 2023</comment><pub-id pub-id-type="doi">10.48550/arXiv.2307.09288</pub-id></nlm-citation></ref><ref id="ref42"><label>42</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Yang</surname><given-names>A</given-names> </name><name name-style="western"><surname>Yang</surname><given-names>B</given-names> </name><name name-style="western"><surname>Zhang</surname><given-names>B</given-names> </name><etal/></person-group><article-title>Qwen2.5 technical report</article-title><source>arXiv</source><comment>Preprint posted online on 2025</comment><pub-id pub-id-type="doi">10.48550/arXiv.2412.15115</pub-id></nlm-citation></ref><ref id="ref43"><label>43</label><nlm-citation citation-type="other"><person-group person-group-type="author"><collab>DeepSeek-AI</collab><name name-style="western"><surname>Guo</surname><given-names>D</given-names> </name><name name-style="western"><surname>Yang</surname><given-names>D</given-names> </name><etal/></person-group><article-title>DeepSeek-R1: incentivizing reasoning capability in LLMs via reinforcement learning</article-title><comment>Preprint posted online on 2025</comment><pub-id pub-id-type="doi">10.48550/arXiv.2501.12948</pub-id></nlm-citation></ref><ref id="ref44"><label>44</label><nlm-citation citation-type="web"><article-title>TCM-ID: Traditional Chinese Medicine information database</article-title><source>TCM-ID</source><access-date>2024-12-10</access-date><comment><ext-link ext-link-type="uri" xlink:href="https://bidd.group/TCMID/">https://bidd.group/TCMID/</ext-link></comment></nlm-citation></ref><ref id="ref45"><label>45</label><nlm-citation citation-type="web"><source>PubMed</source><access-date>2024-12-10</access-date><comment><ext-link ext-link-type="uri" xlink:href="https://pubmed.ncbi.nlm.nih.gov/">https://pubmed.ncbi.nlm.nih.gov/</ext-link></comment></nlm-citation></ref><ref id="ref46"><label>46</label><nlm-citation citation-type="web"><article-title>Global academic insights from China and beyond</article-title><source>Cnki</source><access-date>2024-12-10</access-date><comment><ext-link ext-link-type="uri" xlink:href="https://oversea.cnki.net/">https://oversea.cnki.net/</ext-link></comment></nlm-citation></ref><ref id="ref47"><label>47</label><nlm-citation citation-type="report"><person-group person-group-type="author"><name name-style="western"><surname>Page</surname><given-names>L</given-names> </name><name name-style="western"><surname>Brin</surname><given-names>S</given-names> </name><name name-style="western"><surname>Motwani</surname><given-names>R</given-names> </name><name name-style="western"><surname>Winograd</surname><given-names>T</given-names> </name></person-group><article-title>The PageRank citation ranking: bringing order to the web</article-title><year>1999</year><access-date>2025-08-08</access-date><publisher-name>Stanford InfoLab</publisher-name><comment><ext-link ext-link-type="uri" xlink:href="http://ilpubs.stanford.edu:8090/422">http://ilpubs.stanford.edu:8090/422</ext-link></comment></nlm-citation></ref><ref id="ref48"><label>48</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Srivastava</surname><given-names>AK</given-names> </name><name name-style="western"><surname>Garg</surname><given-names>R</given-names> </name><name name-style="western"><surname>Mishra</surname><given-names>PK</given-names> </name></person-group><article-title>Discussion on damping factor value in PageRank computation</article-title><source>IJISA</source><year>2017</year><month>09</month><day>8</day><volume>9</volume><issue>9</issue><fpage>19</fpage><lpage>28</lpage><pub-id pub-id-type="doi">10.5815/ijisa.2017.09.03</pub-id></nlm-citation></ref><ref id="ref49"><label>49</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Boldi</surname><given-names>P</given-names> </name><name name-style="western"><surname>Santini</surname><given-names>M</given-names> </name><name name-style="western"><surname>Vigna</surname><given-names>S</given-names> </name></person-group><article-title>PageRank as a function of the damping factor</article-title><year>2005</year><conf-name>Proceedings of the 14th International Conference on World Wide Web</conf-name><conf-loc>Chiba, Japan</conf-loc><fpage>557</fpage><lpage>566</lpage><pub-id pub-id-type="doi">10.1145/1060745.1060827</pub-id></nlm-citation></ref><ref id="ref50"><label>50</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Robertson</surname><given-names>S</given-names> </name><name name-style="western"><surname>Zaragoza</surname><given-names>H</given-names> </name></person-group><article-title>The probabilistic relevance framework: BM25 and beyond</article-title><source>FNT Inf Retrieval</source><year>2009</year><volume>3</volume><issue>4</issue><fpage>333</fpage><lpage>389</lpage><pub-id pub-id-type="doi">10.1561/1500000019</pub-id></nlm-citation></ref><ref id="ref51"><label>51</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Yu</surname><given-names>D</given-names> </name><name name-style="western"><surname>Zhang</surname><given-names>S</given-names> </name><name name-style="western"><surname>Ng</surname><given-names>P</given-names> </name><etal/></person-group><article-title>DecAF: joint decoding of answers and logical forms for question answering over knowledge bases</article-title><year>2023</year><access-date>2025-08-08</access-date><conf-name>The Eleventh International Conference on Learning Representations</conf-name><comment><ext-link ext-link-type="uri" xlink:href="https://openreview.net/forum?id=XHc5zRPxqV9">https://openreview.net/forum?id=XHc5zRPxqV9</ext-link></comment></nlm-citation></ref><ref id="ref52"><label>52</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Bordes</surname><given-names>A</given-names> </name><name name-style="western"><surname>Usunier</surname><given-names>N</given-names> </name><name name-style="western"><surname>Garcia-Duran</surname><given-names>A</given-names> </name><etal/></person-group><person-group person-group-type="editor"><name name-style="western"><surname>Burges</surname><given-names>CJ</given-names> </name><name name-style="western"><surname>Bottou</surname><given-names>L</given-names> </name><name name-style="western"><surname>Welling</surname><given-names>M</given-names> </name><name name-style="western"><surname>Ghahramani</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Weinberger</surname><given-names>KQ</given-names> </name></person-group><article-title>Translating embeddings for modeling multi-relational data</article-title><access-date>2025-08-08</access-date><conf-name>NIPS&#x2019;13: Neural Information Processing Systems</conf-name><conf-date>Dec 5-10, 2013</conf-date><conf-loc>Lake Tahoe, NV</conf-loc><comment><ext-link ext-link-type="uri" xlink:href="https://proceedings.neurips.cc/paper_files/paper/2013/file/1cecc7a77928ca8133fa24680a88d2f9-Paper.pdf">https://proceedings.neurips.cc/paper_files/paper/2013/file/1cecc7a77928ca8133fa24680a88d2f9-Paper.pdf</ext-link></comment></nlm-citation></ref><ref id="ref53"><label>53</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Sun</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Deng</surname><given-names>ZH</given-names> </name><name name-style="western"><surname>Nie</surname><given-names>JY</given-names> </name><etal/></person-group><article-title>RotatE: knowledge graph embedding by relational rotation in complex space</article-title><access-date>2025-08-08</access-date><conf-name>International Conference on Learning Representations</conf-name><conf-date>May 6-9, 2019</conf-date><conf-loc>New Orleans, LA</conf-loc><comment><ext-link ext-link-type="uri" xlink:href="https://openreview.net/forum?id=HkgEQnRqYQ">https://openreview.net/forum?id=HkgEQnRqYQ</ext-link></comment></nlm-citation></ref><ref id="ref54"><label>54</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Cuconasu</surname><given-names>F</given-names> </name><name name-style="western"><surname>Trappolini</surname><given-names>G</given-names> </name><name name-style="western"><surname>Siciliano</surname><given-names>F</given-names> </name><etal/></person-group><article-title>The power of noise: redefining retrieval for RAG systems</article-title><conf-name>Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR &#x2019;24)</conf-name><conf-date>Jul 14-18, 2024</conf-date><conf-loc>Washington, DC, USA</conf-loc><fpage>719</fpage><lpage>729</lpage><pub-id pub-id-type="doi">10.1145/3626772.3657834</pub-id></nlm-citation></ref></ref-list><app-group><supplementary-material id="app1"><label>Multimedia Appendix 1</label><p>Prompts for medicine food homology knowledge graph construction.</p><media xlink:href="medinform_v13i1e75279_app1.docx" xlink:title="DOCX File, 22 KB"/></supplementary-material></app-group></back></article>