Changes in the brain's physiology in Alzheimer's disease are thought to occur early in the disease's trajectory. In this study our aim was to investigate the brain's neurochemical profile in a midlife cohort in relation to risk factors for future dementia using single voxel proton magnetic resonance spectroscopy. Participants in the multi-site PREVENT-Dementia study (age range 40-59 year old) underwent 3T magnetic resonance spectroscopy with the spectroscopy voxel placed in the posterior cingulate/precuneus region. Using LCModel, we quantified the absolute concentrations of myo-inositol, total N-acetylaspartate, total creatine, choline, glutathione and glutamate-glutamine for 406 participants (mean age 51.1; 65.3% female). Underlying partial volume effects were accounted for by applying a correction for the presence of cerebrospinal fluid in the magnetic resonance spectroscopy voxel. We investigated how metabolite concentrations related to apolipoprotein ɛ4 genotype, dementia family history, a risk score (Cardiovascular Risk Factors, Aging and Incidence of Dementia -CAIDE) for future dementia including non-modifiable and potentially-modifiable factors and dietary patterns (adherence to Mediterranean diet). Dementia family history was associated with decreased total N-acetylaspartate and no differences were found between apolipoprotein ɛ4 carriers and non-carriers. A higher Cardiovascular Risk Factors, Aging, and Incidence of Dementia score related to higher myo-inositol, choline, total creatine and glutamate-glutamine, an effect which was mainly driven by older age and a higher body mass index. Greater adherence to the Mediterranean diet was associated with lower choline, myo-inositol and total creatine; these effects did not survive correction for multiple comparisons. The observed associations suggest that at midlife the brain demonstrates subtle neurochemical changes in relation to both inherited and potentially modifiable risk factors for future dementia.