Abstract
BACKGROUND: The concept of medicine and food homology in traditional Chinese medicine (TCM) emphasized the dual role of certain material as both food and medicine, offering nutritional and therapeutic benefits. Edible herbal formulas, derived from this principle, are valuable for health management and chronic disease prevention. METHODS: This study proposes a domain-specific prescription recommendation model enriched by TCM edible herbal formula knowledge called TCM-DS model. A dataset including symptoms, TCM constitutions, formulas and their corresponding ingredients was developed. DeepSeek R1 base model was fine-tuned utilizing Low-rank adaptation (LoRA) fine-tuning and a retrieval-augmented generation (RAG) module to increase recommendation accuracy. TCM-DS model was evaluated against general-purpose large language models. RESULTS: The proposed TCM-DS model demonstrated superior performance, achieving a recommendation precision of 0.9924. Comparative experiments showed its robustness, with the highest precision scores for both forward and reverse symptom sequences compared with general-purpose large language models. A user-friendly platform was developed based on TCM-DS model, enabling automated constitution analysis and personalized formula recommendations. CONCLUSIONS: In conclusion, we proposed an intelligent TCM edible herbal formula recommendation model called TCM-DS. Its accompanying platform automated constitution identification and formula recommendation, advancing intelligent applications in TCM practice.