She didn’t die. Over the next few months, she got better. These days, eight years after the surgery, if you saw Liss Murphy walking her Old English Sheepdog, Ned, or playing with her 3-year-old son, Owen, only the faint silver scars on her clavicles would hint at anything unusual: That’s where the batteries that power her brain stimulator are implanted.

"My greatest hope that day was to have something go horribly wrong and die on the table," she says. "I didn’t care."

Finally, a psychiatrist told her about a cutting-edge trial to implant stimulation devices deep in the brains of patients with severe depression. She signed up. In June of 2006, she had the operation.

Murphy came home to Boston, and she tried everything — medications, talk therapy, even repeated rounds of electroshock. But she was barely able to get out of bed for months — then years. Her husband and family and top-flight doctors cared for her, but she sank so low she tried twice to commit suicide.

"I have a hard time believing it was depression, in a way, because it was so pervasive and powerful," she says. "It invaded every aspect of my life. It took so much away from me. And it happened so fast, and it was so degrading — it took everything from me."

She was 31, living in Chicago and working in public relations. The morning of Aug. 13, 2004, she had gone in to the office as usual. "It was Tuesday, and I remember the day so clearly," she says. "The sun — everything — and I walked out — it was about 11 o'clock — and I never went back. The only time I left the house was to see my psychiatrist, who I saw three times a week.

"We're taking a wall of computers, basically, and putting it into something that would easily fit inside a box of Tic-Tacs."

"Is there an actual trace, something that I can reliably say, 'Yes, when I see this it means a person is having an attack of PTSD or they’re feeling very depressed'?" Eskandar asks. "We don’t know. So that is probably going to be the single hardest part."

First, though, scientists need to learn how to recognize which patterns of brain activity — which "neural signatures" — indicate depression and PTSD.

If you're trying to get from Boston to Providence and you go off course, your GPS picks up your error and points you back to the right road, he says. With the brain implant, "If I see that your brain activity is starting to move back into that state indicative of you not feeling well, toward a depressed state or toward fears associated with PTSD, then I'm going to stimulate to correct that. It's wholly analogous, and in fact, the paradigm really follows precisely the paradigm used to build GPS."

If that sounds sort of like your phone's GPS system, well, it is, says Dr. Emery Brown, an MIT computational neuroscientist who'll be working on the algorithms for the brain implant.

The next step is much more sophisticated: a "closed-loop" system, with sensors in the brain, and feedback. So it can pick up when brain activity is going off course, try to correct it in real-time, and then tell whether the correction has worked.

The sort of implant Liss Murphy has in her brain is called an "open-loop" system: Using brain mapping and some trial and error, doctors find a location and a frequency that work, and the stimulator stays on all the time. More than 100,000 patients have similar devices to treat symptoms of Parkinson’s disease.

Over the next five years, they aim to build a device that can sit inside a patient's head, pick up the onset of depression or post-traumatic stress disorder, and head it off before it hits. One implant researcher calls it "a moonshot for the mind."

Now, as part of a $70-million project funded by the military , researchers are aiming to take brain implants for psychiatric disorders to the next level.

But though the surgery changed Murphy's life, "the trial, on average, didn't work," says Dr. Emad Eskandar, the Massachusetts General Hospital neurosurgeon who operated on her. "When you pooled everyone together it didn't work. But there were like five people out of the 10 we did that had remarkable benefits and went into complete remission. We couldn't continue with the study because on the average it failed, but for those people in whom it worked, boy did it work."

"We're moving out of the box. We're not just saying, 'Let's rely on the drugs' anymore."

But the researchers know where to start — with what they already know about the brain networks involved. And they think they may be able to pit one node of a network against another.

For example, in PTSD, a part of the brain called the amygdala, a seat of fear, gets abnormally activated. Another part of the brain, called the ventromedial prefrontal cortex, can suppress the amygdala.

"So the idea would be, we would record from the amygdala with this device," says Dr. Darin Dougherty, director of neurotherapeutics at Massachusetts General Hospital and co-leader of the Boston-based implant team with Dr. Eskandar.

Dr. Darin Dougherty (Courtesy MGH)

"And when a certain neural signature was reached — whether a threshold of activity or a certain firing pattern — and we knew that corresponded with the PTSD symptoms, it could then stimulate in the ventromedial prefrontal cortex, which would result in dampening of the amygdala.

