From Medical News Today:
Internal and external cues, such as circadian rhythms and eating, significantly affect sleep. Circadian rhythms are essential biological processes or functions that follow a 24-hour cycle based on the body’s internal clock. One of the most important circadian rhythms is the sleep-wake cycle. Factors that alter or throw off the sleep-wake cycle can cause sleep disturbances. Intestinal metabolism is closely connected to brain function by way of the circulatory system and vagus nerve, which create a network called the “brain-gut axis” or “microbiota-gut-brain axis.” Research shows that the gut microbiome (the community of bacteria, viruses, and fungi that live in the gut) has an effect on elements of cognitive function, brain development, memory formation, circadian rhythmicity, and mental health.
When and what people eat affects the composition, size, and daily rhythms of the gut microbiota. Changes to the gut microbiota can alter intestinal metabolism because microbes belonging to the microbiota produce many gut metabolites — the molecules that result from the chemical reactions that occur during the process of digestion. Therefore, changing their diet may potentially improve a person’s sleep or reduce sleep problems. Should this prove to be the case, it would serve as a natural, fairly simplistic alternative treatment to sleep medications, which can have a range of negative side effects, including daytime drowsiness and gastrointestinal problems.
More here.