BackgroundAn altered gut microbiome characterized by reduced abundance of butyrate producing bacteria and reduced gene richness is associated with type 2 diabetes (T2D). An important complication of T2D is increased risk of cognitive impairment and dementia. The biguanide metformin is a commonly prescribed medication for the control of T2D and metformin treatment has been associated with a significant reduction in the risk of dementia and improved cognition, particularly in people with T2D. AimTo investigate the associations of metformin use with cognition exploring potential mechanisms by analyzing the gut microbiome and plasma metabolome using shotgun metagenomics and HPLC-ESI-MS/MS, respectively. MethodsWe explored two independent cohorts: an observational study (Aging Imageomics) and a phase IV, randomized, double-blind, parallel-group, randomized pilot study (MEIFLO). From the two studies, we analyzed four study groups: (1) individuals with no documented medical history or medical treatment (n = 172); (2) people with long-term T2D on metformin monotherapy (n = 134); (3) people with long-term T2D treated with oral hypoglycemic agents other than metformin (n = 45); (4) a newly diagnosed T2D subjects on metformin monotherapy (n = 22). Analyses were also performed stratifying by sex. ResultsSeveral bacterial species belonging to the Proteobacteria (Escherichia coli) and Verrucomicrobia (Akkermansia muciniphila) phyla were positively associated with metformin treatment, while bacterial species belonging to the Firmicutes phylum (Romboutsia timonensis, Romboutsia ilealis) were negatively associated. Due to the consistent increase in A. muciniphila and decrease in R.ilealis in people with T2D subjects treated with metformin, we investigated the association between this ratio and cognition. In the entire cohort of metformin-treated T2D subjects, the A.muciniphila/R.ilealis ratio was not significantly associated with cognitive test scores. However, after stratifying by sex, the A.muciniphila/R. ilealis ratio was significantly and positively associated with higher memory scores and improved memory in men.Metformin treatment was associated with an enrichment of microbial pathways involved in the TCA cycle, and butanoate, arginine, and proline metabolism in both cohorts. The bacterial genes involved in arginine metabolism, especially in production of glutamate (astA, astB, astC, astD, astE, putA), were enriched following metformin intake. In agreement, in the metabolomics analysis, metformin treatment was strongly associated with the amino acid proline, a metabolite involved in the metabolism of glutamate. ConclusionsThe beneficial effects of metformin may be mediated by changes in the composition of the gut microbiota and microbial-host-derived co-metabolites.