The incidence of breast cancer (BC) is increasing in South Korea, and diet is closely related to the high prevalence of BC. The microbiome directly reflects eating habits. In this study, a diagnostic algorithm was developed by analyzing the microbiome patterns of BC. Blood samples were collected from 96 patients with BC and 192 healthy controls. Bacterial extracellular vesicles (EVs) were collected from each blood sample, and next-generation sequencing (NGS) of bacterial EVs was performed. Microbiome analysis of patients with BC and healthy controls identified significantly higher bacterial abundances using EVs in each group and confirmed the receiver operating characteristic (ROC) curves. Using this algorithm, animal experiments were performed to determine which foods affect EV composition. Compared to BC and healthy controls, statistically significant bacterial EVs were selected from both groups, and a receiver operating characteristic (ROC) curve was drawn with a sensitivity of 96.4%, specificity of 100%, and accuracy of 99.6% based on the machine learning method. This algorithm is expected to be applicable to medical practice, such as in health checkup centers. In addition, the results obtained from animal experiments are expected to select and apply foods that have a positive effect on patients with BC.