Yan Fei was from Jibei. When Cao Pi was the presumptive heir to the Cao Wei throne, Yan was one of his attendants. After Cao became the emperor, Yan was appointed a Gentleman-in-Attendance of the Yellow Gates[zh], an official who served at the palace. After Jingzhao experienced a civil war and was conquered by the general Ma Chao, Yan "restored good and popular government" upon becoming the region's grand administrator. People at the time largely had little experience in farming. Yan encouraged his people to do urban agriculture work, suggesting that they use their leisurely time to farm. At his home, Yan started vegetable plots. Observing that the citizenry were in the predicament of lacking carts and cattle, he urged them to make carts, sell pigs and dogs, and buy cattle. Within two years, nearly all households had carts and cattle. According to the Chinese historical text Weilüe, under Yan's leadership, Jingzhao became the best of Yongzhou's ten prefectures.
↑萬繩楠 (2002). 魏晉南北朝史論稿[On the History of Wei, Jin, Southern and Northern Dynasties] (in Chinese). Taipei: 雲龍出版社. p.33. ISBN986-7938-02-X. Retrieved 2022-03-18– via Google Books.