A Han Chinese clan assimilated into Manchurian ethnicity, Cao’s family had become so rich as to be able to play host four times to the Emperor Kangxi in his itinerant trips down south in Nanjing. For three generations the family held the office of Commissioner of Imperial Textiles in Jiangning. Cao Xueqin's grandfather, Cao Yin, was playmate and confidante to the Emperor Kangxi, and the family's fortunes lasted until Kangxi's death and the ascension of Emperor Yongzheng to the throne. In 1727 they suffered the first of a series of reversals to their fortunes in a political purge that saw the family properties confiscated and the family forced to relocate to Beijing a year later.
Most of what we know about Cao was passed down from his contemporaries and friends. Cao himself eventually settled in the rural areas around Western Beijing where he lived through the larger part of his late years in poverty selling off his paintings. Friends and acquaintances reported an intelligent, highly talented man who spent a decade working diligently on a work that must have been Dream of the Red Chamber. Extant handwritten copies of this work—some 80 chapters—had been in circulation in Beijing shortly after Cao’s death before Chen Weiyuan and Gao E, who claimed to have access to the former’s working papers, published a complete 120-chapter version in 1791. The 120-chapter version is the most printed version.