Consider that diet can affect your gut microbiome. Consider also that gut bacteria produce short chain fatty acids from dietary fiber, so that diet can not only affect what bacterial species are in the gut but what products they produce. Now, take a look at this article on the “gut-brain axis” mediated in part by lipids, including fatty acids, and this other article on a similar topic.
“We are what we eat,” indeed. Perhaps, we “think what we eat” as well.