Atoz, Mr.

Star Trek: The Original Series
Episode: TOS 078 - All Our Yesterdays

Last inhabitant of the planet Sarpeidon. Mr. Atoz and several duplicates of himself oversaw a vast library in the atavachron, a time-portal device that allowed inhabitants of the doomed planet to travel back to the past in order to escape their inevitable doom.