IntroductionThe exact triggers of gallstone formation remain incompletely understood, but research indicates that microbial infection is a significant factor and can interfere with treatment. There is no consensus on the bile microbial culture profiles in previous studies, and determining the microbial profile could aid in targeted prevention and treatment. The primary aim of this study is to investigate the differences in microbial communities cultured from bile specimens of patients with gallstones.MethodsWe collected the clinical characteristics and bile microbial status of 9,939 gallstone patients. Statistical analysis was employed to assess the relationship between microbes and clinical features, and a random forest model was utilized to predict recurrence.ResultsResults showed a higher proportion of females among patients, with the age group of 60-74 years being the most prevalent. The most common type of gallstone was solitary gallbladder stones. A total of 76 microbes were cultured from 5,153 patients, with Escherichia coli, Klebsiella pneumoniae, and Enterococcus faecalis being the most frequently identified. Significant differences in microbial diversity and positive detection rates were observed across different age groups, types of gallstones, and recurrence status. Positive frequencies of E. coli, Enterococcus faecium, and K. pneumoniae varied significantly by age group and gallstone type. The microbial diversity in the recurrence group was significantly lower compared to the non-recurrence group. The recurrence rate was significantly higher in the group with single microbial species compared to those with no microbes or multiple microbes. For the recurrence group, there were significant differences in the frequencies of seven microbes (Aeromonas hydrophila, Enterococcus casseliflavus, Enterococcus faecium, E. coli, K. pneumoniae, Proteus mirabilis, Pseudomonas aeruginosa) before and after recurrence, with these microbes appearing in a higher number of patients after recurrence. Regression analysis identified patient age, stone size, diabetes, venous thrombosis, liver cirrhosis, malignancy, coronary heart disease, and the number of microbial species as important predictors of recurrence. A random forest model constructed using these variables demonstrated good performance and high predictive ability (ROC-AUC = 0.862).DiscussionThese findings highlight the significant role of microbial communities in gallstone formation and recurrence. Furthermore, the identified predictors of recurrence, including clinical factors and microbial diversity, may help develop personalized prevention and recurrence strategies for gallstone patients.