A high-fat diet and early pesticide exposure affect learning and memory in radically different ways depending on an animal's biological sex and genetic makeup. The findings suggest dietary advice for brain health should be tailored to individual profiles.