Whilst there are many theories regarding their origins, Kayasthas are recorded in Brahmanical religious texts from as early as the 7th century, being described a distinct caste with responsibility for writing secular documents and keeping records. In some of the Sanskrit works of Kshemendra, in the "Vikramankadevacharita" of Bilhana and in Kalhana's historical chronicle known as the "Rajatarangini" ("River of Kings"), written in the early-medieval Kashmir, the term "kayastha" may have been used to denote the members of bureaucracy ranging from "Gṛhakṛtyamahattama" (the chief secretary in the charge of home affairs) to the Asvaghasa-kayastha (officer in charge of the fodder for horses), whose principal duty, besides carrying on the general administration of the state, consisted in the collection of revenue and taxes.