Image copyright SPL Image caption Aspects of a single memory can be scattered throughout the outer "cortex" of the brain

Storing information so that you can easily find it again is a challenge. From purposefully messy desks to indexed filing cabinets, we all have our preferred systems. How does it happen inside our brains?

Somewhere within the dense, damp and intricate 1.5kg of tissue that we carry in our skulls, all of our experiences are processed, stored, and - sometimes more readily than others - retrieved again when we need them.

It's what neuroscientists call "episodic memory" and for years, they have loosely agreed on a model for how it works. Gathering detailed data to flesh out that model is difficult.

But the picture is beginning to get clearer and more complete.

A key component is the small, looping structure called the hippocampus, buried quite deep beneath the brain's wrinkled outer layer. It is only a few centimetres in length but is very well connected to other parts of the brain.

People with damage to their hippocampus have profound memory problems and this has made it a major focus of memory research since the 1950s.

Quick learning

It was in the hippocampus, and some of its neighbouring brain regions, that scientists from the University of Leicester got a glimpse of new memories being formed, in a study published this week.

They used a rare opportunity to record the fizz and crackle of single human brain cells at work, in epilepsy patients undergoing brain surgery.

Image copyright SPL Image caption Single brain cells in the hippocampus can form associations very rapidly

Individual neurons that went crazy for particular celebrities, like Clint Eastwood, could be "trained" to respond to, for example, the Statue of Liberty as well - as soon as the patients were given a picture of Clint in front of the statue.

It seemed that single brain cells, in the hippocampus, had been caught in the act of forming a new association. And they do it very fast.

But that outer wrapping of the brain - the cortex - is also important. It is much bigger than the hippocampus and does myriad jobs, from sensing the world to moving our limbs.

When we have a particular experience, like a trip to the beach, different patches of the cortex are called up to help us process different elements: recognising a friend, hearing the seagulls, feeling the breeze.

So traces of that experience are rather scattered across the cortex. To remember it, the brain needs some sort of index to find them all again.

And that, neuroscientists generally agree, is where the hippocampus comes in.

"Think of the [cortex] as a huge library and the hippocampus as its librarian," wrote the prominent Hungarian neuroscientist Gyorgy Buzsaki in his 2006 book Rhythms of the Brain.

Image copyright Thinkstock Image caption Does the brain have a librarian?

The elements of our day at the beach might litter the cortex like specific books along miles of shelving; the hippocampus is able to link them together and - if all goes well - pull them off the shelf when we want to reminisce.

Completing patterns

Another brand new study, out this week in the journal Nature Communications, looks inside the brain using fMRI imaging to see this filing system in action.

By getting people to learn and remember imaginary scenarios while inside a brain scanner, Dr Aidan Horner and his colleagues at University College London collected the first firm evidence for "pattern completion" in the human hippocampus.

Pattern completion is the mechanism behind a phenomenon we all recognise, when one particular aspect of a memory - the smell of salt in the air, perhaps - brings all the other aspects flooding back.

"If you have an event that involves the Eiffel tower, your friend and, say, a pink balloon… I can show you a picture of the Eiffel tower, and you remember not only your friend, but also the pink balloon," Dr Horner told the BBC.

While his volunteers had just this sort of experience inside the scanner, Dr Horner saw interplay between different parts of the cortex, associated with different parts of a memory, and the hippocampus.

The brain activity flowed in a way that showed "pattern completion" was indeed underway - and the cortex and the hippocampus were working just like the library and the librarian in Prof Buzsaki's analogy.

Image copyright SPL Image caption The hippocampus (darker brown) is centrally located and very well connected

"If I cue you with the location, and I get you to explicitly retrieve the person, what we also see is activation in the region that's associated with the object for that event," Dr Horner explained. "So even though it's task-irrelevant, you don't have to retrieve it, it seems that we still bring that object to mind.

"And the extent to which we see that activation in the 'object' region correlates with the hippocampal response. So that suggests that it's the hippocampus that's doing the pattern completion, retrieving all these elements.

"It's able to act as an index, I suppose, by linking these things together - and doing it very very quickly, that's the key thing."

If the cortex were left to make its own connections between the fragments of a memory, he added, it would be far too slow.

"That's clearly not a system we want, if we're going to remember a specific event that happens once in a lifetime."

Image copyright SPL Image caption Beat this: Episodic memory is a key challenge for artificial intelligence systems

Dr Horner said the findings also dovetail nicely with the single-neuron, celebrity-spotting results from the Leicester study.

"We can look across the cortex and the hippocampus, and we can relate it to recollection. But what they can do is say look, these cells [in the hippocampus] have learned really quickly.

"So that's the sort of underlying neural basis of what we're looking at, at a slightly broader scale."

Science, it seems, is finally managing to unpick the way our brains record our lives. It is a remarkable, beautiful, fallible system.

Building some sort of memory storage like this is regarded as one of the next key challenges for researchers trying to build intelligent machines.

Our own memories, for all their flaws, are a hard act to follow.

Follow Jonathan on Twitter.