Sexy records what happens within her when she thinks it's important, often when her thief doesn't have a clue that she's doing it. He might need or want it in the future, to remember, and she wants to hold onto that for him.
He's dreadfully and painfully grateful for it, years later when River no longer knows who he is. He has lost his beloved wife in most ways, now, but he can still hear her if he asks. See her, even, sometimes. On the very rarest of occasions, he even manages to run into the real River, carelessly crossing her own timestream somewhere, and can spend one more segment of his disjointed life with the truest companion he's ever had and will ever have.
Sometimes – sometimes – the TARDIS lets him hear River's voice from years ago, when he's on the edge of sleep, softly reminding him that no matter what, she will always love him, always did in a way from the first time they met, and wherever she is, will never stop; just as he never plans to stop searching for a way to bring her back to life outside the Library. Life within a construct like that can hardly be life at all for someone as adventurous and eternally vivacious as his lovely River Song.
He visits her there, when he can stand it, but he feels so guilty knowing what that half-life must be like for her that he puts more into trying to get her out, before she wants to do it by dying, than into trying to visit her in it. He's so afraid she will feel that, someday; that she'll ask Charlotte to kill her and he will lose her for the final time not ever knowing when it happens.
For now, Sexy brings back the sounds of the other love of his long, long life, to comfort him and ease him into sleep. He hasn't forgotten that Sexy loved River too, in her way. He's glad, or she might not have recorded so much of their life together.
And somehow, even though it hurts to wake up and know that she's not really there, it still helps, for a while, to feel like she is.
Beta-read by Opal. Doctor in question is vaguely Eleven/Twelve. Futurefic for the show's timeline, past-fic for River's.