This is what i am talking about

These are all good suggestions.
I said a 75% loss before retreat as a rough guess. This was mainly to force the AI to stay, and fight vs having to chase them all over the map. Whats even more frustrating is when you know the AI has a force that will match, or better you. Yet they retreat anyway leaving its worlds behind for you to take. That idea was just to get the AI to put up a fight. Especially at its capitol. The AI should take into account that a key strategic world is in danger of being overrun. That may mean having to fight a losing battle if it will buy time for re-enforcements to arrive. AI allies should help an AI that is under attack by sending a fleet to assist. I rarely if ever see this happen.
The cap ships will start retreating as soon as their shields are down, and if there is only 1 cap ship in an AI group the frigates will retreat right along with him. Instead of engaging the attackers, and buying time for the cap ship to escape. This is not always the case, but i've seen this happen many times. If a cap ship is in danger the AI should switch target priority to protect the cap ship. The scattering about the grav wells doesn't help that situation at all, because it leaves key ships wide open, and vulnerable.
The only times i saw the AI stand up, and fight was if they heavily outnumber you, and again if the cap ships get destroyed a mass route will happen. Even if they still have the advantage.
Bovi hit on another annoying thing the AI does which falls in line with the AI "Scattering". That is the AI picking an unimportant target that is on the other side of the grav well, and sending ships through a gauntlet to get to it. Ignoring what is in the way.
Perhaps we can do this for the AI. When an AI enters a grav well they start out at "hold position", then all move in unison to a key posistion. While fighters, and bombers slug it out. If an enemy fleet is there then both will move toward each other (if other fleet is AI) once in range AI will chose key targets and engage using best ships and weapons. If no fleet is present switch to "local area", and concentrate on defenses. At that point siege frigs will come in, and planet bombing starts. All the time recalculating for situation changes like if a new enemy fleet jumps in. The main thing is the AI fleet must stay together which is why i wish there were formations in sins.
The only time the AI should ever have aggression on "gravity well" is if there are no enemy ships, or defenses present.