The Harivamsha (also Harivamsa; Sanskrit: Harivaṃśa हरिवंश, the lineage of Hari (Vishnu)) is an important work of Sanskrit literature, containing 16, 374 shloka, mostly in Anustubh metre. The text is also known as the Harivamsha Purana. This text is believed to be a khila (appendix or supplement) to the Mahabharata and is traditionally ascribed to Veda Vyasa. The most celebrated commentary of the Mahabharata by Neelakantha Chaturdhara, the Bharata Bhava Deepa also covers the Harivamsha. According to Adi Parva, the Harivamsha is divided into two parvas or books and had 12, 000 verses. The manuscripts found in the 19th century in different parts of India included three portions known as parvas - the Adi Parva, the Vishnu Parva and the Bhavishya Parva. These are included with the eighteen parvas of the Mahabharata.
The Adi Parva of Harivamsa describes the creation of the cosmos and the legendary history of the kings of the Solar and Lunar dynasties leading up to the birth of Krishna. Vishnu Parva recounts the history of Krishna up to the events prior to the Mahabharata. Bhavishya Parva, the third book, includes two alternate creation theories, hymns to Shiva and Vishnu and provides a description of Kaliyuga. While the Harivamsha has been regarded as an important source of information on the origin of Vishnu's incarnation Krishna, there has been speculation as to whether this text was derived from an earlier text and what its relationship is to the Brahma Purana, another text that deals with the origins of Krishna.
The bulk of the text is derived from two traditions, the pañcalakṣaṇa tradition, that is, the five marks of the Purana corpus one of which is vaṃśa genealogy and stories about the life of Krishna as a herdsman.