I only know about DHA-an essential fatty acid containing foods are brain boosters...they are mostly present in dry fruits...
like walnuts and almonds...
I know this is not about food but I know when you really want to retain something in your long term memory you gotta study at night right before you go to sleep. When we sleep is when most of our memory is stored and is most likely to be retained in long term. This makes you think why we are encouraged to do our ibadah at night.... cause if we pray or read Quran at night it is more likely we will remember it inshAllah