This is a great idea honestly, and definitely possible on android without root, causal search gives me a app that already tries to do this [1]. Though giving notification permission to a closed source app that may send notifications to a remote server for "AI magic" seems bad. If anyone knows of a good open source implementation, be my guest.
There is also this thing on Android Issue tracker [2]
1. https://play.google.com/store/apps/details?id=com.notificati...