In Memorial Hall in the James Madison Building of the Library of Congress, eight quotes of Madison’s are carved into the wall and painted in gold leaf. Like so much of our forebears’ wisdom, his words feel unusually relevant now. “THE ESSENCE OF GOVERNMENT IS POWER, AND POWER, LODGED AS IT MUST BE IN HUMAN HANDS, WILL EVER BE LIABLE TO ABUSE,” one says. Another is very pro-library, and makes you want to join with your fellow-Americans and delve into the stacks: “LEARNED INSTITUTIONS OUGHT TO BE FAVORITE OBJECTS WITH EVERY FREE PEOPLE. THEY THROW THAT LIGHT OVER THE PUBLIC MIND WHICH IS THE BEST SECURITY AGAINST CRAFTY & DANGEROUS ENCROACHMENTS ON THE PUBLIC LIBERTY.”

The new Librarian of Congress, Dr. Carla Hayden, is highly motivated to make this library, and all libraries, a favorite object of the people. Hayden is the first person of color, and the first woman, to lead the Library of Congress; she is also the first actual librarian to lead it since 1974. Her predecessor, Dr. James Billington, a distinguished Russia scholar appointed by Ronald Reagan, was beloved for his intellect but criticized for mismanagement; he neglected, for many years, to appoint a chief information officer, which was required by law, and he also didn’t use e-mail. Hayden, a former head of the American Library Association, revitalized and modernized Baltimore’s twenty-two-branch Enoch Pratt Free Library system. President Obama nominated her, in 2010, to be a member of the National Museum and Library Services Board, and, last year, to become Librarian of Congress.

Hayden met a bit of opposition on her way to confirmation—the usual resistance to Obama’s later appointments, for one, and a tempest in a teapot about the use of Internet filters at public-library computers. More significant, some Republicans didn’t like Hayden’s firm resistance to the privacy encroachments of the Patriot Act when she was head of the A.L.A. Her opposition to what she saw as potentially McCarthyite government intrusion into citizens’ privacy earned her a Ms. Woman of the Year distinction in 2003. (“When the FBI came snooping, Carla Diane Hayden proved librarians are more freedom fighters than shushers,” Ms. wrote.) Mention her name to a New York Public Library staffer, and there’s a frisson of excitement; at her raucous and bustling sendoff in Baltimore, a high-school librarian, quoted in the Washington Post, called her a “rock star.”

The week after the Presidential Inauguration, hoping for some perspective on things, I visited the Library of Congress for the first time. In the morning, I explored the Jefferson Building, the palatial Italian Renaissance-style building that most people associate with the Library of Congress: winged figures of genius; Minerva mosaic; display case containing one of three perfect copies of the Gutenberg Bible; reading room that evokes the Florence Duomo. Then I met with Hayden in her expansive office in the Madison Building, completed in 1980. It’s contemporary-federal and grand, with floor-to-ceiling windows. Hayden is compact, with a short hair style that expresses contained fun, and an expression of amused, no-nonsense warmth. She dresses in the kind of elegant public-servantwear—jackets in rich hues—that we’ve seen on Hillary Clinton, Madeleine Albright, and Angela Merkel. She has a large, imposing desk, but we sat by the windows at a more companionable table, on which there was an ornamental bowl commemorating the Jefferson Building. It was full of butterscotch candies. When I looked at Hayden from where I sat, the Capitol loomed behind her head. “Well, we are the Library of Congress,” she said.

The Library of Congress has three massive main buildings, a staff of some thirty-two hundred, and a collection of more than a hundred and sixty million items. It runs the Congressional Research Service, which Hayden has called “the Special Forces of analysts,” and the U.S. Copyright Office, and special archives like the American Folklife Center. It hosts dozens of free public events a year, including concerts. It contains everything from Ralph Ellison’s personal library to Rosa Parks’s peanut-butter-pancakes recipe to Bob Hope’s joke collection and George Gershwin’s piano. (Here’s Hayden leaning on it, talking with Smokey Robinson, who just received the library’s Gershwin Prize.) The library was started, in Congress itself, in 1800; re-started with Thomas Jefferson’s own books after the British burned the Capitol, in 1812; and has expanded ever since.

When Hayden was formally asked to serve by the Obama Administration, she told me, “It was that word, ‘serve,’ that helped me. With the Baltimore experience, you really were almost touching the people who were benefitting from the work of the library. And I had to think about, How can I make this library that relevant, and that immediate?”

Hayden was the deputy commissioner and chief librarian of the Chicago Public Library, in the early nineties. In 1993, she became the director of the Pratt, in Baltimore, where she still lives. When she first moved to Baltimore, she recalled, many people came up and told her what she came to call “Pratt stories.” “Everybody—senators, medical doctors, people at the grocery store—all told me, ‘Pratt helped me’ . . . fill in the blank,” she said. “A distinguished African-American medical researcher said, ‘That was the only place that the races could mingle in the city, and where they were accepted.’ ”

In 2015, during the protests after Freddie Gray’s death in police custody, Hayden decided to keep the Baltimore libraries open, including the branch in the center of the unrest; all week, it functioned as a refuge, and a resource for information, comfort, even food. After a couple of days, Hayden’s mother came to help out. “That community, like so many communities across the country, depends on the library,” Hayden said. “And not just urban libraries, rural libraries. Tribal libraries, on reservations. See, that’s what people don’t realize. That’s where people get their high-speed Internet access, all that.” Later, Hayden got to know Scott Bonner, the Ferguson librarian who kept his branch open during the protests there after the death of Michael Brown. “We were talking about it yesterday, actually,” she said. They’d been at the A.L.A. midwinter conference, in Atlanta. “And how it wasn’t even a choice—you didn’t really think about should you or shouldn’t you. It’s just like, ‘Yeah—that’s what we do.’ ”

Like many librarians, Hayden is a big believer in the rights of all people to educate themselves, and in the importance of open access to information online. (This inclusive spirit has become more urgent nationally in recent weeks: see “Libraries Are for Everyone,” a multilingual meme and poster campaign, created by a Nebraska librarian, Rebecca McCorkindale, to counter the forces of fake news and fearmongering.) In September, Hayden gave a swearing-in speech in which she described how black Americans “were once punished with lashes and worse for learning to read.” She said that, “as a descendent of people who were denied the right to read, to now have the opportunity to serve and lead the institution that is our national symbol of knowledge is a historic moment.” She also talked about the Rosa Parks archive, now at the Library of Congress and available online. In a letter it contains, Parks wrote, “I had been pushed around all my life and felt at this moment that I couldn’t take it anymore.” That letter, Hayden said, is now available “in the classrooms of Racine, Wisconsin, in a small library on a reservation in New Mexico, and even in the library of a young girl in Baltimore, looking around as her city is in turmoil.”