INTRODUCTION: We studied the replication and generalization of previously identified metabolites potentially associated with global cognitive function in multiple race/ethnicities and assessed the contribution of diet to these associations. METHODS: We tested metabolite-cognitive function associations in U.S.A. Hispanic/Latino adults (n = 2222) from the Community Health Study/ Study of Latinos (HCHS/SOL) and in European (n = 1365) and African (n = 478) Americans from the Atherosclerosis Risk In Communities (ARIC) Study. We applied Mendelian Randomization (MR) analyses to assess causal associations between the metabolites and cognitive function and between Mediterranean diet and cognitive function. RESULTS: Six metabolites were consistently associated with lower global cognitive function across all studies. Of these, four were sugar-related (e.g., ribitol). MR analyses provided weak evidence for a potential causal effect of ribitol on cognitive function and bi-directional effects of cognitive performance on diet. DISCUSSION: Several diet-related metabolites were associated with global cognitive function across studies with different race/ethnicities. HIGHLIGHTS: Metabolites associated with cognitive function in Puerto Rican adults were recently identified. We demonstrate the generalizability of these associations across diverse race/ethnicities. Most identified metabolites are related to sugars. Mendelian Randomization (MR) provides weak evidence for a causal effect of ribitol on cognitive function. Beta-cryptoxanthin and other metabolites highlight the importance of a healthy diet