In a classic test of learning ability, Matthews gave mice a treat – white bread with peanut butter – as a reward to encourage them to learn to run through a maze. When she laced the treat with a tiny bit of Mycobacterium vaccae, she found that the mice ran through the maze twice as fast as mice that were given plain peanut butter. This suggests that they had learned to navigate the maze faster, Matthews says.

Moreover, the mice given the bacteria continued to run the maze faster than those without it for 18 more trials over the next six weeks, showing they weren't just made more alert by a surprise change to their treat. This effect lasted for four weeks after the last piece of doctored peanut butter was given to the mice.

Speedy solvers

Matthews believes this was caused by the effect M. vaccae has on the immune system, something that was investigated in 2007 by Chris Lowry, now at the University of Colorado at Boulder.

Lowry was trying to explain why sick people – who have activated immune systems – often become depressed and sluggish, which could be an adaptation that speeds recovery.

This result led Matthews to investigate whether the bacteria's effect on the brain extended to a more general difference in cognitive function – and she found that it did.

Focus on that maze

The bacteria may speed up learning because the Raphe nuclei stimulate a brain region called the hippocampus, which handles spatial memory, she says.

But the bacteria also changed the mice's mood – they showed less behaviour that indicates anxiety, such as grooming and searching, perhaps analogous to the calmer behaviour immune activation triggers in people.

This is likely to have been caused by changes to the higher mental functions in the forebrain, which perhaps allowed them to focus better on the maze.

Matthews says that exposure to soil bacteria may affect human brains too. "It just shows that we evolved with dirt as hunter-gatherers," she says. "So turn off your TV and go work in your garden, or walk in the woods."