The BBC series Sherlock makes several references to Holmes’s “mind palace,” an imaginary warehouse where he stores important memories. When he wants to remember something, he closes his eyes and imagines himself walking through the warehouse looking at various memories until he comes upon the memory he is seeking. I believe his mind palace was first mentioned in Season 1, “The Hounds of Baskerville,” when he took a whirlwind trip through his mind palace and solved the mystery by finding the memory he was looking for.
Sherlock Holmes isn’t the inventor of the mind palace. Credit for that invention goes to a gentleman who lived some several hundred years B.C. Marcus Tullius Cicero tells the story of the inventor in his book De Oratore. Here’s what Cicero had to say:
… I am grateful to the famous Simonides of Ceos, who is said to have first invented the science of mnemonics.
He inferred that persons desiring to train this faculty must select localities and form mental images of the facts they wish to remember and store those images in the localities, with the result that the arrangement of the localities will preserve the order of the facts, and the images of the facts will designate the facts themselves, and we shall employ the localities and images respectively as a wax writing tablet and the letters written on it. De Oratore,II:lxxxvi:350-355 (pages 465-467 of the Internet Archive translation).
Thus we see that the mind palace is a mnemonic device which people have been using for over 2,000 years. Of course, few people have as vast a mind palace as either Holmes or his nemesis Charles Augustus Magnusson.
I'm going off on a tangent to say I can understand why they changed Lestrade's name from Giles to Greg, but I don't know why they named the blackmailer Charles Augustus Magnusson. In the original Holmes story the villain was Charles Augustus Milverton--a perfectly good name for a villain.