Most ancient Indian texts contain religious themes and these are known as Vedas. They are assigned to 1500-500 B.C. The Vedas are four in number. The Rig Veda mainly consists of prayers. The other three, Sama, Yajur and Atharva contain prayers, rituals, magic and mythological stories.
The Upanishads contain philosophical discussion on atma and pramatma. They are also referred to as Vedanta. The two epics, Ramayana and Mahabharata, seem to have been finally compiled by .A.D. 400.
Of the two, the Mahabharata is attributed to sage Vyasa. It originally consisted of 8800 verses and was called Jaya gita or a song dealing with victory. These later got expanded to 24,000 verses and came to be known as Bharata because it contained the stories of the descendants of one of the earliest Vedic tribes called Bharata. A further expanded version of 1,00,000 verses was named Mahabharata.
Similarly the Ramayana of Valmiki originally consisted of 6000 verses, then 12,000 verses and was finally expanded to 24,000 verses.
In the post-Vedic period (after BC 600) we have recorded a large number of ritual literature on moral values called Sutras. Grand public sacrifices to be performed by rulers are recorded in Shrautasutra while domestic rituals connected with birth, naming, sacred thread ceremony, marriage, funerals etc. are prescribed in Grihyasutras. This literature was compiled between 600-300 B.C.
The religious books of the Jainas and Buddhists refer to historical persons and incidents connected with their respective religions. The earliest Buddhist texts were written in Pali. They are called Tripitakas (three baskets) - Suttapittaka, Vinayapitaka and Abhidhammapitaka.
Of the most important non-religious Buddhist literature are the Jatakas. They contain the stories of the previous birth of the Buddha. It was believed that before he was actually born as Gautama, the Buddha passed through over 550 births. Each birth story is called a Jataka. These stories throw invaluable light on the social and economic conditions of the period between the fifth and second centuries BC
The Jaina texts were written in Prakrit and were eventually compiled in sixth century AD at Vallabhi in Gujarat. They are called Angas and contain the philosophical concepts of the Jainas.