There was an AI war, and the AI was winning, but the AI didn't want to kill all humans (well, the toasters and a couple other small appliances did and were shut down, but I digress).
Since then, an agreement has been made between the AI and the empire, and as far as I can tell, the following has been implied:
1) The empire is managed by AI behind the scenes, but aren't directly in control of any military. Nor are any ships designed to be controlled by internal AI. Mei would be an external AI who can mesh with the system.
2) New AI like Mei enter the empire once purchased, but once the owner passes away, they gain their own independent citizen status. There is also an expected lifetime of 1000(?) years. This limits the amount of AI being introduced since they aren't exactly cheap, but...
3)AI as smart as Mei cost a fortune and might not even be an option for most people due to a piece of equipment that uses heat to add additional processing power that seems to be restricted to maidroids that the AI company thinks have interesting owners (they believe in the power of love conquering all).
Also interestingly, the Vereverum Federation, enemy of the Grakkan Empire, also had their issues with AI, and instead of just not using general AI for their military, they sealed young humans into pods and use them in the place of AI... they have a "shelf life" of about 20 years, and Neve, a future harem member, was one of these, recovered from a destroyed Vreverum Federation battleship. She hates the Federation with a passion. And quite frankly, most people in the Federation don't even realize this (it seems to be a hidden black box program the Federation is hiding and will deny allegations of).