Construction and Question Answering of Ethno-herbal Knowledge Graph Based on LangChain
(1.School of Information Engineering, Minzu University of China, Beijing 100081, China; 2.China National Software and Service Co., Ltd., Beijing 102209, China)
Abstract
Aiming at the problems of scattered ethnic medicine knowledge, difficulty in systematic utilization, and intelligent query, relying on the China Ethnic Medicine Big Data Platform, this paper collects and cleans the structured data of 55 ethnic minority medicinal materials. This paper innovatively proposes an “Ethnic Medicine Data Cube Model”, clearly defines the ternary domains of ethnicity, medicinal material, and disease and their mapping relationships, and supports multi-dimensional closed-loop reasoning and dynamic cross-validation. The model effectively solves the dynamic mining problems of complex patterns such as “cross-ethnic use of medicinal materials” and “treatment of similar diseases with different medicines”, and improves the knowledge correlation analysis ability. Furthermore, integrating the LangChain framework to build a Knowledge Graph question answering system, aiming at the limitations of context understanding and query control, this paper proposes a context reconstruction chain and a constrained Cypher query generation mechanism. It effectively solves the problem of insufficient semantic parsing accuracy and improves the accuracy of question answering. The results show that the data cube model can effectively reveal patterns such as cross-ethnic use of medicinal materials. The proposed question answering mechanism outperforms the baseline methods in parsing accuracy and answer accuracy, which verifies its feasibility and effectiveness. The system integrates Neo4j and Large Language Model (LLM) technology, enables users to interactively explore the core knowledge of medicinal materials in natural language, and provides a new path for the systematic organization, intelligent application, and digital inheritance of ethnic medicine knowledge.
Keywords
ethnic medicinal material; Knowledge Graph; LangChain; LLM; intelligent question answering
References
- [1] Sun Xiaoming, Zhang Xiaohui, Wang Haifeng, etc The current situation and development strategy of China's ethnic medicine industry [J]. Chinese Journal of Experimental Pharmacology, 2020, 26 (12): 195-202
- [2] Zhu Zhaoyun Exploration of the Path of Inheritance, Innovation and Development of Ethnic Medicine [J]. China Food and Drug Administration, 2023 (12): 12-17
- [3] Jia Minru, Zhang Yi, Yan Zhuyun, etc The Varieties and Current Status of Traditional Chinese Medicine in China [J]. World Science and Technology - Modernization of Traditional Chinese Medicine, 2015, 17 (7): 1546-1550
- [4] He Hanjiao, Yan Fei, Long Yi The current status and development of the application of external medication for ethnic minorities in China [J]. Journal of Shanxi University of Traditional Chinese Medicine, 2023, 24 (5): 584-590
- [5] AMIT S. Introducing the Knowledge Graph: things, not strings. America: Official Blog of Google [EB/OL].(2012-05-16)[2025-04-25].https://googleblog.blogspot.com/2012/05/introducing-knowledge-graph-things-not.html.
- [6] Yu Tong, Li Jinghua, Yu Qi, etc Construction and Application of Traditional Chinese Medicine Health Knowledge Graph [J]. China Digital Medicine, 2017, 12 (12): 64-66
- [7] Huang Weilong Research on the Construction of a Medical Knowledge Graph Question Answering System Based on Deep Learning [D]. Wuhan: Huazhong University of Science and Technology, 2019
- [8] Ruan Tong, Sun Chenglin, Wang Haofen, etc Construction and Application of Traditional Chinese Medicine Knowledge Graph [J]. Journal of Medical Informatics, 2016, 37 (4): 8-13
- [9] Cao Haowei, Xu Jianliang, Dou Fangkun Construction of a Biomedical Knowledge Graph Based on Neo4j [J]. Computer Age, 2020 (6): 35-38
- [10] Fu Yang, Liu Maofu, Qiao Rui Construction of Chinese Knowledge Graph for Heart Disease [J]. Journal of Wuhan University: Science Edition, 2020, 66 (3): 261-267
- [11] Zheng Guangguang, Yi Tianyuan, Tang Dongxin, etc Knowledge Extraction of Chinese Ethnic Medicine Based on BERT BiLSTM CRF Model [J]. Journal of Wuhan University: Science Edition, 2021, 67 (5): 393-402
- [12] Zhang Chentong, Zhang Jiaying, Zhang Zhixing, etc Construction of a Large Scale Disease Terminology Atlas Integrating Commonly Used Phrases [J]. Computer Research and Development, 2020, 57 (11): 2467-2247
- [13] Wang Jingwei, Xiao Li, Yan Junfeng Research on the Construction of Knowledge Graph for "Treatise on Cold Damage" Based on Neo4j [J]. Computer and Digital Engineering, 2021, 49 (2): 264-267396
- [14] Cui Yanwei, Gao Yi Design and Development of Tibetan Medicine Knowledge Map Retrieval System [J]. Xizang Science and Technology, 2024, 46 (10): 74-80
- [15] Song Haitao, Chen Da, Gao Junli, etc Construction Method of Medical Knowledge Graph Based on GPT Model [J]. Journal of Xinyang Normal University: Natural Science Edition, 2025, 38 (3): 289-296
- [16] Li Qing Research on the Construction of Ethnic Medicine Knowledge Graph and Question Answering System [D]. Guiyang: Guizhou University, 2023
- [17] Li Qing, Tang Dongxin, He Song Construction of Ethnic Medicine Knowledge Graph Based on Albert Model [J]. Computer Age, 2022 (9): 6-11
- [18] Qiao Bo, Zhou Zihao, Yuan Quan Design and Implementation of Traditional Chinese Medicine Knowledge Graph Based on Professional Books and Web Data [J]. Anhui Agricultural Science, 2024, 52 (21): 222-226232
- [19] Li Ruting, Wu Xiangyu, Zhang Yifei, etc Research on Building a Knowledge Graph of "Haiyao Bencao" Based on Neo4j [J]. Journal of Guangzhou University of Traditional Chinese Medicine, 2024, 41 (11): 3063-3069
- [20] Pan Hui Research on the Technological Development of Large Language Models [J]. Paper Equipment and Materials, 2025, 54 (1): 53-55
- [21] OLIVIER C,BLETE M-A. Developing Apps with GPT-4 and ChatGPT: Build Intelligent Chatbots, Content Generators, and More [M].Sebastopol:O' Reilly Media,Inc.,2024.
- [22] LIU Y Y,ZHENG Z,ZHANG F. A Comprehensive Survey of Prompt Engineering Techniques in Large Language Models [J/OL].Frontiers of Computer Science,2026,20(3):2003601[2025-05-06].https://journal.hep.com.cn/fcs/EN/10.1007/s11704-025-50058-z.
- [23] Translated by Zhang He, Wang Xin, Han Lifan, etc Research on Question Answering System Based on Large Language Model Fusion Knowledge Graph [J]. Computer Science and Exploration, 2023, 17 (10): 2377-2388
- [24] Wang Shuai, He Wenchun, Wang Fudi, etc A Question Answering System Integrating Knowledge Graph and Vector Retrieval with Large Language Model [J]. Science, Technology and Engineering, 2024, 24 (32): 13902-13910
- [25] CHANG K Y,XU S C,WANG C L,et al. Efficient Prompting Methods for Large Language Models: A Survey [J/OL].arXiv:2404.01077 [cs.CL].[2025-05-03].https://doi.org/10.48550/arXiv.2404.01077.
- [26] Hu Jiahui, Li Jiao, Yao Kuanda, etc Research on the Construction of Medical Question Answering System Integrating Large Language Model and Knowledge Graph [J]. China Digital Medicine, 2024, 19 (6): 91-95
Funding
Theoretical Study on Efficient Algorithm of Artificial Bee Colony with Fusion Strategy Behavior (62176273)
About the authors
Luo Senqiang (1999-), male, Han ethnicity, from Xianyang, Shaanxi, master's degree, currently enrolled, research interests include knowledge graphs; Pan Xiuqin (1971-), female, Han ethnicity, from Kaifeng, Henan, professor, doctoral degree, research interests include AI technologies and intelligent systems; Du Haiying (1979-), male, Han ethnicity, from Beijing, intermediate engineer, bachelor's degree, research interests include artificial intelligence.