The AI currently does very illogical moves and I know AI is hard to teach stuff so I wanted to give you an idea. I have seen the enemy lord trying to slowly walk over to my army with his horse while leaving his army behind many times. It is the most illogical thing for a lord to leave his army to go in alone. And he is not charging either! He is just coming slowly over to us with his horse (which is faster than the infantry) as if he is in a movie coming to talk with the lord of the opposing army before the battle starts. Even if there was something like that in the game, it would make no sense for a lord to approach the enemy army without any supporting troops. This is obviously just one example but overall, and this especially the case for the generals/lords, the ai could try "not to die". That would be way more realistic. If sticking to the formation makes a soldier more likely not to die, maybe that soldier wouldn't just break formation like a weirdo. Even if the enemy lord charged with other knights to accompany him, he would probably retreat very quickly afterwards not to get stuck in the middle of the enemy ranks. Also, in most circumstances; the army, being composed of mostly peasants, would immediately desert if the lord died. This could be implemented to the game so that the player also doesn't run in like a fool and would be forced to make sure he is not going to die if he decides to run in like a fool anyway. The deserting when the lord part could be an optional thing for players who don't want to deal with the complexity.
Sorry for the non-organized way in which I wrote this. I am not the best at writing good-looking posts.