According to the Hindu theology Lord Brahma, the Creator, created Lord Chitragupta out of his own body. When Lord Brahma had created all the four Varnas, he thought that there must be someone to keep records and account of each Varna - so he went into deep meditation of the Lord. When this meditation was over, he found standing in front of him a radiant human figure holding a pen and an inkpot in his hands. Thereupon Brahma said, "Thy manifestation has come about through my mind (chitta) and in secret mystical (Gupta) manner, thy name shall be Chitragupta and as thy creation has been from the whole of my body (kaya), therefore thy progeny will be called Kayastha. So ever since then reading and writing has been the hereditary occupation of the Kayasthas, the descendants of Lord Chitragupta, and in all governmental institutions the Kayasthas have held high administrative posts.
As regards the Mathur sub-caste of the Kayasthas,They were the descendants of Charu (one of the twelve sons of Lord Chitragupta) and Irawati. (It is noticeable that there are a class of Brahmins who call themselves Mathurs and trace their ancestry to Mathura. Mathura is also the birth place of Sri Lord Krishna. There are also a class of Vaishya who call themselves Mathur Vaishya and trace their ancestry to Mathura kingdom. There are also some Bengalis who are known as Mathur Babus). According to Puranic tradition, Charu took up his abode at Mathura -- and so his descendants came to be known as Mathurs.
The Mathurs ruled over Mathura till Qutab-ud-din conquered it. The Mathurs are also said to have ruled Ayodhya. Later on, their descendants accepted posts of Dewan of the same area under the Surya Vanshi family. The downfall of Ayodhya commenced during the Dewanship of Bal Pratain Mathur, who took reins of the kingdom in his own hands. His rule stretched through ten generations, after which the reins passed to Maharaja Daleep. The kings who followed included Raghu, Dashrata and Rama. The Mathurs are subdivided into als and gotras. People belonging to the same al claim to have descended from the same immediate ancestor and share a common totem. Gotra is a larger group being composed of a number of al.
According to tradition, there were only eighty-four big villages in Brij Bhoomi, the empire of Mathura. It is probably on that account that there are eighty-four further sub-sects called Als of the Mathurs. The geneaologies of quite a large number of Mathur families are given in this history. What is noticeable in the accounts of these families is that several of them had come either from Mathura direct or from Delhi and nearly all of them belonged to the administrative services of the then rulers and held offices such as Diwans, Ministers, Secretaries, or Kanungoes, etc. -- receiving shares of the profits of land. That the 84 Allas or sub-sections acquired their names after those of the villages or mauzas of their origin seems probable enough -- Sahariyas were so named because their original residence was a village -- Sahar -- Which was not very far from Mathura; Golghotia -- Alla is most probably derived by metathesis from Gokalotia i.e., residents of Gokal -- Narnolias from Narnole, Mahabani from Mahaban, Bhiwanis from Bhiwani, etc.