You might be interested in "hippocampal replay" and "sequence reactivation" during sleep
TL;DR during sleep, most critters' brains actively "re-play" waking experiences, and this contributes to learning+memory. I can't find the paper right now, but at a talk in ~2013 some guy presented work in which spatial trajectories run by rats were reconstructed from hippocampal place cell activation sequences during sleep
https://en.wikipedia.org/wiki/Hippocampal_replay
https://www.jneurosci.org/content/28/31/7883
http://sci-hub.tw/https://doi.org/10.1016/j.neuron.2019.01.0...
https://www.cell.com/current-biology/pdf/S0960-9822(17)31441...