You can activate the second ability any time you have priority, including in response to itself. However, you will only be able to sacrifice the Vault as the first such ability resolves.

Artwork
Loading artwork…
Knowledge Vault
Legends · #281 · EN
Nonfoil—Foil—
Card rules
2,
: Exile the top card of your library face down.
0: Sacrifice this artifact. If you do, discard your hand, then put all cards exiled with this artifact into their owner's hand.
When this artifact leaves the battlefield, put all cards exiled with it into their owner's graveyard.
Rare · Illustrated by Amy Weber
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Old School Legal
Penny Legal
PreDH Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If you activate Knowledge Vault's second ability, all that happens at that time is that you pay a cost of 0. As the ability resolves, you must sacrifice Knowledge Vault. This is mandatory. If you are able to do so, you discard your hand and put all cards exiled with Knowledge Vault into their owners' hands. If you aren't able to do so because Knowledge Vault left the battlefield or changed controllers before the ability resolves, nothing happens.
You don't get to look at the cards exiled with Knowledge Vault.