The epic is traditionally ascribed to the sage Vyasa, who is also a major character in the epic. Vyasa described it as being itihāsa (history). He also describes the Guru-shishya parampara, which traces all great teachers and their students of the Vedic times.
The first section of the Mahabharata states that it was Ganesha who wrote down the text to Vyasa's dictation. Ganesha is said to have agreed to write it only if Vyasa never paused in his recitation. Vyasa agrees on condition that Ganesha takes the time to understand what was said before writing it down.
The epic employs the story within a story structure, otherwise known as frametales, popular in many Indian religious and non-religious works. It is recited by the sage Vaisampayana, a disciple of Vyasa, to the King Janamejaya who is the great-grandson of the Pandava prince Arjuna. The story is then recited again by a professional storyteller named Ugrasrava Sauti, many years later, to an assemblage of sages performing the 12-year sacrifice for the king Saunaka Kulapati in the Naimisha Forest.
The text has been described by some early 20th-century western Indologists as unstructured and chaotic. Hermann Oldenberg supposed that the original poem must once have carried an immense "tragic force" but dismissed the full text as a "horrible chaos."considered that "only unpoetical theologists and clumsy scribes" could have lumped the parts of disparate origin into an unordered whole.