Enchantment
Cumulative upkeep
(At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)
When Ancestral Knowledge enters, look at the top ten cards of your library, then exile any number of them and put the rest back on top of your library in any order.
When Ancestral Knowledge leaves the battlefield, shuffle your library.