Ethnopharmacological relevance‘Xiayuxue decoction’ (XYXD) is a traditional Chinese medicine compound, composing of three natural medicines: Rheum officinale Baill., Prunus persica (L.) Batsch and Eupolyphaga sinensis Walker. It is derived from the famous traditional Chinese medical classics ‘Jingui Yaolue’ and has been used for thousands of years. In the Guidelines for the Diagnosis and Treatment of Primary liver Cancer issued by China's Health Commission, XYXD was applied in the treatment of primary liver cancer. Aim of the studyTo clarify the pharmacodynamic material basis and mechanism of XYXD in the treatment of hepatocellular carcinoma (HCC). Materials and methodsFirstly, the active components of XYXD and its distribution in vivo were identified by Ultraperformance liquid chromatography coupled with quadrupole time-of-flight mass spectrometry (UPLC-Q-TOF-MS). Then, the effective components and mechanism of XYXD against HCC were explored by network pharmacology combined with cell experiments in vitro. Furthermore, the anti-HCC effect of XYXD was determined by animal experiments in vivo. Metagenomic sequencing was used to detect its effect in gut microbiota, and targeted metabolism was used to detect the changes of bile acids in the liver. Finally, the related targets of NKT cell immune function activation were detected by RT-qPCR and Elisa. ResultsA total of 113 active ingredients in XYXD were identified, and the distribution of active ingredients in blood, liver, tumor, cecum, intestinal contents and feces was clarified. The circulation process and active ingredient group of XYXD were preliminarily clarified. In addition, we found five anti-HCC active ingredients in XYXD through network pharmacology combined with cell experiments in vitro, among which aloe emodin had the most significant effect, and predicted the potential mechanism of XYXD against HCC through NKT cell pathway. Moreover, the inhibitory effect of XYXD on liver tumor growth was clarified by animal experiments in vivo. The mechanism was mainly to promote the production of bile salt hydrolase (BSH) by increasing the abundance of Bacteroides and Lactobacillus, BSH converts conjugated bile acids into primary bile acids, and reduces the conversion of primary bile acids to secondary bile acids by reducing the abundance of Eubacterium, thereby increasing the content of primary bile acids. Primary bile acids trigger NKT cells in the liver to produce interferon-γ to exert anti-HCC immune effects. ConclusionThis study found that the traditional Chinese herbal formula XYXD can trigger the immune effect of NKT cells against HCC by regulating the interaction between gut microbiota and bile acids.