Good question.
Cannabidiol mitigates the memory inhibition caused by THC.

This link is a good place to start;
Key ingredient staves off marijuana memory loss : Nature News

Seems the most promising approach to non drug related memory impairment.

Aloha,
Weezard