The human body is a deeply complex, interconnected system, and researchers continue to uncover the extent to which its functions depend on those connections.

new study by researchers from University of Pennsylvania and Stanford University suggests age-related changes in gut bacteria may contribute to cognitive decline, based on differences observed between young and old mice.

The gut microbiome—essentially an ecosystem made up of trillions of microbes, including bacteria, viruses, fungi, parasites, and more—plays a multi-functional role that has long been known for influencing our digestive and immune systems.

It’s so crucial that some clinicians consider it almost like an organ, though scientists are still uncovering the full scope of its functions.

In recent years, emerging research has proven a direct link between the gut microbiome and cognitive function especially during aging. However, scientists had yet to discover how those signals travel from the gut to the brain or which exact pathways are involved. Until now.

The new study, published in Nature, found that when the immune cells in the gastrointestinal tract detect an accumulation of Parabacteroides goldsteinii—particularly with aging—it triggers an inflammatory response that interferes with the communication between the vagus nerve and the hippocampus, which is responsible for memory formation.

Scientists are still uncovering all the functions of the vagus nerve, which has been described as the body’s information superhighway. But they do know that it plays a critical role in regulating essential unconscious processes such as heart rate and blood pressure, and in this case, sending signals between the gut and the brain.

Despite memory loss being a common part of aging, the findings offer new insight into why cognitive function can vary so widely from person to person.

“We wanted to understand why some very old people remain cognitively sharp while other people see significant declines beginning in their 50s or 60s,” Christoph Thaiss, an assistant professor of pathology at Stanford University, said in a press statement.

“What we learned is that the timeline of memory decline is not hardwired; it’s actively modulated in the body, and the gastrointestinal tract is a critical regulator of this process.”

To test how the vagus nerve and gut microbiome affect cognitive function, researchers studied two groups of mice: a younger set of two-months-old and an older set of 18-month-old mice. The younger mice were tested in a maze before and after cohabitating with the older mice, which allowed them to adopt the older mice’s microbiome.

After the exposure, the younger mice began performing worse on the maze tasks. But once treated with a broad-spectrum antibiotic, “they returned to their youthful, maze-navigating selves,” Popular Mechanics reported.

“The degree of reversibility of age-related cognitive decline in the animals just by altering gut-brain communication was a surprise,” Thaiss said in a press statement. “We tend to think of memory decline as a brain-intrinsic process. But this study indicates that we can enhance memory formation and brain activity by changing the composition of the gastrointestinal tract—a kind of remote control for the brain.”

While the direct relationship to memory loss is newfound, it turns out that vagus nerve stimulation is already an FDA-approved treatment for brain related conditions like epilepsy and depressionPopular Mechanics wrote.

“Our hope is that ultimately these findings can be translated into the clinic to combat age-related cognitive decline in people,” Thaiss said.