Pancreatic cancer has a dismal prognosis, as it is often diagnosed at stage IV of the disease and is characterized by metastatic spread. Gut microbiota and its metabolites have been suggested to influence the metastatic spread by modulating the host immune system or by promoting angiogenesis. To date, the gut microbial profiles of metastatic and non-metastatic patients need to be explored. Taking advantage of the 16S metagenomic sequencing and the PEnalized LOgistic Regression Analysis (PELORA) we identified clusters of bacteria with differential abundances between metastatic and non-metastatic patients. An overall increase in Gram-negative bacteria in metastatic patients compared to non-metastatic ones was identified using this method. Furthermore, to gain more insight into how gut microbes can predict metastases, a machine learning approach (iterative Random Forest) was performed. Iterative Random Forest analysis revealed which microorganisms were characterized by a different level of relative abundance between metastatic and non-metastatic patients and established a functional relationship between the relative abundance and the probability of having metastases. At the species level, the following bacteria were found to have the highest discriminatory power: , , sp. 619, , and at the genus level, and , and at the family level. Finally, these data were intertwined with those from a metabolomics analysis on fecal samples of patients with or without metastasis to better understand the role of gut microbiota in the metastatic process. Artificial intelligence has been applied in different areas of the medical field. Translating its application in the field of gut microbiota analysis may help fully exploit the potential information contained in such a large amount of data aiming to open up new supportive areas of intervention in the management of cancer.