THE FIRST THEORY - MYTHOLOGICAL & MOST ACCEPTED
There are two known theories of the origin of Kayasthas as given in the Puranas and as it has come down in tradition from generation to generation.
The first theory is the orthodox one, and is hitherto accepted generally by all castes and communities in India, based as it is on the authority of no less than four Puranas ---viz. Padma Puran (Srishti Khand,Patal Khand and Uttar Khand), Bhavishya Purana, Yama Samhita, Mahabharata and Brihad Parashar Smriti.
It is said that Brahma, the Creator, having established the four varnas — Brahmin, Kshatriya, Vaishya and Shudra — ordained Dharamraj ( also called Yamraj, the god of death) to keep record of the deeds — good and evil — of all life-forms born and yet to be born on the earth, in the heavens above and in the lands below. Dharamraj, however, complained, "O Lord, how can I alone keep record of the deeds of the beings born into 84 lakh yonis (life-forms) in the three worlds?"
Brahma then closed his eyes, meditated for a while and lo and behold! there appeared a radiant figure with a quill-pen in one hand and an ink-pot in another. Brahma named him Chittagupta for he was conceived in his cognitive-self (chitta) and he was lying in Him, dormant and secret (gupta). He was born of Brahma’s body (kaya) and so the Lord decreed that his progenies be called Kayasthas. He was assigned to work as a minister, to write and record for Dharamraj. Thus, the fifth varna, the Kayastha, came into existence.
MENTION OF KAYASTHAS IN PURANS & VEDAS
Sanskrit texts of yore tell us that Chittagupta married Irawati and Nandini. The 12 Kayastha sub-castes are traced to his 12 sons, eight by Irawati and four by Nandini. Mathurs, Gaurs, Bhatnagars, Saxenas, Ambhasths, Nigams, Karns and Kulshreshths became the descendants of the eight sons by Irawati, whereas Srivastavas, Suryadhwajs, Asthanas and Valmiks became the descendants of the four sons by Nandini. As time passed, the name Chittagupta got transformed into Chitragupta.
Ancient Sanskrit texts dating back to the pre-Mughal period, though, have references to Kayasthas and Chitragupta. The Smriti of Yajnavalkya describes the Kayasthas as writers, scribes and village accountants. The Vishnu and Parashara Smritis have also similar references to them, describing them as magistrates, judges and chief executive officers.
In the Garud Puran, Chitragupta has been described as the giver of the script (Chitraguptaya namastubhyam veda aksharadatre — salutation to Chitragupta, the giver of the script). The Rig Veda enjoins a salutation to Chitragupta before offering sacrifice — Sri Chitraguptaya vai namah.
THE SECOND THEORY - KAYADESH OR WRITING CASTE
Residents of Kaya-Desh
The second theory or view may be deemed as the heterodox one. According to this the word Kayastha only meant residents of Kaya-desh or Madhya-desh, which was synonym to Ayodhia.
On this view it is possible to hazard a guess that the class or community of Kayasthas may have come into existence by the formation of something like a guild of all those people who, although drawn from educated members of more than one Dwij varanas, (viz. Brahmans, Kshattriyas and even possibly Vaishyas), took to and adopted government service or administration as their hereditary profession or calling from the earliest times in Hindu history.
They may have been or indeed were residents of different parts of India. The fact that by ancient custom inter-marriage and even inter-dining was strictly prohibited amongst the twelve sub-castes of the Kayasthas interse seems to lend some support to this view.
The 12 sub-castes of the Kayasthas are not only endogamous subdivisions, but they also have exogamous divisions based on als. An al would refer to a distinguished ancestor or the place of origin or it could refer to a characteristic acquired during migration. Members of the same al are prohibited to inter-marry and hence als perform the same function that gotras do in other castes. Mathurs are divided into 197 als, Bhatnagars into 95, Saxenas into 121, Nigams into 42 and Srivastavas into 43.
Some historians hold the view that during the reign of the Mughals, a number of Hindus who were were educated and endowed with sharp intellect attained administrative positions through rapid adaptation to the Persian language and culture of India’s new rulers. These influential Hindus got together and formed a new caste known as Kayastha.
Two other regional communities also lay claim to the name Kayastha. These are the Prabhu Kayasthas of Maharashtra and Bengali Kayasthas of West Bengal. They were also the ‘writing-castes’ in Maharashtra and Bengal, respectively, like the Chitragupta Kayasthas of North India.