Cai Yan was the daughter of Cai Yong, a famous Eastern Han dynasty scholar from Yu County, , which is around present-day Qi County, Kaifeng, Henan. She was married to Wei Zhongdao in 192 but her husband died shortly after their marriage and they did not have any children. Between 194 and 195, when China entered a period of chaos, the Xiongnu nomads intruded into Han territory, captured Cai, and took her back as a prisoner to the northern lands. During her captivity, she married the Xiongnu chieftain Liu Bao and bore him two sons. 12 years later, the Han Chancellor, Cao Cao, paid a heavy ransom in the name of Cai's father for her release. After Cai was freed, she returned to her homeland but left her children behind in Xiongnu territory. The reason Cao Cao wanted her back was that she was the sole surviving member of her clan and he needed her to placate the spirits of her ancestors. After that, Cai married again, this time to Dong Si, a local government official from her hometown. However, when Dong Si committed a capital crime later, Cai pleaded with Cao Cao for her husband's acquittal. At the time, Cao Cao was hosting a banquet to entertain guests, who were stirred by Cai's distressed appearance and behaviour. She asked him if he could provide her with yet another husband. He pardoned Dong Si. Later in her life, she wrote two poems describing her turbulent years.
Legacy
Like her father, Cai Wenji was an established calligrapher of her time, and her works were often praised along with her father's. Her poems were noted for their sorrowful tone, which paralleled her hard life. The famous guqin piece Eighteen Songs of a Nomad Flute is traditionally attributed to her, although the authorship is a perennial issue for scholarly debate. The other two poems, both named "Poem of Sorrow and Anger", were known to be written by her. The following is an excerpt from the "Poem of Sorrow and Anger" in five-character form :
In addition to her surviving poems, a volume of Collective Works of Cai Wenji was known to have survived until as late as the Sui dynasty but had been lost by the Tang dynasty. Cai Wenji inherited some 4,000 volumes of ancient books from her father's vast collection. However, they were destroyed in the ravages of war. At Cao Cao's request, Cai recited 400 of them from memory and wrote them on paper.
Literary and artistic tributes
The stories of Cai reverberate primarily with feelings of sorrow, and inspired later artists to keep portraying her past. Her return to Han territory has been the subject of numerous paintings titled Cai Wenji Returns to Her Homeland by various painters since the Tang dynasty, as well as renderings in traditional Beijing opera.