The psychedelic experience can be rough on a person's ego. Those who experiment with magic mushrooms and LSD often describe a dissolution of the self, otherwise known as ego-death, ego-loss, or ego-disintegration.

For some, the experience is life-changing; for others, it's downright terrifying. Yet despite anecdote after anecdote of good trips and bad trips, no one really knows what these drugs actually do to our perception of self.

The human brain's cortex is where the roots of self awareness are thought to lie, and growing evidence has shown the neurotransmitter, glutamate, is elevated in this region when someone is tripping.

But up until now we've only had observational evidence. Now, for the first time, researchers have looked directly into how taking psilocybin affects glutamate activity in the brain. And the evidence suggests that our tripping experience, whether good or bad, might be linked to glutamate.

In a double-blind, placebo-controlled experiment, neuroscientists carefully analysed what happens to glutamate levels and a person's ego when taking psilocybin, the active ingredient in magic mushrooms.

Using magnetic resonance imaging ( MRI) to monitor the brains of 60 healthy volunteers, the team found significant changes in activity in both the cortex and the hippocampus in those taking psilocybin.

Glutamate is the most common neurotransmitter in the brain, and it's known to be critical for fast signalling and information, especially in the cortex and hippocampus, the latter of which is thought to play a role in self esteem.

It also looks like psychedelics have a way of tapping into this system.

Interestingly enough, in the new clinical study, these two regions of the brain had quite different glutamate responses to psilocybin. While the authors found higher levels of glutamate in the prefrontal cortex during a trip, they actually found lower levels of glutamate in the hippocampus.

What's more, this may have something to do with whether a person has a good experience with their ego or a bad one.

"Analyses indicated that region-dependent alterations in glutamate were also correlated with different dimensions of ego dissolution," the authors write.

"Whereas changes in [cortical] glutamate were found to be the strongest predictor of negatively experienced ego dissolution, changes in hippocampal glutamate were found to be the strongest predictor of positively experienced ego dissolution."

Practically, we still don't really understand how this activity in the brain is linked to our ego, or even if it is. Still, it's been suggested that psychedelics decouple regions of the brain, so factual or autobiographical information is momentarily separated from a sense of personal identity.

"Our data add to this hypothesis, suggesting that modulations of hippocampal glutamate in particular may be a key mediator in the decoupling underlying feelings of (positive) ego dissolution," the authors suggest.

After decades of limited research, drugs like psilocybin, LSD and DMT are now finally being considered for their therapeutic benefits.

Understanding how these drugs work on a neurochemical basis could allow scientists to develop better treatments for those with mental health issues, such as depression and anxiety.

Although if we're going to be using these substances to treat mental health issues like anxiety, depression and addiction, we're going to need to also understand the way the drugs mess with our ego - hopefully without the bad trip to go along with it.

The study was published in Neuropsychopharmacology.