How to run an action each time after user input

I want to run an action each time the user enters input.

I want to use this to track if the user asks a question multiple times and to track if the bot responds with the same answer multiple times.

How do we do this?

Thanks!