PHILADELPHIA  As a teenager, Keith Garrett was desperate to be accepted by the guys on the corner. His first arrest for shoplifting was a point of pride with the gang, he recalled, and using heroin, cocaine and alcohol was natural. Like many others in his group, he ended up addicted and scrounging to survive in abandoned houses.

Mr. Garrett, now 54, was first sent to drug treatment in 1975, for six months. When he got out, he joined a 12-step program, but soon enough, he lighted a joint with an old friend and was drawn back to the streets. The halfhearted efforts at rehabilitation followed by relapse were repeated over the years.

“I didn’t get much support in building a new life,” he said of earlier treatments.

Finally, a year ago, Mr. Garrett said, he realized that “nobody cared if I lived or died.” He entered into a new world of addiction recovery services developing in Philadelphia, where public and private agencies have teamed up to give struggling addicts far more social and practical support than before.

The city relies on a network of treatment centers, recovery houses and a community center that provide counseling and practical aid. They are mainly staffed by peers in recovery who are trained to help others navigate a shaky new world of sobriety.