It seems that historians generally agree that India did not have any historical tradition until the arrival of Islam when Arabic and Persian scholars such as Hasan Nizami and Minhaj-i-Siraj began migrating to India and the country adopted the practices and conventions developed elsewhere.
Before that we mainly have texts such as the Vedas, the Ramayana, the Mahabharata and the Puranas which do contain some historical information but are fully enveloped in myths and imagination.
So how can it be that a civilization that excelled in so many other areas simply didn't develop its own tradition of history writing. Nor did it adopt it sooner from the Greeks or the Chinese who had made contact with it since the ancient era.
To say that there was no Indian tradition of recording history before the advent of Islam would be incorrect. However, it is true that ancient Indian literature is quite often than not a complex tapestry of religious scriptures and genealogies, of hymns to gods and nature along with the political history of ancient kings and dynasties. This means that, the job of historians becomes increasingly more difficult, since they have to translate these texts, rationalise the time lines in these texts which are often fantastical and correlate these threads with the latest in archaeological evidence to establish facts about history, about contemporary material culture and about society etc.
For ancient India we have various literary sources that provide us with either a vague or partial idea of the contemporary period.
VEDIC PERIOD
For the Early Vedic Period, which is taken as c.1500BCE to 1000BCE, we have early Vedic literature while the Later Vedic Period taken as c.1000BCE to 500BCE, we have later Vedic literature. Each of the 4 Vedas is divided into 4 parts, being the Samhita, the Brahmana (not to be confused with the caste), the Aranyaka and the Upanishads
The Samhita are collections of hymns organised in books. The Rig Veda Samhita alone contains 1,028 hymns or suktas organised into 10 books. The Brahmans contain prose explanations for these hymns. The Aranyaka contains interpretations of sacrificial rituals in a symbolic or philosophical manner while the 108 Upanishads contain a galaxy or philosophical ideas about the soul, the universe, the Supreme reality etc etc.
Now, among the 10 books of the Rig Veda, Books 2 to Book 7 are considered the oldest, and hence form the Early Vedic Literature, while the rest of the Books of the Rig Veda Samhita and all other Vedic literature is considered Later Vedic literature.
In Books 3 and 7 on particular we find several references to geography and mention of historical events that give an incredibly vague idea about the period, and where the Indo-Aryans might have been when these texts were composed.
EPICS AND PURANAS (c. 700 BCE TO 600 CE)
EPICS :
The two epics, Ramayan and Mahabharat, describe fantastical stories of wars and heroes, that archaeological evidence does not corroborate. However what we can use these texts for is to establish the nature of society and culture in the period being described by these two texts and the material culture of the period. Both texts were clearly aware of each other, given the fact that both make references to and make use of one another's characters and locations. The Mahabharat took place in the Indo-Gangetic Divide and the Upper Ganga Valley while in case of the Ramayana the center of political attention shifts quite clearly to the middle Ganga Valley around the city of Ayodhya. Yet, both emerged out of the same cultural millieu and especially nearing the later parts of their composition, their authors are clearly aware of each other.
Excavations in these sites indicate the existence of settlements here from the Northern Black Polished Ware (NBWP) culture, going back at their earliest to the 7th century BCE. However based on the more subordinated nature of women in the Ramayana while the opposite being the case in the Mahabharat, some historians argue that the latter might be older than the former. Hence, also representing the changing political centres of the Vedic/Indo-Aryan society as they migrated further in land.
The epics do provide us with evidence and historical information that is corroborated with archaeological evidence. For example, the growning complexity of rituals and warfare, as well as of material culture. The usage of more advanced weaponry and perhaps a more prevalent usage of chariots as compared to the early Vedic period.
PURANAS :
There are a total of 18 Mahapuranas (Great Puranas) and a plethora of Upapuranas. According to tradition, they were composed by one man, the Rishi Vyasa, however, it's clear that they were not written by any single individual or in one era. The Puranas usually discuss 5 topics, sometimes more and sometimes less. These being : Creation of the world, re-creation, the periods of 5 Manus, the genealogies of gods and rishis, and accounts of royal dynasties. The time lines provided in the Puranas is truly mind boggling. They do have useful accounts of contemporary geography.
Also, the discernible genealogical and political accounts do provide useful information about dynasties such as the Nandas, the Mauryans, the Shungas, the Kanvas, the Satavahanas etc. These lists end with the Guptas and indicates that the Puranas were compiled around this time.
There's also a plethora of regional and non-Brahminical literature from this period, namely Buddhist and Jain literature. This sort of literature gives us an idea of the non-Brahminical view of society, essentially, society viewed from outside of the mainstream. While a lot of these canon works are biographies sometimes semi mythical or mythical, of their lineage of saints or are records of the teaching of the Buddha and Mahavira, they do provide an idea of contemporary philosophical debates in the period, of attitude and opinion towards social structures.
OTHER TEXTS
There's a Sanskrit text Krishi-Parashara, a work on agriculture composed between the 6th to 11th centuries.
Early Medieval Indian kings patronised poets and writers who wrote the biographies and genealogical accounts of their patrons and their dynasties. Such works include
Banabhatta's Harshacharita, about the king Harshavardhan who in the 7th century established a vast empire in North India.
Vakpati wrote the Gaudavaha about the King of Kannauj, Yashovarman (c. 8th century CE), who was the most powerful king in North India during his period
In c. 1184 CE, Kalhana, most probably a Kashmiri Brahmin, wrote the Rajatarangini, a semi-legendary historical account of the genealogy of ancient to contemporary Kashmiri kings as well as the political history of the Northern western part fo the subcontinent.
Bilhana wrote the Vikramankadevacharita (12th century CE) about the Chalukya Kings, especially Vikramaditya VI.
CONCLUSION
Ancient Indian texts are rich sources of history and indeed since around the Gupta Era genealogy and political history of ancient kings was compiled and recorded. Histories and biographies of early medieval kings were recorded by court historians before the advent of Islam and the pre-Gupta texts, however vague and often unreliable, provide information regarding not always the political, but certainly the cultural, social and material history of the ancient period.
Sources :
"India's Ancient Past" by RS Sharma
"A History of Ancient and Early Medieval India" by Upinder Singh
" History and Culture of the Indian People" by RC Majumdar, Vol 1, 2 and 3