I have had a problem with brain forg in the past, then I discovered a large number of minnor symptoms that all suggested candida infection. I found a website (link below) that explained it quite well how candida can cause leaky gut and then brain fog and allergies and all sorts of other things that would not occur to you until you read it. I am on ThreeLac now (+colostrum for the leaky gut); my brain fog lifted about three weeks after starting to take it.
Hope this helps,