Bistorta vivipara is a medicinal plant with a long history, but there are few studies on the effects of its medicinal components and endophytic bacteria on the accumulation of secondary metabolites. Therefore, in this study, non-targeted metabolomics techniques and 16s rDNA techniques were used to study B. vivipara from different regions. A total of 1290 metabolites and 437 differential metabolites were identified from all samples. Among them, flavonoids, isoflavonoids, and benzopyrans are the main medicinal components of B. vivipara; these have potential anticancer, antiviral, and antioxidant properties, as well as potential applications for the treatment of atrial fibrillation. In addition, irigenin, an important medicinal component, was identified for the first time. The endophytic bacterial communities in the root tissues of B. vivipara from different regions were also different in composition and richness. Hierarchical clustering heat map analysis showed that Proteobacteria and Actinobacteriota bacteria significantly affected the accumulation of many medicinal components in the roots of B. vivipara.