"That's an example," he says. "It's going to be an iterative process as we figure it out, but those are the types of avenues we're going to be exploring for each of these disorders that our veterans come home with."

Tracking this brain activity involves recording huge amounts of data — but ultimately, the implant device has to be small enough to fit inside a patient's head, batteries and all.

"Space and power. Everything kind of comes down to space and power," says Jim Moran, technical director of the implant project at Draper Laboratory in Cambridge. "We're taking a wall of computers, basically, and putting it into something that would easily fit inside a box of Tic-Tacs."

A Draper Laboratory worker behind the glass of a clean room in the microfabrication lab. (Photo: Katherine Gorman, WBUR)

Draper is best known for its work on guidance systems for the Apollo moon missions and ballistic missiles. But it's also big in miniaturization, for the military and for medicine.

And it will craft the tiny innards of the brain implant, in the clean rooms of its microfabrication labs, where workers in "bunny suits" — coveralls — and booties essentially paint with light using photosensitive polymers. They work on what Draper calls "Vanishingly Small Systems."

Draper's Peter Chin is developing software for the implant devices, a mathematical task so tough he describes it as something like "trying to look for something in a dark room...the shape of which I'm not even sure of."

More concretely, he says, the challenge involves learning to extract signal from noise in the activity of the brain with great efficiency. You can think of brain activity as "a hundred billion people all singing at the same time," he says. "Sometimes they're off tune, sometimes they're in tune, and sometimes you hear a particular harmony that may say something about this whole chorus, and that's what we're trying to do. It's just an incredible challenge mathematically."

"And just to complicate the problem," adds Jim Moran, "in an hour it might all be different. These things adapt over time, and we have to adapt the algorithms over time as well."

Not that they're complaining. Chin says he's happy to use his pure math training to help others. "Even if our device can help just one person, all our effort will be worth it," he says.

And Moran notes that the implant fits well into what Draper is known for, guidance, navigation and control. "We landed men on the moon not because of the fact that they were launched in the right direction, but that we continued to correct their course as they went," he says. "And it turns out a lot of the math that we use for that is the same control-system math that we're using for a problem like this."

The implant team hopes to have a device they can start testing in humans within three years. They say it will only be tried in volunteers whose depression or PTSD is severe and has failed to respond to all other treatments.

If this project works, says Emery Brown of MIT, it could open the door to other psychiatric treatments that are more precise, more targeted than current drugs, with fewer side effects.

"It's in crude stages, but there have been successes, and we're saying, 'Well, why don't we just go after the brain regions which can help us control these behaviors precisely? And see if we can't use that approach to deliver therapy directly," he says.

"This could turn out to be extremely doable, in which case this could be a therapy we could offer to a large number of people who've gotten to very, very dire situations," he says. And at the same time, "We're going to learn a tremendous amount, too. We're going to learn about how these brain regions function, and most importantly, we're going to learn about how they function in humans, not in animals.

"We're moving out of the box," says Brown, who also leads anesthesiology research at Mass. General. "We're not just saying, 'Let's rely on the drugs' anymore."

At Massachusetts General Hospital, doctors have already been recording from the brains of patients with epilepsy to figure out where seizures originate. Psychiatrist Darin Dougherty says the brain implant team has begun to work with volunteers from among these epilepsy patients, having them perform little tasks that can kill fear, or heighten attention, or trigger impulsivity, and watching for telltale patterns of brain activity that could be relevant for the brain implant.

Dr. Emad Eskandar (Courtesy MGH)

Will this next-generation brain device work? Neurosurgeon Emad Eskandar tries to balance pure excitement and deep caution.

"This is a really ambitious project and there's no promise that this is going to work," he says. "I don't want people to think, 'Oh, yeah, we're like one step away from this.' This is a long row to hoe."

As the project goes forward, Liss Murphy will be rooting for it, hoping that other people will get the kinds of benefits from deep brain stimulation that she has.

She has endured battery failure and hardware-related infections, but she has no complaints about depending on an implanted device for her mental health, she says. She’s nothing but incredibly grateful for the treatment she’s received.

She also makes no pretense that the implant has solved everything — and that might be a lesson for future patients:

"I think thats the hardest part about this whole 10-year episode is, how do you rebuild your life?" she says. "And I still don't have an answer. Some days are better than others. It’s not perfect and I don't think it ever was perfect. But it’s so much more bearable... and I am committed to finding a way back into life again."

Read Liss Murphy's first-person account of her depression and recovery here.