Gardening is my Prozac. The time I dedicate to training tomato vines or hacking at berry bushes seems to help me stave off feelings of sadness or dread and calm the chatter in my mind. My vegetable beds have even buoyed me through more acute stressors, such as my medical internship, my daughter’s departure for college, and a loved one’s cancer treatment. I’m not alone in appreciating the antidepressant and anti-anxiety effects of gardening—countless blogs are dedicated to this very subject, and a rash of new studies has documented that spending time around greenery can lead to improved mental health.

The idea that microbes in our environment might impact our health was not new to me. It’s well-established that the microbes in soil enhance the nutritional value of food and, as found in studies of farm children in Bavaria and among the Indiana Amish, improve immune function. (Researchers were finding that exposure to a diversity of microbes early in life led to fewer allergies.) But garden microbes acting as mood enhancers—well, this was news to me.“How does this work?” I asked Jill Litt several years ago when I first became interested in what I call gardening’s “bio-euphoric” effect and was wondering whether to prescribe this activity to my depressed patients. Litt, a professor at the University of Colorado School of Public Health, was studying gardening’s impact on a variety of health outcomes—including mood disorders. She rattled off a list of possible explanations, including that gardens create community, encourage physical activity, offer a bounty of nutrient-rich food, and expose one to Vitamin D-producing sunshine, which helps regulate serotonin, the “happiness” neurotransmitter. But then Litt surprised me by adding, “Also there are the microbes themselves. We have no idea what they are doing.”

I soon discovered that there is, in fact, evidence to back up this idea. It’s a smattering of data, and most of it has been collected on our distant cousins, the mice, but it is still compelling.

This investigation into the soil-mood connection began, like much of science, quite serendipitously. British researchers were testing whether immune stimulation with Mycobacterium vaccae, a harmless microbe found in soil and water and potentially on unwashed vegetables, might help treat lung cancer in humans. While they discovered unchanged life expectancy in the subjects treated with the M. vaccae, they were surprised that these patients scored much higher on a standard quality-of-life questionnaire than the controls. Somehow the bug had enhanced their mood.

This finding inspired another researcher, Chris Lowry, a behavioral endocrinologist at the University of Colorado Boulder, to inject heat-killed M. vaccae into the bronchi of mice. The rodents, like the cancer patients, seemed to derive a psychological benefit from the treatment, exhibiting less depression and anxiety on a stressful “forced swim test.” In their article in Neuroscience, Lowry and his colleagues hypothesize that the immune reaction to M. vaccae activates the release of brain serotonin leading to reduced stress-related behavior.

Building on Lowry’s work, Susan Jenks and Dorothy Matthews, two researchers at Sage Colleges in Troy, New York, decided to administer M. vaccae to their mice and perform a new set of behavioral tests. Instead of using the heat-killed M. vaccae used in previous experiments, they cultured the live organism and fed it to the mice via a concoction of Wonderbread and peanut butter. It occurred to me that this exposure method most closely mirrored how I might come in contact with M. vaccae: by eating the casually washed greens that I regularly harvest from my backyard.

“It was just amazing,” Jenks said, discussing a maze test designed to expose rodents to stressful new situations. “We would place them in the maze and could clearly see that there were some mice doing better than others. We would think: ‘Is that the M. vaccae [mouse]?’ And sure enough it was.”

Forever in search of safe, low-tech solutions that I can offer my patients, I asked Jenks whether her experiment was essentially suggesting that M. vaccae exposure by eating backyard veggies or digging with glove-free hands could be a potential new antidepressant therapy.

Daphne Miller collecting late-season parsley tomatoes and pineapple guavas for her backyard compost in Berkeley California.

“What our research suggests is that eating, touching, and breathing a soil organism may be tied to the development of our immune system and our nervous system. But you have to understand that we fed our mice much more of that organism than you are likely to find in a peck of dirt—it was more like a drug dose.”

In fact, an entire raised bed in my garden is unlikely to contain as much M. vaccae as what Jenks was serving her mice.

Our well-being likely depends on more early and frequent exposure to a diverse group of bacteria, fungi, protozoa, and worms.

Still wanting a treatment I could offer my patients, I called Jack Gilbert, a marine microbial ecologist by training, who teaches at the University of Chicago. Gilbert co-founded the Earth Microbiome Project and American Gut, two ambitious collaborative projects seeking to understand how humans and other animals interact with their microbial environments. Gilbert had previously shared with me that his son’s autism diagnosis had prompted his interest in the potential neuroregulatory effects of microbes.

When I asked him what I might advise my patients based on these findings, he sighed.

“Every talk I give, there are parents that want something. I totally get it. We want that thing that will help our kids feel better.

“All this research is really fascinating, but we don’t have enough information to make any claims. If I were to say to everyone, ‘Move to a farm, buy a dog, and eat more raw veggies,’ those statements would be vacuous from an experimental or clinical perspective.”

Speaking with Jenks and Gilbert reminded me that M. vaccae is not an isolated therapy. In fact, it is just one of an enormous palette of microbes that have been interacting and coevolving with us since our earliest days. Our immunological and psychological well-being likely depends on more early and frequent exposure to a diverse group of bacteria, fungi, protozoa, and worms than it does on any one organism.

These creatures, which interact with us through our skin, lungs, and gut, are what Graham Rook, physician, microbiologist, and professor emeritus at University College London, refers to as “Old Friends.” I met Rook last year at an evolutionary medicine meeting at the University of Arizona where he presented a series of compelling studies in support of his “Old Friend” theory of immune dysregulation: that a mismatch between our DNA and our modern microbe-depleted environment is responsible for a recent increase in chronic health problems, including autoimmune diseases and depression.

So what to advise my patients? I agree with Jenks and Gilbert. Microbiome research is still in its infancy, and there is much to discover before we can make definitive prescriptions. But there is compelling evidence that we need a diversity of organisms found in animals, plants, soil, water, and air for optimal functioning of our immune and nervous systems. I now equate preserving ecological diversity in our surroundings with protecting our own health.

On a large scale, we can begin to do this by increasing the diversity of what we grow on our farms because agriculture, covering more than a third of the earth’s land surface, is an obvious reservoir for biodiversity. Our prevailing system of crop monoculture has severely limited the variety of organisms hiding beneath the soil, lying on the plants, and roaming the fields. The herbicides and pesticides used in monocultures narrow this spectrum further. We can start to shift to a more diversified system of farming by patronizing farms that grow a range of crops and by educating friends, neighbors, medical providers, and lawmakers about the health importance of this type of agriculture.

Even closer to home, perhaps the best place for us each to begin is with our own backyard plot or window box. Planting a rainbow of seeds, avoiding the use of garden chemicals, nourishing the soil with plant matter, digging with our hands, and eating the bounty—while not guaranteed to replace a pharmaceutical grade antidepressant—is a wonderful chance to hang out with “Old Friends.”