The causality and mechanism of dietary effects on brain aging are still unclear due to the long time scales of aging. The nematodeCaenorhabditis eleganshas contributed to aging research because of its short lifespan and easy genetic manipulation. When fed the standard laboratory diet,Escherichia coli,C. elegansexperiences an age-dependent decline in temperature–food associative learning, called thermotaxis. To address if diet affects this decline, we screened 35 lactic acid bacteria as alternative diet and found that animals maintained high thermotaxis ability when fed a clade ofLactobacillienriched with heterofermentative bacteria. Among them,Lactobacillusreuterimaintained the thermotaxis of aged animals without affecting their lifespan and motility. The effect ofLb. reuteridepends on the DAF-16 transcription factor functioning in neurons. Furthermore, RNA sequencing analysis revealed that differentially expressed genes between aged animals fed different bacteria were enriched with DAF-16 targets. Our results demonstrate that diet can impact brain aging in adaf-16-dependent manner without changing the lifespan.