Yuanhuzhitong prescription (YZP), composed by Corydalis yanhusuo and Angelica dahurica, is mainly used to treat stomach pain, rib pain, headache. However, there is limited information on the effects of YZP on the activity of CYP450 enzymes, and studies on the compatibility mechanism of YZP in view of CYP-mediated herb-herb interactions are rarely conducted. This study, utilizing probe substrates, human liver microsomes, recombinant CYP metabolic enzymes, CYP inhibitors, and molecular docking, focuses on the metabolic stability and inhibitory activity of YZP components on P450 isozymes, and how imperatorin (IPT) and isoimperatorin (IIP) affect the elimination pathway of tetrahydropalmatine (THP) by inhibiting the activity of the CYP450 enzyme to enhance the analgesic efficacy of CYH. The results showed that THP shows weak inhibition of CYP2C9, CYP2D6, and 3A4; while IPT and IIP are potent inhibitors of CYP1A2, moderate inhibitors of CYP2C19, CYP2C9, CYP2D6, and 3A4. In addition, CYP2B6 was strongly inhibited by IPT and moderately inhibited by IIP. THP is primarily metabolized by CYP1A2, CYP2C9, CYP2D6, and CYP3A4. IPT and IIP undergo metabolism mainly through CYP1A2, CYP2B6, CYP2C19, and 3A4. Molecular docking studies confirmed that THP, IPT and IIP occupy the active sites of CYP1A2, CYP2C9, CYP2D6, and CYP3A4. In vitro and in vivo experiments have shown a significant reduction in metabolism of THP in combination with IPT or IIP. IPT and IIP mediate the metabolism of THP in the liver by inhibiting P450 enzymes, thereby enhancing the bioavailability of THP, reducing the elimination rate of THP, and consequently improving the analgesic efficacy.