Yuanshi 元史 "History of the Yuan" is the first official dynastic history (zhengshi 正史) of the Yuan dynasty 元 (1279-1368). It was compiled under the supervision of Song Lian 宋濂 (1310–1381, courtesy name Jinglian 景濂, style Qianxi 潛溪 or Xuanzhenzi 玄真子) and Wang Yi 王禕 (1321–1372, courtesy name Zichong 子充, style Huachuan 華川).
It comprises 210 juan, of which 47 are imperial annals-biographies (benji 本紀), 58 juan treatises (zhi 志), 8 juan tables (biao 表), and 97 juan normal and collective biographies (liezhuan 列傳).
Already in 1368, immediately after the foundation of the Ming dynasty 明 (1368-1644), Emperor Taizu 明太祖 (r. 1368–1398) decreed the compilation of the official dynastic history of the Mongolian dynasty of the Yuan. The compilation was carried out in the Tianjie Monastery 天界寺 in Nanjing, at that time still the capital of the Ming empire, and after less than a year 70 percent of the draft were finished. The other thirty percent could only be finished when a group of officials was dispatched to Dadu 大都 (later called Beijing), the former capital of the Yuan dynasty, to collect archival material about the last emperor of the Yuan. The whole book was submitted to the throne in the same year.
The high velocity of the compilation caused many problems. The book had been virtually submitted in the shape of a draft and was never revised. One of the outcomes is that reports are contradicting each other, that one event is reported several times in the imperial annals, or even that the biographies of some persons appear twice. The transcription of Mongolian names and terms is not consistant, so that it is difficult to identify persons. Some translations from sources written in Mongolian are also not very good and sometimes even render the opposite of the original meaning. Not only biographies, but also the treatises and tables suffer from a negligent or even dilettantish treatment of terms and names by the compilers. In the biographies, irrelevant paragraphs are quoted from the sources. In some places the year cycles are confused, with catastrophic results for the dating of the events. Event the temple names of the emperors are rendered wrongly in many places.
At least a part of those errors can be traced back to the fact that the historians were not accustomed to the political system and customs of the Mongols. They were, for instance, not aware of the importance an empress dowager played as a temporary ruler after the death of a khan or emperor. The hatred against the alien rule of the Mongols might also have played a role for the missing diligence with which the Yuanshi was compiled.
The tables include information about empresses (106 Houfei biao 后妃表), members of the imperial dynasty (107 Zongshi shixi biao 宗室世系表), princes (108 Zhuwang biao 諸王表), princesses (109 Zhu gongzhu biao 諸公主表), the holders of the honorary posts of the Three Dukes (110-111 Sangong biao 三公表), and the Counsellors-in-chief (112-113 Zaixiang nianbiao 宰相年表).
The treatises of the Yuanshu cover the themes astronomy (48-49 Tianwen zhi 天文志), the Five Agents (50-51 Wuxing zhi 五行志), calendar (52-57 Li zhi 曆志), administrative geography (58-63 Dili zhi 地理志), hydraulic works (64-66 Hequ zhi 河渠志), court rituals and music (67-71 Liyue zhi 禮樂志), sacrifices (72-77 Jisi zhi 祭祀志), state coaches and court robes (78-80 Yufu zhi 輿服志), selection and appointment of officials (81-84 Xuanju zhi 選舉志), state offices (85-92 Baiguan zhi 百官志), food and commodities (93-97 Shihuo zhi 食貨志), military (98-101 兵志), and penal law (102-105 刑法志).
The collective biographies encompass imperial consorts (114, 116 Houfei liezhuan 后妃列傳), imperial princes (115), Confucian scholars (189-190 Ruxue liezhuan 儒學列傳), good officials (191-192 Liangli liezhuan 良吏列傳), persons of loyal conduct (193-196 Zhongyi liezhuan 忠義列傳), persons of filial and brotherly conduct (197-198 Xiaoyou liezhuanYinyi liezhuan 隱逸列傳), outstanding women (200-201 Lienü zhuan 列女傳), Buddhists and Daoists (202 Shi-Lao liezhuan 釋老列傳), magicians and diviners (203 Fangji liezhuan 方技列傳, app. architects, Gongyi 工藝), eunuchs (204 Huanzhe liezhuan 宦者列傳), treacherous officials (205 Jianchen liezhuan 姦臣列傳), disloyal officials (206 Panchen liezhuan 叛臣列傳), rebels (207 Nichen liezhuan 逆臣列傳) and foreign countries (208-210 Waiyi liezhuan 外夷列傳).
The book is nevertheless one of the most important sources for the study of the Yuan period. It preserves a lot of original sources which have been lost, namely the "veritable records" (shilu 實錄) of the emperors and the institutional treatises of statecraft (Jingshi dadian 經世大典). The argument of some scholars that the Yuanshi was written too discursive and should be shortened in many places, is therefore not justified: Without the Yuanshi many sources would not have survived.
The number of biographies of Mongols in high offices, like generals, princes and prime ministers, is not very high. This is not justified regarding the importance of them as actors in history. The reason for this is that the compilers of the Yuanshi lacked sufficient sources from the dynasty's archives (the compilation took place in Nanjing, while the remnants of the Yuan archives were far away in Beijing) but instead made use of easily available sources on Chinese persons, like tomb stone inscriptions found in southern China. A less important point of critique is the overall composition of the book which contradicts long-established principles, for example, the deviating order of the treatises and the collective biographies. At least countless information on the Mongolian customs and habits as well as on the peoples living in the Western Territories and Annam is preserved in the treatises.
The many shortcomings of the Yuanshi inspired a whole wave of rectifying supplements, like Zhu You's 朱右 (1314–1376) Yuanshi shiyi 元史拾遺, or Xie Jin's 解縉 (1369–1415) Yuanshi zhengwu 元史正誤, both written during the very early Ming period. The Qing period 清 (1644-1911) literature includes Shao Yuanping's 邵遠平 (jinshi degree 1664) Yuanshi leibian 元史類編, Wei Yuan's 魏源 (1794-1856) Yuanshi xinbian 元史新編, Zeng Lian's 曾廉 (1856–1928) Yuanshu 元書, Ke Shaomin's 柯紹忞 (1850-1933) Xin Yuanshi 新元史, and Tu Ji's 屠寄 (1856–1921) Mengwu'er shiji 蒙兀兒史記.
Yet none of those book is able to replace the Yuanshi as an official history, barring Ke Shaomin's Xin Yuanshi that was incorporated into the canon of the dynastic histories, as the twenty-sixth.
Already in 1370 the Yuanshi was printed in Nanjing and in the mid-16th century a second time. In 1935 the Commercial Press (Shangwu yinshuguan 商務印書館) published the so-called Bona edition 百衲本 that was based on both Ming period prints but suffers from countless printing errors. The Zhonghua Book Company 中華書局 published a modern edition in 1976 that took into consideration the older prints, corrected errors and added a critical apparatus.