I started taking the Amazonian psychedelic ayahuasca two years ago because I had an 11-year addiction to heroin I couldn’t shake. Over the years, I went to rehab four times, drifted between jobs, wandered in and out of Alcoholics Anonymous meetings, and tried opiate substitute drugs like Suboxone. The end result was a cliche of the downtrodden: living in the streets of San Francisco, shooting heroin and smoking crack, sleeping under a church doorway and, at times, in a jail cell. Nothing catalyzed me to go a different way, until I sobered up and found ayahuasca.

Though the agony of withdrawal is the most excruciating part of heroin addiction, it is hardly the greatest obstacle to quitting. Getting off heroin is one thing (a couple weeks in treatment or jail will do the trick of abating physical dependence), ​staying off is another. Time and time again, I ceased using heroin for a period of weeks or months, then invariably found myself depressed, slogging through the days and, soon enough, back to old reliable. That changed with ayahuasca: When I started taking the peculiar tonic, it upended this sense of malaise and invited me to be astonished.

For me, ayahuasca was a cure for the doldrums. I’ve taken ayahuasca more than 15 times, and the best way I can describe my most powerful experiences is that they exploded my whole mind and took me into worlds of pure sensation. My head was a volcano, my senses were unthinkably amplified, and I sometimes felt enveloped by a vague intensity that seemed like a sense of its own. At times, I traveled inside old memories and entered fantasy worlds where I could breath out colors and see musical notes floating past like bubbles.

Ayahuasca is illegal in the United States (with the exception of sanctioned ayahuasca churches), though legal in several South American countries. Its use by native Amazonians reportedly goes back thousands of years (it was first documented to outsiders by 18th century Spanish missionaries), and one astounding mystery is how they first arrived at the idea to cook and drink a brew of two plants that didn’t grow anywhere near each other in a jungle teeming with different species. Natives say the plants “spoke” to them and revealed what to do.

There is a small, though growing, body of scientific research on the potential of psychedelics like ayahuasca to treat drug addiction (among other mental health ailments). A 2017 study by the Bay Area-based Multidisciplinary Association for Psychedelic Studies on the African plant hallucinogen ibogaine (which can reverse many symptoms of heroin withdrawal) found that one-third of 30 heroin addicts who took just a single high dose of ibogaine were abstinent three months later.

A 2014 Johns Hopkins experiment that gave a single large dose of psilocybin to a group of heavy cigarette smokers yielded a remarkable success rate: 80 percent had stayed abstinent from cigarettes after six months, and 67 percent after one year. MAPS also sponsored a small 2013 study on a group of drug users in Canada who were given multiple doses of ayahuasca; six months afterward, almost all of the 11 subjects reported a reduction or cessation of drug use and improvements in well-being.

Ayahuasca is made by combining two plants, the ayahuasca vine and the leaves of a chacruna bush, both indigenous to the Amazon jungle. The chacruna leaves contain the psychedelic compound dimethyltryptamine, while the vine contains what’s called a monoamine oxidase inhibitor, without which the stomach cannot properly absorb the DMT. Cooked together with water, the two plants yield a dark and bitter liquid that, when consumed, can send you off.

Because of its powerful physical and psychoactive effects, ayahuasca is typically taken in a formal ceremony led by a shaman studied in its use and traditions. Usually the shaman leads a brief ritual to begin the ceremony, after which the participants (in my experience, between about eight and 25 people) take turns drinking the tea. In the ensuing hours, the sound of music fills the room, as the shaman and others sing to instruments like guitar, harmonica, hand drum, flute and harmonium. Sometimes other sounds cut the air like vomiting, crying, laughing, or cries of fear like pleading or shrieking.

Psychedelics like ayahuasca work the opposite way that narcotics such as alcohol and heroin do: Instead of suppressing or displacing your natural temperament, they explode open your deepest ideas and feelings, pushing you through the unimaginable grinder of your own consciousness. Thoughts, memories and inexplicable convictions erupt from the well — I’ve heard people say they felt the pain of the whole world in an instant.

To make matters worse, ayahuasca tends to induce what’s known as “purging”: physical expulsions (vomiting, diarrhea, crying, laughing, sweating, trembling) that shamans consider a means of cleansing the physical and energetic body. And while such episodes can indeed punctuate the experience, it sometimes feels to me like the ​whole thing is a kind of purge. As the intensity heats up and everything comes tumbling out, it’s like my psyche’s being wrung like a wet rag.

In my most soulful moments, however, ordinary judgments slip away and a gracious, tender curiosity rises up as the most meaningful thing. More than anything, ayahuasca makes me feel astonished. Especially when the sharpest effects have waned, I’m often left with this swell of pure vitality — just feeling the music’s bouncy energy, enchanted and thoughtless. For those distressing moments when taking ayahuasca seems masochistic, there is also the unworldly tranquillity that the excavation of your interior finally dredges out.

Ayahuasca has been a part of my addiction recovery along with therapy, meditation, exercise, dietary changes and Alcoholics Anonymous. AA tends to frown on the use of psychedelics (though its founder championed his own therapeutic experience with LSD), yet ayahuasca is the thing that finally opened me to persevering in AA.

Today, I see these different processes as helping me in similar ways: cracking open my most rigid ideas and self-obsessions through rigorous introspection, while also nurturing a deeper engagement with a world that (like ayahuasca) defies understanding but abounds with possibility. There’s no panacea, but exploration has its rewards.

Joe Rosenheim is an addiction counselor and freelance writer.