Two other features of my microbiome attracted the attention of the researchers who examined it. First, the overall biodiversity of my gut community was significantly higher than that of the typical Westerner, which I decided to take as a compliment, though the extravagantly diverse community of microbes on my skin raised some eyebrows. “Where have your hands been, man?” Jeff Leach of the American Gut project asked after looking over my results. My skin harbors bacteria associated with plants, soil and a somewhat alarming variety of animal guts. I put this down to gardening, composting (I keep worms too) and also the fact that I was fermenting kimchi and making raw-milk cheese, “live-culture” foods teeming with microbes.

Compared to a rain forest or a prairie, the interior ecosystem is not well understood, but the core principles of ecology — which along with powerful new sequencing machines have opened this invisible frontier to science — are beginning to yield some preliminary answers and a great many more intriguing hypotheses. Your microbial community seems to stabilize by age 3, by which time most of the various niches in the gut ecosystem are occupied. That doesn’t mean it can’t change after that; it can, but not as readily. A change of diet or a course of antibiotics, for example, may bring shifts in the relative population of the various resident species, helping some kinds of bacteria to thrive and others to languish. Can new species be introduced? Yes, but probably only when a niche is opened after a significant disturbance, like an antibiotic storm. Just like any other mature ecosystem, the one in our gut tends to resist invasion by newcomers.

You acquire most of the initial microbes in your gut community from your parents, but others are picked up from the environment. “The world is covered in a fine patina of feces,” as the Stanford microbiologist Stanley Falkow tells students. The new sequencing tools have confirmed his hunch: Did you know that house dust can contain significant amounts of fecal particles? Or that, whenever a toilet is flushed, some of its contents are aerosolized? Knight’s lab has sequenced the bacteria on toothbrushes. This news came during breakfast, so I didn’t ask for details, but got them anyway: “You want to keep your toothbrush a minimum of six feet away from a toilet,” one of Knight’s colleagues told me.

Some scientists in the field borrow the term “ecosystem services” from ecology to catalog all the things that the microbial community does for us as its host or habitat, and the services rendered are remarkably varied and impressive. “Invasion resistance” is one. Our resident microbes work to keep pathogens from gaining a toehold by occupying potential niches or otherwise rendering the environment inhospitable to foreigners. The robustness of an individual’s gut community might explain why some people fall victim to food poisoning while others can blithely eat the same meal with no ill effects.

Our gut bacteria also play a role in the manufacture of substances like neurotransmitters (including serotonin); enzymes and vitamins (notably Bs and K) and other essential nutrients (including important amino acid and short-chain fatty acids); and a suite of other signaling molecules that talk to, and influence, the immune and the metabolic systems. Some of these compounds may play a role in regulating our stress levels and even temperament: when gut microbes from easygoing, adventurous mice are transplanted into the guts of anxious and timid mice, they become more adventurous. The expression “thinking with your gut” may contain a larger kernel of truth than we thought.

The gut microbes are looking after their own interests, chief among them getting enough to eat and regulating the passage of food through their environment. The bacteria themselves appear to help manage these functions by producing signaling chemicals that regulate our appetite, satiety and digestion. Much of what we’re learning about the microbiome’s role in human metabolism has come from studying “gnotobiotic mice” — mice raised in labs like Jeffrey I. Gordon’s at Washington University, in St. Louis, to be microbially sterile, or germ-free. Recently, Gordon’s lab transplanted the gut microbes of Malawian children with kwashiorkor — an acute form of malnutrition — into germ-free mice. The lab found those mice with kwashiorkor who were fed the children’s typical diet could not readily metabolize nutrients, indicating that it may take more than calories to remedy malnutrition. Repairing a patient’s disordered metabolism may require reshaping the community of species in his or her gut.

Keeping the immune system productively engaged with microbes — exposed to lots of them in our bodies, our diet and our environment — is another important ecosystem service and one that might turn out to be critical to our health. “We used to think the immune system had this fairly straightforward job,” Michael Fischbach, a biochemist at the University of California, San Francisco, says. “All bacteria were clearly ‘nonself’ so simply had to be recognized and dealt with. But the job of the immune system now appears to be far more nuanced and complex. It has to learn to consider our mutualists” — e.g., resident bacteria — “as self too. In the future we won’t even call it the immune system, but the microbial interaction system.” The absence of constructive engagement between microbes and immune system (particularly during certain windows of development) could be behind the increase in autoimmune conditions in the West.