I don't know if you've read Brain Energy by Chris Palmer MD, but you'd probably really like it as a scientific confirmation of what you have experienced.
I used to be ketogenic, but ultimately moved to consuming more simple sugar from fruit juice etc per Ray Peat.