A high-level imperial government office and academy established in the Tang dynasty, primarily responsible for the correction and storage of books, teaching students, and consulting on institutional reforms and etiquette; also existed briefly during the early Ming dynasty.