A librarian was a person who worked in a library, organizing and managing information services or materials for those with information needs.
Mira Romaine, a Starfleet lieutenant on her first space assignment, was heading for Memory Alpha, where she was to be a librarian. The planetoid had been designed as an open research facility containing records of all Human knowledge. On the way, a community of alien beings' thoughts tried to take over Romaine's body, but she was able to resist. Although the beings had killed everyone on Memory Alpha and caused catastrophic damage to the databases, Romaine went back there to try to rebuild it. (TOS: "The Lights of Zetar")
After being captured on Delta Theta III, James T. Kirk remarked, "There are times, Mr. Spock, when I think I should have been a librarian." Spock observed, "The job of librarian would be no less challenging, captain, but it would undoubtedly be a lot less dangerous." (TAS: "Bem")