Anyway, isn't there an AI made by someone else out there on the internet that has been tested before? Might save you a lot of work if you implement one of those.
There are AI algorithms to do specific tasks like moving troops, but the KaM world is so specific that there is pretty much no generic AI that could function in it. Imagine taking the AI from say Age of Empires and putting it in KaM. It wouldn't understand about roads, food, weapons, etc. etc. Each game is unique so the AIs need to be written uniquely.
I mean, why would any generic AI on the internet be able to cope with KaM's road system?
Some modern AIs use a sort of "evolution" process to develop them, by running lots of simulations using different random parameters (e.g. building 5 stonemasons at the start or 3 stonemasons) and taking the best results (e.g. most resources, most soldiers after 1 hour) and then mixing (breeding) those algorithms together and repeating. After lots of generations apparently it gives good results, by selecting only the effective solutions. You can then end up with a set of parameters that you know are effective for certain situations, e.g. the simulation might tell you that in order to make the most troops it is best to build 4 stonemasons as soon as possible.
This is all quite a lot of work to set up and it still requires an AI framework, with some parameters to be tweaked. (which we don't have, the AI can only make a simple village at the moment) This is just what I've read about so I don't know if I've got all the facts right, but it sounds like it could work well. There's still a lot of work to go before we get near that stage.