Liu Sanfu was appreciated by Li Deyu because of his good writing. When Li Deyu was in Zhejiang, he recommended Liu Sanfu to go to the capital for the imperial examination. After passing the exam, Liu Sanfu served in the imperial court.
Liu Sanfu could remember things from three generations. He said that he had once been a horse, and the horse was often thirsty. He would neigh when he saw an inn from afar, and he would be in great pain if he hurt his hoof. Later, when Liu Sanfu rode a horse, he would always loosen the reins if he encountered hard and barren land, and he would dismount if he encountered a road with many stones. He did not have a threshold in his house for fear of hurting the horse’s hoof.
His son, Liu Ye, was given the imperial decree to pass the imperial examination.
After serving in the imperial court, he submitted a memorial to clear Li Deyu’s name. He used the coffin of Li Deyu from Zhuyao to bury Li Deyu in Luozhong, in order to repay Li Deyu’s kindness to his father. The gentry all praised him.