"So … what am I doing here, anyway?"

Even the most nimble-minded among us have pondered that question after walking into a room with some purpose in mind — to get something, perhaps? — only to blank on what that purpose was. Now a new study suggests that it's the very act of walking through a doorway that causes these strange memory lapses.

"Entering or exiting through a doorway serves as an 'event boundary' in the mind, which separates episodes of activity and files them away," said lead researcher Gabriel Radvansky, a psychologist at the University of Notre Dame. "Recalling the decision or activity that was made in a different room is difficult because it has been compartmentalized."

In our minds, like in the movies, threshold-crossing signals the end of a scene.

As detailed in the Quarterly Journal of Experimental Psychology, the explanation follows from a series of experiments that probed the relationship between memory and various types of home wandering. First, Radvansky assigned a group of study participants the task of selecting an object from one table and exchanging it for an object at a different table in another room. He then had a second group perform the same task between tables that were an equal distance apart, but in the same room.

The difference in the two groups' performances was "big enough to drive a truck through," Radvansky told Life's Little Mysteries, a sister site to LiveScience. Despite the simplicity of their task, "people were two to three times as likely to forget what they were supposed to do after walking through a doorway." This suggested that doorways acted as mental blocks, impeding our ability to retrieve memories formed elsewhere. [10 Hilarious Contributions to Science]

The finding held true when the participants navigated both real-world and virtual settings.

But was it actually threshold-crossing that caused their memory lapses, or was it simply being in a different environment than the one in which they learned their task? To find out, Radvansky had the volunteers perform another object-exchanging task, but this time, the task required them to pass through several doorways leading back to the room in which they started. As it turned out, their memories failed them in this scenario just as they did in the other threshold-crossing scenarios. "When they went through multiple doorways, the error rate increased," he said. This suggests that the act of passing through doorways, rather than the fact of being in a different environment, kills memory, he said.

So why does this happen? "When we are moving through the world, it is very continuous and dynamic and to deal with it more effectively, we parse things up," Radvansky said. Neuroscientists have begun imaging the brains of people crossing event boundaries and, from these studies, are just beginning to piece together how the brain performs this function. "There are a lot of [brain] areas that light up at different kinds of event boundaries."

Mental event boundaries are useful because they help us organize our thoughts and memories. But when we're trying to remember that thing we were intending to do… or get… or maybe find… they can be annoying.

"I think architects are interested in this research because they want to design spaces that are more effective," Radvansky said. "For example, they might need to consider where you need doorways and where you don't."

This article was provided by Life's Little Mysteries, a sister site to LiveScience. Follow us on Twitter @llmysteries, then join us on Facebook. Follow Natalie Wolchover on Twitter @nattyover.