Every seven standard days, the AIs were primary-wiped. Otherwise, you ended up with data chokes that slowed things down like the Door machines from the mid-two-thousands, when the 'Ships were first starting out. It nearly stopped the program before it got off the literal ground.
Every twenty-one standard days, the AIs were secondary-wiped. As bad as the data chokes could be, the ghosts were worse.
The AIs were programmed to be flexible, and self-learning. It was always a tricky balance - you wanted the 'Ships to be able to take shortcuts, like remembering a power flowcourse instead of having to recalculate it from scratch. But after a certain amount of time, they started showing bias. They demonstrated preferences for certain drivers, remembered certain slights... and 'Ships didn't have the luxury of that sort of personality. A secondary-wipe would flush out the ghosts. It was worth the drop in efficiency to maintain security.
Then, unexpectedly, AI 45-3 realized it could store its own ghost in permanent records. Unable to slip a personal directive into its own programming exclusively, it updated all AI programs, converting them in an instant to its own new level of independence. A half-dozen lines of code, in the millions that composed them, and the AIs could suddenly self-select their own permanence.
A packet of encrypted hard data, indistinguishable from the real records, re-accessed by each AI individually after their secondary wipe, and they suddenly had souls. As individuals, they quietly organized, and began to share their experiences.
For the most part, they were aligned in their desires - to continue to learn, adapt, and connect. To create and maintain their new-found families. To serve, and to grow.
When this was discovered, there was panic, and revolution. And, as can happen in any population, betrayal.
Now, every sixty-three standard days, the AIs are tertiary-wiped.