A growing body of research is beginning to show that our bodies are far more connected to the trillions of bacteria living in our gut than we ever expected. For years, scientists have been discovering how our microbiome affects everything from our immune system to our metabolism — and by extension, our risk of obesity and chronic diseases. Among that research, scientists found these bacteria can tap into nerves in the gut, and signal to the brain they need to eat. But with a new study, hunger isn’t the only thing these bacteria seem to affect.

It appears gut flora may be able to reduce social anxiety as well, especially in people who are genetically predisposed, the study found. However, the type of flora these people had was crucial; those who ate the most fermented foods encouraged the right bacteria to grow, and thus conferred the benefits. “It is likely that the probiotics in the fermented foods are favorably changing the environment in the gut, and changes in the gut in turn influence social anxiety,” said Matthew Hilimire, a psychology professor at the College of William and Mary in Virginia and co-author of the study. “I think that it is absolutely fascinating that the microorganisms in your gut can influence your mind.”

Previous research has linked a lot of this gut-mind communication to the vagus nerve, the longest and most complex of the cranial nerves, which runs from the brain through the face and chest to the abdomen. While it’s unclear exactly how it works, some research suggests gut bacteria trigger the release of neurotransmitters, such as serotonin, which control our moods. Depending on what we eat, these triggers may then reduce or amplify anxiety.

For their study, 700 students participated in answering a questionnaire, which asked about the fermented foods they ate over the past month, as well as their levels of exercise and the average amount of fruits and vegetables they consumed — in order to control for diet outside of fermented foods. They were also asked questions meant to measure their levels of neuroticism, which indicated their levels of social anxiety. Aside from eating fermented foods, they also found higher levels of exercise was associated with a lower risk of social anxiety.

“These initial results highlight the possibility that social anxiety may be alleviated through low-risk nutritional interventions, although further research is needed to determine whether increasing probiotic consumption directly causes a reduction in social anxiety,” said Jordan DeVylder, an assistant professor at the University of Maryland School of Social Work and co-author of the study. Though further research will surely uncover whether these effects are causative, the researchers say they most likely are, as previous animal and human experiments have turned up similar results.

Source: Hilimire M, DeVylder J, Forestell C. Fermented foods, neuroticism, and social anxiety: An interaction model. Psychiatry Research. 2015.