>>77699765
The Foundation books by Isaac Asimov. A good read! To make a long story short: A mathematician predicts the inevitable fall of the Galactic Empire and the dawning of a 29,000 year dark age which follows using a newly developed technique called 'psychohistory'. However, this period can be shortened to a "mere" 1,000 year interregnum through a practical application of that same technique.
Which is to say, he establishes the titular Foundation: an institute dedicated to the preservation and advancement of knowledge located in a distant region of space, a seed from which a Second Galactic Empire can eventually grow. The series then follows the development of the Foundation from academic institution to government and so on, balancing the outside pressures of a collapsing empire and post-Imperial warlords against internal pressures.. All of which was foreseen by that long-dead mathematician, of course.