Cox proportional hazards models estimated hazard ratios (HRs), with multiple sensitivity and subgroup analyses performed.<h4>Results</h4>Over a median follow-up of 3.0 years (GLP-1 RA vs. DPP4i) and 2.4 years (GLP-1 RA vs. SGLT2i), GLP-1 RA use was associated with a lower dementia risk versus DPP4is (109 vs. 148 events; HR 0.76, 95% CI 0.59-0.97), but a higher risk versus SGLT2is (127 vs. 64 events; HR 1.53, 95% CI 1.13-2.07). This evidence concerns the gene GLP1R and dementia.