Written by Isaac Asimov as an introduction to the original Foundation series and placed as the first part of the first book.
The first story is set on Trantor, the capital planet of the 12,000-year-old Galactic Empire. Whilst the empire gives the appearance of stability, beneath this facade it is suffering a slow decay. Hari Seldon, a mathematician, has developed psychohistory which equates all possibilities in large societies to mathematics, allowing predictable long term outcomes.
Seldon discovers a horrifying truth to the Empire's decay, but his results are considered treasonable and attract attention from the Commission of Public Safety - the effective rulers of the Empire. This leads to his arrest. A young mathematician Gaal Dornick, who has just arrived on Trantor, is also arrested. On trial, Seldon shares the discoveries made through psychohistory, such as the collapse of the Empire within 500 years, followed by a 30,000-year period of barbarism.
Seldon proposes an alternative to this future; one that would not avert the collapse but shorten the interregnum period to a mere 1000 years. But this plan would require a large group of people to develop a compendium of all human knowledge, titled the Encyclopedia Galactica.
A still skeptical commission, worried of making Seldon a martyr, offer him the choice of execution for treason or acceptance of exile with his group of 'Encyclopedists' to a remote planet Terminus. There, they will carry out the Plan under an imperial decree, while Seldon would remain, barred from returning to Trantor.