Dirk Gently's Holistic Detective Agency
Douglas Adams
 Four billion years in Earth's past, a group of Salaxalans attempts to populate the earth; however, a mistake caused by their engineer – who used an Electric Monk to irrationally believe the proposed fix would work – causes their landing craft to explode, killing the Salaxalans and generating the spark of energy needed to start the process of life on Earth. The ghost of the Salaxalan engineer roams the earth waiting to undo his mistake, watching human life develop and waiting to find a soul that it can possess. The ghost finds it can only possess individuals that fundamentally want to do the same task it is trying to accomplish itself. Otherwise, it is only able to influence the individual in subtle ways. In the early 19th century, the ghost discovers Samuel Taylor Coleridge, and influences the writer to add a second section to "Kubla Khan" and alter parts of "The Rime of the Ancient Mariner" to describe how to correct the problem that destroyed the landing craft in the distant past. The ghost then begins seeking out someone whose hardship can be influenced by Coleridge's work. It later discovers that Professor Urban "Reg" Chronotis at St Cedd's possesses a time machine disguised as his quarters. In the late 20th century, during the annual St Cedd's dinner reading of "Kubla Khan", the ghost influences Reg to use the time machine to perform a bit of trickery for a young child at the dinner, while the ghost lures another Electric Monk into Reg's quarters. Upon return to the present, the ghost finds the Monk unusable for its purposes. The Monk then goes off to kill Wayforward Technologies II's CEO, Gordon Way, due to a misunderstanding. The ghost later tries to influence Richard MacDuff, a former student of Reg and current employee of Gordon Way, who was also at the Coleridge reading. Richard finds himself breaking into the apartment of Susan Way—his girlfriend and Gordon's sister— to erase an answering machine message. His actions lead the police to consider Richard a suspect in the murder of Gordon. Richard discusses this with his former college friend Dirk Gently, who claims to be a "Holistic Detective" believing in the "fundamental interconnectedness of all things". Currently on the case of a missing cat, Dirk examines Richard and finds him to have been in a hypnotic-like state, and determines that Richard was temporarily possessed. Richard recounts the events from the Coleridge reading, including Reg's trick; Dirk, after consulting with a child, concludes that the only way the trick was possible was with a time machine. The two approach Reg, who admits to this fact. Meanwhile, the ghost has found Michael Wenton-Weakes, a recently-fired editor of an arts magazine. Through subtle influences the ghost makes Michael read Coleridge's works and convinces him to kill Albert Ross, the editor who replaced him. Both now have sought to erase those that supplant them, and the ghost is able to fully possess Michael's body. The ghost, in Michael's body, arrives at Reg's quarters while Dirk and Richard are there, and demands Reg use his time machine to return back 4 billion years in the past. They travel back, and ghost-possessed Michael, using a makeshift environmental suit, sets up to repair the damage to the Salaxalan craft. While they watch, Richard receives a call from Susan from the 20th century on Reg's phone, a quirk of the time machine due to the phone company. Richard learns of Ross's murder, and Dirk quickly surmises the ghost's plan, which if successful will erase the formation of life on Earth. Realising Michael was influenced by Coleridge's works, Dirk instructs Reg to take them to the 19th century, allowing Dirk to interrupt Coleridge long enough to disrupt the ghost's possession and prevent the second part of "Kubla Khan" from ever having been written. Upon arrival back in the 20th century, Dirk, Richard, and Reg find humanity as they expect it but with very small, subtle changes. Reg also discovers his time machine no longer functions, after having the telephone company repair the phone line to his quarters. Dirk learns that the missing cat was never missing in the first place as a result of their actions, and charges the client a small amount for the finding of the lost cat, adding "saving the entire human race from extinction – no charge".