The Tenth Doctor and Donna land on a planet-sized library in the 51st century simply called the Library. The Doctor has been summoned there, but a scan for life shows the Doctor and Donna as the only humanoid life signs but trillions of nonhuman life forms they cannot see or hear are present. An information node tells the Doctor and Donna that the library sealed itself, but that it has been breached and others are coming.
Just then, a team of explorers led by archaeologist River Song (who sent the message) and financed by Strackman Lux, whose grandfather originally built the Library, arrives. The team has come to determine why the library sealed itself 100 years previously. River acts like she knows the Doctor and has a diary with a cover decorated like the TARDIS with her. She discovers the Doctor has not met her yet.
The Library’s operation system appears to be connected to the mind of a young girl living on 21st-century Earth. When the Doctor attempts to access the library computers, the girl causes books to fly from the shelves. The events happening in the library appear to her as television shows. The girl’s psychiatrist Dr. Moon tells her that the library in her imagination is actually real and that her real world is a lie. He implores her to save the people who have arrived at the library.
Lux’s secretary Miss Evangelista is attacked by Vashta Nerada which strip her flesh clean to the bone instantly. The Doctor and Donna learn that the team are wearing communication devices which can store their thought patterns even after death, and are disturbed to hear Miss Evangelista still talking but acting confused until her pattern degrades. The Doctor explains that the Vashta Nerada are creatures that appear as shadows to hunt but are usually not as aggressive.
After noticing the pilot Proper Dave has two shadows, the Doctor and River seal him in his space suit, with the Doctor discovering River has a sonic screwdriver. The Vashta Nerada still get in, stripping Dave to his bare skeleton. The creatures animate Dave’s suit and chase after the others. The Doctor attempts to teleport Donna back to the TARDIS for her safety, but Donna fails to materialise properly. The Doctor finds an information node with Donna’s face on it which tells him that Donna has left the library and been saved.