It opened in 1996 across from the old building in Civic Center Plaza. There were elaborate ceremonies and crowds waited in long lines to tour the 376,000 square foot, multi-level structure.

It is still popular. Six million people are expected to visit this year, including many who are homeless. They come to read, use the Internet and the bathroom, or just as a sanctuary to get off the streets.

City librarian Luis Herrera calls the library one of the most democratic institutions a person can find.

"We don't ask if you're homeless, we don't ask your status," Herrera said. "It's open and free to everyone but in some instances when people need help, it's an opportunity with a social worker to provide that, we feel."

There are other libraries in the county that are also havens for the homeless, but no one else takes this approach. Leah Esguerra is a psychiatric social worker at the library 9 a.m. to 5 p.m., Monday through Friday.

"I say hello and somehow they start to feel more comfortable and they start talking to me," Esguerra said.

"I don't do any social services...because I'm completely capable of taking care of myself," one person said.

"We can't help everybody and people have their own time in terms of when they want help and we just have to respect that," Esguerra said.

Esguerra has been on the job for just over a year. Her salary is paid by the library.

Before she arrived the situation was getting out of control, frightening some patrons and staff.

"Such as people taking showers, brushing their teeth; there was some concern about people overdosing because they were doing drugs in the bathroom," Dr. Raj Parekh said.

Parekh is a psychiatrist without the city's health department. The library turned to him and other health professionals who then came up with the novel idea to hire Esguerra rather than traditional homeless outreach workers.

"What we found out is that a lot of the homeless people who come here, they come to get away from being homeless and we found that a lot of folks we spoke with didn't really want to engage with an outreach worker at that point," Parekh said.

But many will accept help from a low-key, non-threatening person. Esguerra says she has helped 250 people at the library since she started, including Gary Gray.

Gray was living under a freeway overpass and now has supportive housing.

It is not a total turnaround at the library, but the staff says there has been a noticeable drop in inappropriate behavior.

"It's great since she started because it helps them and it helps the library," library employee Ron Romano said.

Several libraries around the country -- Atlanta, Baltimore, Seattle, Portland and San Antonio have called San Francisco. They are considering replicating the program.