What the vagus nerve actually senses in the gut
The vagus nerve is the main neural cable of the gut-brain axis, and roughly four out of five of its fibers are afferent, meaning they carry information upward to the brain. Vagal endings near the gut wall do not touch most bacteria directly; instead they respond to signals microbes influence, including short-chain fatty acids, gut hormones released by enteroendocrine cells, and serotonin produced largely in the gut.
Specialized enteroendocrine cells called neuropods can form synapse-like contacts with vagal fibers, giving the gut a fast signaling line to the brainstem.
Bidirectional signaling and its limits
Traffic also runs downward, with vagal output shaping motility, secretion, and inflammation. Vagotomy experiments in animals can blunt some microbe-driven behavioral effects, supporting a vagal role in mood and cognition. In humans the picture is far less settled.
Note that most gut-derived serotonin acts locally and does not freely cross into the brain, so claims that gut bacteria directly set brain serotonin are oversimplified. This is general educational information, not medical advice.