Revealing the mechanisms of memory