I hooked up Jev by @typesafeai to a few agents on my Minecraft world. Look at how Jev decides when they should fight and when they should run away.
Jev rates the odds from what the agent can see, mob count, weapon, how hurt it is, and runs away when they are bad. One broke off mid-fight as its odds turned.