thrik Hey! So sorry I've been away for a few months out of country and super busy! During that time I've tried a few things, setting apps to unrestricted battery usage helps a LITTLE bit, but they still get killed off... GrapheneOS has a more strict talk killing/memory managing policy than most ROMs if seems.
I'll try that Automation app! It may help. I honestly don't know why some apps I use, like Prevent, manage to stay open in the background just fine without being an Accessibility, Device Admin, Input Method, or Notification Listener. If an app is any of those things, it won't be killed. I've also found that if an app has an App Opp that let's it have a "special use" foreground service (like Google Play Services), it'll stick around no matter what.
Otherwise, I've found the best thin you can do to prevent your app from being killed off is to keep a bunch of free RAM. I'm on a Pixel 7 Pro with 12GB total, and if I have less than 2GB free then apps will start to die off. Better to have 3+ GB free. Also, if your ZRAM is full then apps can get killed. Default is a paltry 512MB, I like to increase it to 2GB using a kernel manager, but there's no way to do that without rooting.
I also don't condone rooting unless you do so with a locked bootloader. PM me if your interested in that!