Endophytes may participate in the conversion of metabolites within medicinal plants, influencing the efficacy of host. However, the distribution of endophytes within medicinal plants P. notoginseng and how it contributes to the conversion of saponins are not well understood. Here, we determined the distribution of saponins and endophytes within P. notoginseng compartments and further confirm the saponin conversion by endophytes. We found metabolites showed compartment specificity within P. notoginseng. Potential saponin biomarkers, such as Rb1, Rg1, Re, Rc and Rd, were obtained. Endophytic diversity, composition and co-occurrence networks also showed compartment specificity, and bacterial alpha diversity values were highest in root compartment, consistently decreased in the stem and leaf compartments, whereas those of fungi showed the opposite trend. Potential bacterial biomarkers, such as Rhizobium, Bacillus, Pseudomonas, Enterobacter, Klebsiella, Pantoea and fungal biomarkers Phoma, Epicoccum, Xylariales, were also obtained. Endophytes related to saponin contents were found by Spearman correlation analysis, and further verification experiments showed that Enterobacter chengduensis could convert ginsenoside Rg1 to F1 at a rate of 13.24%; Trichoderma koningii could convert ginsenoside Rb1 to Rd at a rate of 40.00% and to Rg3 at a rate of 32.31%; Penicillium chermesinum could convert ginsenoside Rb1 to Rd at a rate of 74.24%.