'say that again' and generic undo

I am looking to implement two custom actions:

  • ‘say that again’ - in a spoken dialog system, it is handy to implement an intent for cases when the user does not hear the system’s response. So, I’d like to be able to access the most-recent-thing said (even better, the history of things said).
  • 'undo- - Similarly, to undo the prior command, I would need the most-recent command.

On another related note, it would also be handy to know the set of slots that got set during the most-recent command.

Any suggestions? Thanks