Palace Library
A Palace Library was a central government agency in imperial China and dynastic Korea, generally in charge of maintaining and archiving the collection of the monarch's documents. China and Inner Asia. The office was in existence for the most part from the mid-200s CE (Cao Wei) to 1380 (Ming dynasty). Over the millennia there were 5 names for this office: In addition to preserving the emperor's official documents, the agency was sometimes also tasked to compile or edit historical records and state calendars. Before the Sui dynasty it also handled documents flowing into and out of  the imperial palace, making it interchangeable with the Secretariat. During the late Tang dynasty (after early 700s) and Song dynasty the office was largely non-functional and staffed by eminent officials for sinecure purposes. The office during the Tang dynasty was headed by 1 director (秘書監) and 2 vice directors (秘書少監), and during the Song dynasty by 1 director and 1 vice director. The office was also staffed with assistant directors (秘書丞) and assistants (秘書郎 or 秘書郎中). During the Yuan dynasty the office was headed by 4 chief ministers (秘書卿), 2 directors (秘書太監), 2 vice directors, and 2 assistant directors  (秘書丞 or 秘書監丞), all eunuchs. Korea. The office also existed during Goryeo under several names: In general, the office was staffed by 1 supervisor (判事; "pansa"), 1 director (監 or 令), 1 vice director (少監 or 副令), 2 assistant directors (丞) and 1 assistant (郎).