In a unique new study, scientists planted tiny microelectrodes into the brains of two people to see how we store memories. They found that neurons that were active when the person did a task (in this case, playing a Simon-like game) “replayed” the steps of that task during sleep—helping to store the memory for a longer time.

CNN Health tell us more here, in “For the first time, scientists can see how the brain records our memories as we sleep”