Analysis of over one million Veterans' health records using advanced artificial intelligence identified metolazone (a diuretic) and varenicline (smoking cessation medication) as potentially protective against Alzheimer's disease and related dementias. The AI model found negative impact scores for both drugs, with 96% of metolazone users and 95% of varenicline users showing protective associations at cumulative doses of 1800mg and 280mg respectively. This represents one of the largest medication-wide association studies ever conducted for dementia, leveraging 23 years of longitudinal data from over 500,000 matched case-control pairs. The findings could accelerate drug repurposing efforts, as both medications are already FDA-approved with established safety profiles. However, this observational study from electronic health records cannot establish causation—users of these medications may have healthier behaviors or underlying conditions that reduce dementia risk. The medication-wide association approach using explainable AI offers a promising new methodology for identifying therapeutic candidates from real-world data. As a preprint awaiting peer review, these results require validation through randomized controlled trials before clinical recommendations can be made.