Bean:
Girl dies. Library of everything installed on big hard drive along with her personality, so she can be happy. Real library bolted on. Unfortunately real library infected with shadow thingies.
Girl 'saves' all people in the real library to the hard drive so they will not get eated (physical bodies saved as energy waves). Girl doesn't know she is in cyberland controling security systems etc in real library. Luckily aided by Dr Moon the virus-checking software or some such.
In comes Doc et al. In Doc's future but Professor's past they have met before. In Doc's future he knows how things ended up in library so he kitted her out with special sonic screwdriver , adapted to function like kind of USB memory stick so that when she gets wiped out ( in course of giving exrta memory to hard drive to enable it to get the people out again) she can be re-uploaded friom the USB device/screwdriver to the hard drive and live happily ever after in cyberland.