The Tenth Doctor, River, Strackman Lux, and the remainder of their team flee the microscopic Vashta Nerada across a planet-sized Library. In the aftermath, some teammates are consumed by the swarms, and their space suits seem to move on their own, animated by the pests. During a brief respite, Lux reveals a deeper history: the Library, and a colossal computer at its core, was built by his grandfather for Lux’s aunt, Charlotte, who faced a terminal illness at a young age. The purpose was to let her mind linger among the collected works of humankind. The Doctor realizes Charlotte’s mind is still struggling after he and his companions saved thousands of patrons a century ago by transferring their physical forms into the computer core when the Vashta Nerada attacked.
Within a simulation that mirrors a contemporary Earth village, Donna is cared for by Dr Moon, an avatar of the virus-checking program, and is introduced to Lee, whom she later marries. As the scene shifts and time seems to skip, Donna senses something off and is warned by Miss Evangelista—one of River’s team members who had fallen to the Vashta Nerada—that she is inside a simulation.
In the heart of the core, the Doctor learns from the Vashta Nerada that their forests were used to forge the books of the Library, a fact that lets the creatures claim ownership of the vast repository. They grant the Doctor one day to free everyone trapped inside the computer core; after that window closes, the Library will belong entirely to them. With resolve, the Doctor prepares to hook himself to the terminal to provide the extra memory needed to download all the trapped minds, a plan that would almost certainly prove fatal for him. River interrupts this act, knocking him out and taking his place, arguing that his death now would prevent their eventual meeting in her own timeline due to their mismatched histories.
When the patrons within the core rematerialize on the Library’s surface, they teleport to safety. Lee is unable to call out to Donna as he departs. As the Doctor and Donna leave behind River’s diary and sonic screwdriver, the Doctor discovers a data recorder inside the mechanism that has preserved River’s thought pattern. He saves this pattern to the core, ensuring River’s consciousness endures. River awakens inside the Earth simulation to find Charlotte and many of River’s fallen teammates waiting, their memories revived by the simulation. Charlotte reassures River that the simulation is now a “good place” where she will be safe, sealing a bittersweet resolution to a قصة that blends memory, sacrifice, and the delicate balance between creation and preservation.