> In the CAIDE study, coffee drinking of 3-5 cups per day at midlife was associated with a decreased risk of dementia/AD by about 65% at late-life. In conclusion, coffee drinking may be associated with a decreased risk of dementia/AD. This may be mediated by caffeine and/or other mechanisms like antioxidant capacity and increased insulin sensitivity.
Not all studies are this positive. Note that sleep deprivation is still a risk factor, with or without the aid of caffeine.
Sleep enough, exercise (especially outside), eat right, make sure your brain is active and engaged on a regular basis (read real books, challenge yourself by getting out of your intellectual comfort zone). Studies show that coffee is good for Alzheimer's, so as long as you're not using it to stay awake when you need sleep, it's probably fine.
I consume around 500-1000mg of caffeine a day (very carefully timed so as not to get jitters). I can't handle a higher dose of Adderall XR, so I've embraced my higher caffeine intakes as a way to soothe the mind. That said, I don't care for the flavor of coffee, so I typically consume it via Red Bull/5hr/tablet form.