loremaster
A wise person with knowledge of lore in any number of topics, such as history, genealogy, ancient poetry and possibly magic as well; A scholar.
The beginnings lie back in the Black Years, which only the lore-masters now remember.
Where it comes from
From lore + master, possibly a learned borrowing from Middle English or calque of Middle English lore maistir (“teacher of knowledge”).
Adapted from the Wiktionary entry loremaster (CC BY-SA 4.0).