Records of the Three Kingdoms
Cai Yan, courtesy name Wenji, was from Yu in Chenliu, Cai Yong’s daughter. She was learned and understood music. The Book of the Later Han says she first married Wei Zhongdao of Hedong. He died. There was no son, and she returned to her own family. In the Xingping disorders she was taken by Hu riders, lived twelve years among the Southern Xiongnu, and bore two children. Cao Cao had been close to Cai Yong and grieved that Cai Yong had no heir. He sent gold and jade to ransom her and had her marry Dong Si of the same commandery.
When Dong Si was condemned to death she went to Cao Cao with her hair undone and her feet bare and begged for him. Cao Cao spared Dong Si and asked her to write out what she remembered of Cai Yong’s books. She said she could still recite more than four hundred pieces, and she copied them. The Poem of Grief, about exile and return, is generally attributed to her. Whether the Eighteen Songs of a Nomad Flute are hers is disputed. Chen Shou’s Records give her no biography. This section follows the Book of the Later Han.
Romance of the Three Kingdoms
After Cai Yong’s death the novel has Wenji taken by the Xiongnu, and later Cao Cao brings her back to put her father’s manuscripts in order. The passage is short. Its point is Cao Cao’s regard for talent and the fate of Cai Yong’s house.
The book does not unfold the twelve years on the frontier, and it does not make the Eighteen Songs a chapter. In the Romance she is a noted man’s daughter, not the subject of a campaign.
Reference: Wikipedia · Cai Yan