It has long been suspected that the relative abundance of specific nutrients can affect cognitive processes and emotions. Newly described influences of dietary factors on neuronal function and synaptic plasticity have revealed some of the vital mechanisms that are responsible for the action of diet on brain health and mental function. Several gut hormones that can enter the brain, or that are produced in the brain itself, influence cognitive ability. In addition, well-established regulators of synaptic plasticity, such as brain-derived neurotrophic factor, can function as metabolic modulators, responding to peripheral signals such as food intake. Understanding the molecular basis of the effects of food on cognition will help us to determine how best to manipulate diet in order to increase the resistance of neurons to insults and promote mental fitness.