In a city where children keep getting killed and more than half the teenagers who start ninth grade vanish from the student rolls by the end of high school, why should anyone care that the District's public libraries are, with rare exceptions, dank pits with leaky roofs, outdated books and sullen staffers?

For starters, many biographies of great Americans include a scene in which our hero finds sanctuary and inspiration by using the local library to escape from unsavory friends, wayward parents or the ravages of an anti-intellectual pop culture.

But even if you dismiss that as a romantic blast from the past, consider that in this city right now, one-third of adults are functionally illiterate and that those are people who are largely unemployable, which means you are paying their way. So libraries should matter. But they don't -- yet.

This is the fourth summer in a row in which I have revisited the District's libraries, and each year they are in more pathetic shape. This year, four of the system's 21 branches are shuttered, their books trucked away as part of a rebuilding scheme that dissolved into bureaucratic finger-pointing.

But this summer also brings real hope. As usual in Washington, matters of class and race are getting in the way, but beneath the carping and posturing, good stuff is brewing:

* Our peripatetic mayor has added to his frequent flier points by visiting state-of-the-art libraries in at least half a dozen U.S. cities, and he is now sold on building a new flavor of library, one that gives every neighborhood the same access to information that lawyers, government types and reporters have in their offices.

* The mayor has remade the library system's board, stacking it with a much higher caliber of political firepower, people who are ready and able to make deals. That means selling off some library holdings, creating mixed-use, public-private developments at some of the system's more attractive properties and selling the main Martin Luther King Jr. Memorial Library downtown to office developers, raising funds to remake every single neighborhood branch within eight years.

(Naturally, this idea has strong opponents, including some who would freeze the King library in its sad, unusable state by declaring it "historic." Alex Padro, a former library board member who is president of the citizens group at the Shaw branch, says the mayor's "only interest is in the library's valuable real estate and the potential for new development on these extremely well-located sites.")

* The decision to build the hotel for the new convention center on Ninth Street NW means there may be room for a new central library on the old convention center site. Some D.C. Council members don't think a main library is enough of a people magnet to transform that crucial space into a vibrant hub of the new downtown. But the project's main boosters, library board members John Hill and Richard Levy, say new libraries in Nashville and Salt Lake City show how to combine performance and gallery space with an expanded collection and computer facilities. The result lets libraries compete with and beat Borders and Starbucks in the race to be the "third place" -- a gathering spot beyond home and work.

* The four branches that were supposed to be replaced -- Anacostia, Benning, Shaw and Tenleytown -- are in limbo because of rising costs, but that could turn out to be a blessing. The board is finally standing up against what Hill calls "the libraries of the past," buildings that don't provide for the library's new functions -- room for homework help, literacy classes and training users on computer databases.

"The notion of spending 20 to 30 million dollars on branches that would be obsolete the day they opened was just appalling," Levy says. "These were going to be 1950s libraries."

Now, while the designs for those branches are revised -- possibly with the mixed-use projects that should have been embraced in the first place -- the city plans to open temporary storefront libraries in those neighborhoods.

In an atomized society, where much of what was once done in libraries now takes place via the Internet in bedrooms and kitchens, the library's role is changing. But the need for gathering places is not going away: "It's precisely that social separation that has caused people to migrate to places where they can be with people," Hill says.

From the ashes of a ruined system, the city's challenge now is to create that new place, feed people's minds and give us cause to be together.