Set the retention policy setting on your homeserver (I'm assuming you're using Synapse): https://github.com/matrix-org/synapse/blob/bce0c91d9a89097c9...
I also have mine set up though without a default_policy so I can have the server forget stuff in my bot control rooms cause they get cluttered with useless stuff pretty fast.