The Kojiki was presented by Ō no Yasumaro to Emperor Temmu in 680 AD, based upon the stories that had been passed down over generations, as well as stories that had been memorized by Hieda no Are in 712.
Originally, the Kojiki may have been written specifically to "historically cleanse" with the fall of the Soga clan in 645 and to add legitimacy to the Imperial Throne.