The AI doesn't need to be quite that advanced. Just the next step up from IR guidance, so that it won't be fooled by flares and stays locked on the target. It's useful if it can at least avoid the ship that launched the missile, possibly other (preprogrammed) allied ships as well.
That's certainly part of the solution, though there's more.
Technically it's the sensors that flares fool, not the logic. A military official revealed 15 years ago that American missiles, for example, target the cockpit. It's a war crime to target a pilot who has ejected while they're still floating down... and pilots take longer to train than building a new aircraft. But before they eject? I digress.
My point is that we already use AI to steer the missile IRL, but even then it's not guaranteed. If the logic is given bad input data—burned out sensors or the entire thermal picture being overwhelmed long enough to lose tracking—AI won't be able to make up for it.
I imagine the fact they're heat seekers also prevent too many additions since they'd be carrying a fluid that takes the heat away from the sensor (and have enough to spray it off as a mist in space).
AI for sure improves missiles, it's just not the full solution. Newer flare technology would also make things more difficult.
There's also the fact space pirates almost never have good equipment.