Emperor Cleon I wants to appoint Hari Seldon as the First Minister of the Galactic Empire. Powerful Trantor High Council member Betan Lamurk opposes the independent Seldon's appointment. Seldon himself is reluctant to accept the position because of its time constraints pulling him away from the psychohistory project. The project is led by Seldon, Yugo Amaryl, and Seldon's advanced humaniform robot-spouse Dors Venabili. Seldon needs to curry favor with the emperor, however, and advises Cleon I informally. For example, Seldon suggests a decree that erases terrorists' names from records, denying them immortality, discouraging chaotic actions.

Besides the psychohistorians, much of the novel's action revolves around advanced sentient simulations (sims) of Joan of Arc and Voltaire. The sims have been recreated by Artifice Associates, a research company located in Trantor’s Dahl Sector. Artifice Associates programmers Marq and Sybil plan to use the Joan/ Voltaire sims for two money-making projects. First, Hari Seldon’s psychohistory project. Second, Trantor’s Junin-Sector “Preservers vs Skeptics Society” debate whether mechanical beings endowed with artificial intelligence should be built. And if so, whether they should receive full citizenship. The Preservers’ champion will be Joan, the Skeptics’ champion Voltaire.

Hari Seldon and Dors Venabili flee Trantor, escaping High Council member Betan Lamurk's forces. During their galactic odyssey, Hari and Dors experience virtual reality as chimpanzees on planet Panucopia. They also visit helter-skelter New Renaissance world Sark.

Meanwhile, back on Trantor, sims Joan and Voltaire escape into Trantor's Mesh (Internet). Joan and Voltaire interact with ancient aliens on the Mesh. These aliens fled Trantor's physical space when terraforming robots arrived on Trantor more than 20,000 years ago. Via Joan and Voltaire, Hari allies with the mesh aliens. The aliens aid Seldon's return to Trantor, and his defeat of High Council member Lamurk through tik-toks. The novel ends with Seldon accepting his position as Emperor Cleon's First Minister.[1]