Yeah, if you have a lot of new characters, I wouldn't want to go for either of those things. The first option has the issue of nobody remembering what happened, and also as you said, they died. If you wanna restart the whole mission that'd be okay.
Option 2 though, that's... Well, for one, there's a difference between "memory whiped" and "memory fully altered". The first one is kind of a deus-ex-machina, the other is a major deus-ex-machina that could end up feeling like a slap in the face, or at least confuse new players (who may feel kind of annoyed they failed a mission they never did) while the returning players may see it coming as soon as the first hints drop.
Why not just begin anew with new characters, who will eventually encounter and deal with the AI? It works as its own continuity for you GMing, without needing to over complicate things. The returning players will know it was a result of their previous characters' failure, while any new players will just experience it as if it were a new story unfolding. You won't have to deal with anywhere near as many hiccups in the plot.
As a much more minor example of what I'm talking about, when I GM'd 4th Edition, my players did a run where they delivered a pressurized container that, unknown to them, contained sea water, petroleum, and two shadow crabs. Now in 5th edition, in my version of Seattle, there's a gang called The Fangs, who's leader has a chemical gland that produces a powerful tetradotoxin, which he uses to supply some of his gang members with. This was the guy the brought the creatures to, so he could use his contacts to get an augment that produced what the crabs produce. The results of player action shaped how I GM.