I am looking for a movie I think I saw in the 90s about a robot that thought it was human and saved humanity but found that humanity was its life force and it could never meet a human being unless it died because all remaining humans were held safely inside of it. It was created for this purpose.
Yes, I think it was the Outer Limits episode, "Demon with a Glass Hand".
Trent (Robert Culp) is a man with no memory of his life before the past ten days. His left hand has been replaced by an advanced computer shaped like his missing hand and protected by some transparent material. Three fingers are missing; the computer tells him they must be reattached before it can tell Trent what is going on. Trent is being hunted by a handful of humanoid aliens called the Kyben; they have the missing appendages. The action takes place in a large rundown office building which the Kyben have sealed off from the world. In this deadly game of hide-and-seek, Trent enlists the help of Consuelo Biros (Arlene Martel), a woman who works in the building.
Eventually, Trent defeats all of his Kyben hunters by ripping off the medallion-shaped devices they wear to anchor them in the past. Trent successfully destroys the mirror and recovers the missing fingers, one by one. When the computer is whole, he learns the terrible truth: he is not a man, but a robot. The human survivors have been digitally encoded onto a gold-copper alloy wire wrapped around the solenoid in his thorax. Immune to disease, he must protect his precious cargo for 200 years after the Kyben invasion, by which time the plague will have dissipated. Then he will resurrect the human race.