Depression can have a major impact on memory. Memory should improve as the depression gets better. The hippocampus tends to get smaller in depressed people over time and that's the memory part of the brain.
The growth of new neurons(neurogenesis) in the hippocampus appears to play a large role in recovery from depression. Exercise and antidepressants are associated with neurogenesis. Blueberries are thought to help memory and slow brain aging. In lab animals blueberry extract promotes neurogenesis in the hippocampus. It would be interesting if that is the case with people.