According to the Japanese Ritsuryo code, compilation of official history book was the job of Zushoryo (the Bureau of Drawings and Books), but it is considered that Zushoryo actually lacked historical materials and human resources necessary to carry out such a job (it is considered that the records and precedents concerning the jobs under the Ritsuryo system were accumulated by Naiki (Secretary of the Ministry of Central Affairs) and Geki (Secretary of the Grand Council of State) for the purpose of future reference).
日本の律令法によれば、図書寮が国史編纂の任に当たる事になっていたが、実際の図書寮にはそれを行うだけの史料の集積も人材もなかったと考えられている（律令制実務における記録や行政文書の集積は、後日に先例として参考にするために内記や外記などで行われたと見られている）。