The Markov Memory for Generating Rare Events