Sarah remembers what it was like both before and after the treatment. The 36-year old vividly recalls how, after her depression lifted, she had to readapt to performing the tasks other people do routinely each day. Even the simple act of looking at a menu took readjustment.

“I also had to learn, relearn,” she said at a press briefing, “how to actually have opinions about things and actually pick something on a menu and order it and not just go along with what everyone else wanted. Because I was so used to the fact that I couldn’t make decisions, that [ability], over the last five years...., just atrophied and disappeared.”

Sarah’s intractable depression, which had not responded even to electroconvulsive therapy, yielded after an experimental treatment conducted at the University of California, San Francisco. The treatment detects depression-related brain activity and then applies electrical stimulation at a targeted location to relieve symptoms. The device used for the procedure has already been approved for treating epilepsy by providing brain stimulation after it registers electrical patterns that predict an oncoming seizure.

In the October 4 study in Nature Medicine, the researchers describe how they set about to find a stimulation site using electrodes to probe emotion circuitry in Sarah’s brain. As they looked, they found that one site might lower anxiety and that another might increase energy levels.

When the team activated a site deep in Sarah’s brain in a reward-related area called the ventral striatum, she had an immediate reaction. Sarah was doing needlework during one session to distract herself from negative thoughts when a stimulus was applied to that spot. Her mood changed quickly. In a U.C.S.F. article about the treatment, she recounted her her surprise at feeling that she was enjoying what she was doing—experiencing, in fact, a sense of “glee and happiness.”

The researchers also wanted to know when to provide a stimulus. Previous research on activating neural circuits to relieve depression using other deep-brain stimulation (DBS) techniques have met with mixed results. Earlier attempts did not map the brain to take into account the fact that depression may vary among individuals.

These efforts also applied continuous stimulation. The U.C.S.F. researchers suspect that the effectiveness of this type of treatment depends on knowing when an electrode should be activated in anticipation of symptoms growing more severe, similar to the approach taken with epilepsy.

They looked for what they call a “biomarker” that could supply such an alert. They found it in the amygdala, which mediates emotional processes and is also connected to the striatum. High-frequency neural activity—“gamma oscillations”—in the amygdala indicated when symptoms were about to get worse.

Last year the team implanted the about $30,000 epilepsy device, Neuropace RNS, in the right hemisphere of Sarah’s brain. An electrical wire goes to the amygdala to detect gamma activity. When present, a warning flashes back to a thin metal disk placed in the skull. The disk, a neurostimulator, then transmits a signal along a separate wire to the striatum to tamp down feelings of sadness and depression.

Stimulation is applied in a short six-second burst and then turns off until another gamma warning is received. This intermittent switching on adds up to no more than 30 minutes a day. But for Sarah, it has made a difference. “The device has kept my depression at bay,” Sarah said at the press briefing, “allowing me to return to my best self and rebuild a life worth living.”

When tried with new patients, the therapy will again be personalized. Others will also undergo the process of electrical probing to look for brain stimulation areas most suited to their depression. But the challenges accompanying Sarah’s case make the U.C.S.F. researchers optimistic. “We didn’t know if we were going to be able to treat her depression at all because it was so severe,” said Katherine Scangos, a U.C.S.F. physician and lead author of the Nature Medicine paper, at the press briefing.

Longtime DBS researchers also took notice. “This is an interesting and important proof of principle case,” says Helen Mayberg, a neurologist at the Icahn School of medicine at Mount Sinai, who has been a pioneer in earlier DBS studies for depression and was not involved in the new study. “Time will tell if this approach substantively improves on simpler open-loop strategies [without biomarkers].”

Andres Lozano, a professor of neurosurgery at the University of Toronto and a collaborator of Mayberg’s, who was also not involved in the Nature Medicine paper,  says that the work is an “exciting finding that leads to a more personalized and ‘just in time’ approach to delivering brain stimulation in depression when and where it is needed.” He adds that “several questions remain, including the generalizability of these biomarkers across patients and whether the application of stimulation produces more than merely acute changes but indeed an enduring benefit.”

Sarah is just one patient. The study she enrolled in was a “proof of concept”—what researchers call an “n of one.” “We're still learning; we’re at the very, very beginning of trying to understand how this works,” says U.C.S.F. neurosurgeon Edward Chang, who is co-senior author of the study. U.C.S.F. is in the process of lining up 11 additional patients. The new research could ultimately provide a better idea of whether targeting just the right brain circuit can lift the penumbra that hangs over a severely depressed person.