the mahabharata recorded
How the author Vyasa compiled the epic.
To write this history Vyasa retired to a sanctified region, high in the Himalayas, and reflected deeply on how best to explain this human history to the people of the upcoming age. Rising early and cleansing his body, and then taking his seat on a simple mat of kusha grass, Vyasa remained strictly celibate, peaceful and pure in mind, and entered into a state of yoga where he linked his consciousness with the Supreme. Thus he beheld, within himself, all things.
Vyasa saw that in the beginning of universal time, when the world was covered with darkness and nothing could be seen, there arose a single cosmic seed, round and potent like an egg, yet vast and indestructable, pregnant with the bodies of all creatures. Within that seed the light of the wonderful Supreme glowed. The first creature taking birth by the power of the Supreme was the great grandsire Brahma and from him various offsprings took birth to assist the cosmic rule. From these godly beings also the royal dynasties descended on the earth and many civilizations flourished.
Vyasa could see the complete history of the cosmos and all its mysterious inner workings, which he explained in the Mahabharata, that others might learn and profit. He explained how human beings could live piously, become prosperous, satisfy their desires and at the same time make spiritual progress, setting a clear focus on all important aspects of human endeavor.
This great chronicle records the essential stories in 24'000 verses, summarizing the major events. He compiled versions for the demigods in six million verses and in three million verses, an other version with 1'500'000 verses and for the human society a version in 100'000 verses. He taught the history to his own son Shuka and to other qualified disciples.