First, let's divide autobuy and autoequipment sustems. If you bought some item irl, it doesn't mean that you desperately need it right now, and it doesn't even mean that you will use it at all.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1) Items with permanent type are ignored completely by both systems. And only when MC tells the girl (with high disposition/love) to use it, it will be used.
2) Restore items. When something is wrong (low health, bad status), they have the highest priority. AE system uses them on spot, AB system looks for them and buys if has enough gold.
3) Food, basically weak and cheap restore items when health/mp/whatever is not too low and/or potions are not available. Girls should avoid to use too many food because of food poisoning.
4) Upgrade items are not necessary. They might have an advanced algorithm for AB/AE systems, but they also might as well be almost random, because there will be dozens of new upgrade items in the future when I'll expand items system, so it probably not worth it. I could add something like goodoccupation/badoccupation to them if you want. It probably will simplify the situation.
----------------------------------------------------------------------------------------------------------------------------------------------
Misc items can be restore, upgrade and permanent types as well. Nothing new here for AB, as for AE, it probably should change the equipped item depending on circumstances. Again, I could add goodoccupation/badoccupation here.
----------------------------------------------------------------------------------------------------------------------------------------------
Weapons can be small and normal. Like in wm, whores, servicegirls, strippers cannot use normal ones without penalties to performance. They also have types (like rod, bow or scythe) that mostly should be used for BE. But we also can add something like favorite weapon type to girls data files, it will make sense in many cases.
----------------------------------------------------------------------------------------------------------------------------------------------
Rings and amulets do not have types. All other items have 3 types: armor, dress and other. Obviously, armor is useful if a girl wants protection (warriors, also normal girls if security is vey low for a long time), dress is for nonwarrior occupations, other is something that player should buy and equip manually.
----------------------------------------------------------------------------------------------------------------------------------------------
Now, how I see AB system. Let's not make it too smart first of all, because irl people are not that smart either.
Except for restore items, it should be heavily based on rng. First, a girl randomly chooses a slot. Then depending on rng, available gold, badness and good/bad traits, she randomly buys an item. That being said, if she already has some item in her inventory, then the chance to buy it again is four times less, but it still exists.
Girls also should not buy items too often. Maybe once per week or once per 500 gold income.
----------------------------------------------------------------------------------------------------------------------------------------------
How I see AE system.
1) Warriors prefer armor, others prefer dress, even if they bought something else. Unless MC tells them to wear something else.
2) Restore and permanent items I already mentioned. Upgrades should be mostly random as well, because there are too many various cases.
3) Eqchance is the priority here. Better items have both higher price and higher eqchance.
----------------------------------------------------------------------------------------------------------------------------------------------
That's it. I can't really code this instead of you, so choose what you like. In my opinion, this is the best compromise between 100% random like in wm and advanced AI algorithms.