Illegal drugs have defined Ashlee Ryan’s life since before she was born.

“My parents met in detox,” she said while bouncing her 4-month-old daughter on her knee. Ryan began using drugs herself at a young age.

“I started drinking and smoking weed at 12," she said. "Started with pills, opioids and benzos at 13. Cocaine at 14 and heroin at 16.”

Ryan cycled in and out of treatment programs and jail cells. She’s been arrested 57 times and spent more weekends than she would like to remember dope-sick in a cell.

At age 22, she decided to get clean. “I had my daughter. I had my son. I got married. We had a life: cars, a house, jobs.”

But when Ryan’s mother-in-law died, her husband began using. After a month of resisting it, she relapsed, too.

“It was horrible," she said.

Back to her old ways, Ryan lost her two children to foster care. Everything was falling apart.

About two years after relapsing, Ryan says things got even more complicated. "I had a pregnancy test at my house, so I took it and I found out I was pregnant," she said.

This combination of using drugs and being pregnant is clearly dangerous for a fetus, but it can also be deadly for the mom.

“Women who are pregnant and postpartum — in the six months after they deliver — [see] a marked increase in their risk for overdose death,” said Monica Bharel, the commissioner of the Massachusetts Department of Public Health.

For the first time ever in Massachusetts, the state says it brought together 20 different databases from across the state to identify the people most at risk in the opioid epidemic. Commissioner Bharel highlights four groups: those newly released from prison or jail, the homeless, the mentally ill, and women who have just given birth.

This does not surprise Eileen Maguire, who oversees treatment and recovery initiatives at Victory Programs, a Boston-based nonprofit that helps individuals and families with substance abuse problems or who are homeless. Maguire says childbirth is a particularly vulnerable time and might cause a person to relapse.

“It could be because of postpartum depression. It could be due to the stress of just giving birth. It could be a lack of resources or a lack of support systems,” she said.

With resources from the Department of Public Health, Maguire’s team created a new program within one of their residences. They designated six of the 32 beds at Shepherd House exclusively for women and newborns.

“We created it because there weren’t enough places for women who were pregnant or postpartum to receive services,” said Maguire. Plus, she says, the places that did exist often required mothers to change programs right after they gave birth — uprooting their lives and their treatment course at a critical moment.

At Shepherd House, they can arrive early in their pregnancy and remain there for up to the first year of the child’s life. “This is a little bit unique because they can stay where they’ve already created their supports,” Maguire explained.

When Ryan moved to Shepherd House, she was only a few months pregnant, but she picked a room on the second floor where it would be easiest to prepare bottles and bathe a baby.

“I’m right next to the bathroom,” Ryan said. “And the kitchen is right there.”

She got to work rebuilding her life. There were regular therapy sessions and group meetings. She developed a strict routine and got a job at a hardware store. Ryan's husband is also began working on his recovery. They see each other several times a week at AA and NA meetings.

When Ryan delivered her daughter, Leila, four months ago, they became the first mother and infant team in the treatment program. Having infants involved in the program has benefited even those who don’t have newborns at the house, says Angela Headley, who runs Shepherd House.

“Just having the baby here, our clients watch their language. The softer side of them has come out. All of them want to be 'aunty,'” she said. 

Ryan and Leila became the first to graduate Wednesday. They are moving to a family shelter across the street where they’ll live until they can find housing — and where Leila’s two older siblings are able to come and stay the weekend.