Whether it’s the buzz from a strong cup of coffee or the sluggishness you feel after a heavy meal, you’ve likely experienced how some foods and beverages can affect your energy and alertness. But did you know that what you eat can also affect your sleep?

“Food, and the nutrients in food, can affect your sleep in two ways,” says Jenna Gress Smith, Ph.D., clinical psychologist and founder of Arizona Sleep & Health. “First, eating a healthy diet of whole foods will provide the nutrients—magnesium, for instance—your body needs to function optimally, and that includes your sleep cycle. Second, new research suggests a direct link between certain foods and better sleep.”

Sleep and metabolism are both regulated in part by our circadian rhythms, the body’s internal clocks, which regulate hormones and other metabolic processes. “Research has also connected our gut biome to the quality of our sleep,” says Gress Smith. “The specific types of foods and beverages we consume, as well as their quantity and timing, affect our sleep quality and duration.”

Of course, no one food is going to knock you out for the night. Plus, sleep is a complex process that is impacted by many factors, including anxiety, stress, and other mood disorders, as well as underlying physical conditions.

That said, including these four foods in your diet may make it easier to fall asleep and get a better-quality night’s rest.

1.Kiwi 

Kiwis recently emerged onto the sleep scene after a study found that eating two kiwi fruits one hour before bed significantly increased total sleep time by 13.4 percent and improved sleep efficiency—the time we’re asleep relative to the amount of time we spend in bed—by 5.41 percent. “Researchers guess it’s because kiwis are rich in folate, and low folate levels have been linked to poor sleep,” says Gress Smith.

Kiwis are also rich in vitamins C and E, antioxidants, and serotonin, “which our bodies convert into melatonin, and melatonin promotes better mood and sleep,” Gress Smith says.

2. Tart cherries 

Tart cherries, also called sour cherries, aren’t the same (or as popular) as the sweet snacking cherries available in early summer. But they’re often used for baking or pressed into juice. They contain high levels of antioxidants and tryptophan, says Gress Smith, “which may synergistically create one ‘sleep superfood.’”

Tart cherries also have been shown to help the body release melatonin, and research shows that drinking tart cherry juice before bed can improve sleep time, sleep efficiency, and help with poor sleep. “The antioxidants may also have an anti-inflammatory effect, combating oxidative stress, which can lead to more restful sleep,” Gress Smith says.

3. Fatty fish

Fatty fish, such as albacore tuna, salmon, herring, anchovies, and sardines, may help sleep by providing a healthy dose of omega-3 fatty acids and vitamin D. Both nutrients are involved in the body’s regulation of serotonin, and, consequently, melatonin production.

Salmon in particular stands out for being one of the few foods that provide a meaningful amount of vitamin D, and studies show that low vitamin D levels are linked to poor sleep and sleep disturbances. One study found that participants who ate salmon three times a week for five months had better overall sleep and measurably higher vitamin D levels than those who didn’t. Another review of 19 studies found that the omega-3 fatty acids in salmon may help ease symptoms of anxiety, which can also benefit sleep, Gress Smith says.

4. Nuts, nut butters, and seeds 

“Walnuts, pistachios, and almonds each have their own particular sleep powers,” Gress Smith says. Pistachios are high in melatonin. Walnuts are rich in a specific type of omega-3 fatty acid that may increase serotonin activity; they also are high in many sleep-promoting nutrients, such as tryptophan, isoflavones, magnesium, melatonin, and zinc, all of which have been linked to improved sleep quality. And almonds are rich in magnesium, a mineral that helps regulate your nervous system and promote relaxation.

Seeds contain tryptophan and magnesium, which help promote sleep. A 1-ounce serving of pumpkin seeds has 58 percent of the recommended daily intake of tryptophan, which we need to get from our diet because our bodies don’t produce it. “Chia, sunflower, flax, and hemp seeds are easy to sprinkle in a bowl of yogurt or oatmeal, in your smoothie, or on a salad,” says Gress Smith.