Doctor Moon

The Doctor Moon, who, in his human avatar, was often known as simply Doctor Moon, was an artificially-intelligent moon that maintained the computer systems on the planet it orbited through wireless connection. Though he real form was a man-made satellite, he could exhibit ge own unique personality and identity in the virtual world.

History
The Doctor Moon was built by Felman Lux, Strackman Lux's grandfather, to protect CAL, his youngest daughter who became the Library's computer and was given an imaginary world in which to play while in control of the Library. He was a virus checker designed to monitor CAL's systems and her spiritual well-being. He continued to perform these functions during the Vashta Nerada crisis. His presence stopped the Tenth Doctor's sonic screwdriver working when nightfall arrived and his physical body came in range.

In Charlotte's virtual world, Doctor Moon manifested himself as a human doctor, who was charged with checking up on her health at frequent intervals. He advised her to save the others in the Library until she overloaded and switched him off. When the Doctor saved River Song into CAL's imaginary world, the Doctor Moon was back online, protecting the repaired CAL, River and the rest of the team, except for Strackman Lux, who survived the events. As River and her team reunited, Doctor Moon exchanged a smile with CAL. (TV: Forest of the Dead)

Function
In the virtual world he could control people's memories, including CAL's, using the simple sentence "And then..." followed by whatever command he wished, from forgetting something to remembering something. (TV: Silence in the Library/Forest of the Dead)

Behind the scenes
The Doctor Moon was played by actor Colin Salmon in Silence in the Library and Forest of the Dead.

At the time of production, Moffat privately intended Doctor Moon to be a future Doctor. In a 2008 email to Russell T Davies, Moffat explained that River Song was in fact the Doctor's widow, and had witnessed the death of the 45th Doctor on a battlefield, before she began having adventures with his younger selves. Although Moffat considered it unlikely that this would ever be confirmed in a story, he thought River would ultimately learn that her dying husband had uploaded his consciousness to the library planet's moon so that he could be reunited with her. In 2020, Moffat said that he thought a version of this idea could still work, and Davies revealed that he had always thought "it's him, it's the Doctor, and no one knows!" when watching the episodes. (REF: Showrunner Showdown) However, for all that it was endorsed by the two major creative forces behind Doctor Moon's creation, this information is not considered independently valid by this Wiki, due to having only been related in a real-world-focused piece rather than any narrative (or indeed in-universe) material.