An Archaeologist's LifeProfessor River Song is an archaeologist from the 51st century who is already highly familiar with the Doctor when they first meet (from his perspective). She is, in fact, a future companion of his; she travels with him off and on, and he trusts her implicitly. When her team ran into trouble during an expedition to a deserted library, it was only natural that River should try to summon the Doctor by sending him a message on his psychic paper. But the Doctor who turns up, though recognizably River's Doctor, has not yet met her in his personal timeline. Though bewildered, he agrees to help River and her team.
River's expedition to the planet-sized Library was financed by Felman Lux and was chartered to find out what disaster had happened there 100 years previously that had caused 4022 people to disappear.
River and the Doctor appeared to be very familiar, even considering the strong bonds he forms with his companions. She keeps a worn and battered diary whose cover looks very much like the TARDIS doors--a journal of their travels (as a "bookmark" to counter the wibbly-wobbly timey-wimeyness, apparently). She also carries an upgraded version (in addition to the usual settings, it has "red settings" and "damper settings" wink of the Doctor's sonic screwdriver--a gift from him, she claims, even though he insists that he "doesn't give anyone" his sonic screwdrivers. (She responds, "I'm not 'anyone'!" and refuses to elaborate.)
As the situation in the Library deteriorates, River realizes she must prove to the Doctor that she is (or will become) someone he trusts completely. With profuse apologies, she whispers something into his ear... his true name. The Doctor is stunned--the name that neither the Carrionites nor the Pyrovile could discover, the name that Madame de Pompadour saw "was more than a secret", his future self will freely divulge to River Song.
River "dies" when she chooses to sacrifice herself in order to stop the Doctor from doing so himself to save Donna Noble and the other 4022 people trapped in the Library. As he looks on, unable to stop her, she reveals that he must have always known how she was going to die. She pleads with him to not try and change history, not to change one moment of what is to come for them.
After saving all the trapped people, the Doctor realizes his future self must have given her his sonic screwdriver for a reason. Inside he finds a data chip, which contains River's Data Ghost. He rushes to save her by uploading her into the Library's virtual world. CAL, the library's data core controlled by a human girl wired into its mainframe, also manages to save the Data Ghosts of all of River's dead archaeological team (taken by the piranha-like Vashta Nerada) so that she would have company in the virtual world.
Otherwise in her own personal timeline, she's out in the 51st century universe somewhere...waiting to first meet the Doctor who first met her at the end of their run.