Most likely this was already mentioned, but, just in case it wasn't, here's a story about AI's stupidity in diplomacy.
1. I've crushed nearby kingdom, capturing its all cities. Sovereign was too cowardly to face my army, and was running away at same speed as my stack, so I've left him be and returned to my territory.
2. Dozen or so turns later said kingdom asks for peace. I have no intent to go tracking that coward, so I sign the treaty.
3. While negotiating with friendly Empire, I notice they would like me to declare war on that kingdom again, for 800 pts. And sure I am doing that, trading war declaration for some very needed metal.
4. On the same turn, I contact the kingdom. Peace treaty is 150/90 pts, so I sign it again and even get some gold for it.
5. Basically, I go back to 3) and get more metal from empire. Then more gildar from kingdom. Then more metal. And so on till both empire and kingdom are out of tradeable resources.
AI definitely should keep track of past dealings and check if I break my deals. Plus it would make sense to include time restrictions in the deals, like 'declare war for x turns'.