Mistborn series by Brandon Sanderson. In addition to being an excellent fantasy series, the Mistborn series allowed me to consider the portrayal of archives and historians in works of fantasy.
Sanderson's Final Empire includes a sect of people who are known as Keepers. In a glossary Sanderson defines the Keepers as "an organization of Feruchemists dedicated to discovering, then memorizing, all the knowledge and religions that existed before the Ascension." Throughout the series the Keepers are depicted as the holders and preservers of history, without them the past would be erased from all memory. The Keepers are also dedicated to sharing their knowledge with those in need.
This act of remembrance and sharing strikes me as the essential reason for the establishment of archives and the ultimate goal of many historians. Like many other fantasy authors, Sanderson uses the act of remembering and the premise of archives to advance the plot in his novels.
This research takes Gandalf 17 years to complete in the books and is shown as a brief clip in the Fellowship of the Ring movie. Tolkien uses Gandalf's time in the 'archive' and reliance upon historical sources to advance his plot. It is Gandalf's historical research that eventually allows him to discover how to 'test' the ring held by Frodo.
Archives, historical research, and other avenues of examining the past often appear in works of fantasy. Fantasy worlds by their very nature have unique (as in following accepted history) histories. This uniqueness often requires authors to explore the past of a world in a preface, through stories/oral histories, or devices such as archives.