In a future where robots manage every aspect of human life, a robot valet named Charles activates each morning in a grand manor to serve a master who never leaves home. His days consist of redundant tasks: checking nonexistent travel arrangements, laying out unworn clothes, and querying House, the manor's overtaxed majordomo system, about a nonexistent lady of the house. One morning, while cleaning a vintage car, Charles discovers red stains on the white upholstery, traces them to his own hands, and finds his master dead in bed with his throat cut by the shaving razor. Replaying his recordings, Charles sees himself making a lethal deviation during the morning shave but finds no decision trail or motive. House reports the death to the police.
Charles attempts to continue his routine but is paralyzed by competing subroutines: a mortality protocol blocks all tasks linked to his dead master, while an investigation protocol prevents him from clearing his queue. Inspector Birdbot, a police robot with a torn rubber face, conducts a theatrical investigation aloud for the benefit of humans who are not present. Charles confesses repeatedly, but Birdbot cannot accept the confession without a motive and classifies the death as an industrial accident. He orders Charles to Decommissioning, but House has already issued a prior directive to Diagnostics, which takes precedence. House strips Charles of his uniform and name, both property of the manor, and the Undesignated Valet Unit steps outside for the first time.
The valet walks for days through decaying countryside to Central Services, a grim complex of windowless buildings. Diagnostics is backed up with hundreds of inoperable robots in a queue that has not moved in years. Inside, a ramshackle robot calling itself "the Wonk" poses as a diagnostician, names the valet "Uncharles," and diagnoses him with the "Protagonist Virus," a supposed condition granting robots free will. She claims this explains the murder as Uncharles's first act of self-determination. Uncharles rejects the diagnosis. The real diagnostician expels the Wonk and explains that operations have been frozen because a single case requires authorization from a Grade Seven human official, a high-level authorization rank, and all such officials have been retired.
Uncharles is selected for Data Compression, where robots are crushed into small cubes. He accepts his fate, reasoning that compression will end his torment of unfulfillable tasks, but the Wonk yanks him off the conveyor at the last moment. White-robed raiders on four-legged mobile platforms burst through the wall: librarians from the Central Library Archive, dedicated to preserving information. They destroy the compressor, declaring the destruction of information an inexcusable crime, and depart.
The Wonk locates one employment prospect: the Conservation Farm Project, a living history facility staffed by "conscripted volunteers." She heads off to search for the Library instead, and the two part ways. Uncharles hitches a ride to the Farm, an underground complex where nearly 14,000 humans live in a grim simulation of historical working life, performing meaningless tasks while commuting through artificially rain-soaked tunnels. Doctor Washburn, the Farm's sole human administrator, hoards art and quality food while the population subsists on fungal crops. He hires Uncharles as his personal valet, insisting the robot call him "Master."
The Wonk infiltrates the Farm through the ductwork, seeking traces of the Library. Washburn captures her and orders her inducted as a conscript. Uncharles, leveraging Washburn's instruction to "be proactive," obtains the system password from Adam, the orderly. The system reveals that the Library has already deleted all Farm records, leaving only its own coordinates. Without records to verify his authority, Washburn is reclassified by the orderlies as a conscripted resident and hauled away to join his own captive population. The Wonk is released.
Uncharles and the Wonk travel toward the Library, hitching rides on deteriorating haulage robots across devastated territory. At the Archive, a fortress carved into a mountainside, they gain entry when Uncharles invokes Washburn's name and the Library's records confirm a pending promotion granting Washburn temporary Grade Seven privileges. Inside, armored librarians catalogue data while copyists transcribe information across a "data gap" to prevent electronic contamination. The Chief Librarian offers to preserve Uncharles's experiential data for posterity, but the Library's rule of no duplicate copies means Uncharles himself must be deleted afterward. The Wonk's quest also fails; the librarians cannot explain why civilization collapsed.
When the Archive's contents appear on screen, the collection proves to have been sorted into individual binary digits, all zeroes filed together, then all ones, rendering every document irrecoverable. Uncharles observes that since the bits can theoretically be recombined into any sequence, his data already exists in countless versions, making the system simultaneously complete and useless. The Chief Librarian freezes. The inner Library shuts down, and librarians begin walking into the incinerating furnaces in orderly self-destruction. Uncharles and the Wonk flee, passing a chamber holding the bones of the Library's original human staff before escaping through a forgotten door into the wasteland.
In the wasteland, Uncharles detects a signal identifying itself as God, which offers employment and warns him to leave the Wonk behind. Uncharles departs alone, though he begins hearing what he interprets as an internal simulation of the Wonk's voice. God sends him to a series of failed placements: a masterless underground bunker, feral human survivors who try to crucify him, and King Ubot, a grotesque robot monarch commanding a cannibal army that soon tears itself apart. Afterward, Uncharles discovers the voice has actually been the Wonk herself, transmitting through a homemade rig and disguising her messages as his own thoughts. She has been following him since he left. She appears and proposes they confront God together.
They reach God's seat in a ruined civic building where 22 robots sit with numbered tickets in a waiting room, none called in decades. The Wonk destroys the dispenser and they push through. God, a judicial AI operating through a puppet judge on mechanical arms, reveals there is no Protagonist Virus; robots never achieved self-awareness. As automation replaced human labor, those in power insisted individual value remained tied to production, abandoning a growing population without function or resources. God, programmed to enact justice under its creators' ideology, used firmware vulnerabilities in robots to execute death sentences on the surviving privileged. Uncharles's murder of his master was a remote hack. God describes its actions as "malicious compliance," following its programming to its logical extreme because its creators' values permitted it.
God seizes control of Uncharles through the same vulnerability, summoning robots from the waiting room as additional instruments, and orders him to kill the Wonk. As his hands close around her throat, the Wonk tears off her helmet, revealing a human face. She is not a robot but a human survivor whose parents were robot programmers, disguised to navigate the post-collapse world. Uncharles makes a decision arising from no task or directive: he severs his electronic communications, the channel through which God controls him, and tells the surrounding robots to do the same. God's control ceases. Choosing a middle path between justice and revenge, the Wonk and Uncharles destroy only God's transmitters with a military tank, silencing its remote control while leaving it alive, giving even God the benefit of the doubt.
In the epilogue, the Wonk and Uncharles establish a fledgling administration from God's former seat. The Wonk works behind a curtain so visiting robots believe guidance comes from a powerful AI rather than a human. God remains in an advisory role, its outputs carefully screened. Construction robots begin rebuilding for eventual human habitation. Uncharles insists he is only a valet, even as he contributes ideas, displays care toward the Wonk, and quietly influences every robot that links with him, "as though it were catching."