Some people have seizures that affect all of the brain at once: these are called generalized seizures. Others have partial seizures, affecting only part of the brain, and some people have both generalized and partial seizures. Memory problems can happen in both cases.
If you have partial seizures, the way your seizures can affect your memory will depend on where in the brain your seizures happen. The brain has two halves (hemispheres). Each half has four parts called lobes. They are the occipital, parietal, temporal and frontal lobes. The different lobes of the brain are important for different types of memory.
Controlling seizures with AEDs may help to improve memory. This improvement is probably not due directly to the AEDs, but because the seizures are less frequent or have stopped completely, and so seizures have less effect on your memory.