The Librarian is a godlike being with the Library under his command and is the Father of the Five Gatekeepers and a major protagonist in Anthony Horowitz's dark fantasy series The Power of Five. Despite the Librarian being a major protagonist, he appears only in two novels, and is not even referred to in the first three (although his presence is hinted).
The Librarian says there was "just him" when he found the Library, and it is suggested the Library was already existing when he found it. It is unknown how he found it or when he did. It is known he has been around for millenia. The Librarian lives in the mysterious Dreamworld, a dimension existing only in the Gatekeepers' dreams. When in the Dreamworld, a Gatekeeper can find the Librarian if they wish and get answers to their questions - however the Librarian is annoying and only gives vague answers, often emphasizing that the answer may not be good after all.
Before the series
Because the Librarian is revealed as the Father of the Five Gatekeepers it is believed he may have lived as Mark Freeman, Matt's father, and when he died in a drowning he may have gone to the Dreamworld and found the Library.
The Librarian first properly appears in this book when Matt visits the Dreamworld, and when he climbs atop a hill, he finds an enormous city - or what looks like a city - but when he looks closer he realizes its in fact one giant building, all linked by bridges, and towers - but it looks like a massive city. Matt is a little afraid as he enters, because of the deathly silence and the imposing architecture. Its later revealed the Library has pieces of every major building in the world embedded in it - for instance, the Tower of London, the Colosseum, Westminster, and the Taj Mahal, and other such buildings. The Library looks amazing and grand and Matt ponders before he goes in but he does enter.
Inside, he finds the Librarian - who is shown to be a tiny man, barely higher than Matt himself, and having very short gray hair and dressed in Arabic-style robes, with a long red silk jacket. He is standing politely behind a lectern and asks Matt if he can help him. After introducing himself and saying how he knows Matt's name, he takes Matt to look at his life story, because the Library has a biography of every single human who has ever lived and died, and is living, and will be born. The Library chronicles their lives (apparently written by them before they were born) and the Librarian is guarding this treasure. Matt doesn't want to read his book and the Librarian puts it back in its slot. Matt is told that his biography will say when Matt dies and how. Matt is sickened and asks the Librarian that will he win or lose over the Old Ones. The Librarian says he refused to look at the answers he gave him. Then he says that they are experiencing some turbulence, but when Matt awakes, he sees a plane stewardess standing over him and realizes she spoke the words instead.
In the final book, Matt is with Lohan in South America, ten years on in a desolate future, where all electricity has gone, and the rich are super rich, but everyone else is incredibly poor and starving. Matt tells Lohan he met "someone" (the Librarian) in his dreams and he goes to find the Librarian for help. Matt is so angry he lashes out at the Librarian, blaming him for his problems. In fact, Matt begins to realize, that all the chaos in the world is essentially his own fault, because last time he refused to read his biography. He says he will read it this time, and not make any more mistakes. Matt is given a place to sit and read, and he spends six hours reading his book, and when he stops, he is sick. He knows he has to sacrifice himself to the Old Ones and let himself die. However, the Librarian comes back and Matt says he wants nothing more to do with him other than the Librarian call the Five to meet.
Later, although Matt does have to kill himself, he is reborn as the Matt from the past, and he enters the Library with the rest of the Five, and meets the Librarian, and his female partner - a woman of indiscernible race who looks like the mothers of the Five, simultaneously. Finally they all live happily together in the Dreamworld.