Lord Chitragupta is supposed/ believed to maintain the record of PAP and PUNYA (Good and Bad work) of everyone who takes birth in this universe. The origin of Chitragupta Maharaj is believed to happen from the body of BRAHMA who is given power to write the details of PAP and PUNYA.
KAYASTHA are supposed to be the progeny of Lord Chitragupta. That is why all Kayastha families are doing Pooja of Pen, inkpot, Books and accounts along statue of Lord Chitragupta (keeping pen and book in hands) with his family. There are twelve sons from two wives of Chitragupta who are known as Kayastha.