All of the AI work I've done has been in C++ (in the dll, rather than in the python parts of the game). I've rewritten essentially every part of how the AI evaluates thing. Eg. which civics to use; which techs to research; which corporations to found; which buildings to construct; which cities to attack; where to settle; which plot improvements to build, and where, and when; which units should attack, and in which order; and so on.
The original AI worked alright in most cases, but its decision making was mostly arbitrary and random. I've tried to teach the AI to evaluate actual benefits that they will gain, rather than just using arbitrary values. I'll give you a few examples:
In the original AI, they were told that Emancipation became more valuable the longer the game went on. So basically what happened was that at a certain point in the game the AI would just start falling over themselves to research Democracy and adopt Emancipation as soon as possible, because they thought it was the most important thing in the world. In contrast, in K-Mod the AI now calculates how much happiness it would gain from switching to emancipation - and it calculates how much that extra happiness would actually help their civilization; and it estimates the value of inflicting unhappiness on its rivals. So the decision of when to switch civics is a whole lot more nuanced. Civs that are at 100% culture going for a cultural victory may choose to not bother with emancipation at all because they don't care about the unhappiness.
The original AI players did not aim to found corporations. They would just found them randomly if they happened to get the right great person at the right time. And when they did get the corps, they would put the headquarters in some random city, and then later on they'd switch to state property anyway... In K-Mod, the AI actively tries to get the right kind of great people for the corporations that it wants, and it found the corps in the Wall Street city when possible, and they will calculate specifically what will be gained and what will be lost by switching to state property; they won't switch if they are getting a lot of benefit from their corporations.
When choosing what a city should build next, the original AI basically had a checklist which went something along the lines of growth, production, science, gold; and it would just pick whichever building came first on the checklist (and it had some random chance to build wonders and such scattered throughout). So what tended to happen is that AI cities would always want to build an aquaduct before a library, even in small cities without any health problems. In K-Mod, there is no such checklist, instead, it tries to calculate specifically what benefit each building will bring, and how much that benefit is worth in that particular city. Also, the K-Mod AI attempts to save its national wonders and cathedrals for the cities that are best suited to them rather than just building them in the first city that feels like building them.
So... basically every part of the AI has been changed, and most changes are about using the right mathematical formulas to work out how much things are worth, rather than using arbitrary numbers.