A mind palace is a memory technique used to increase memory. It is achieved through imagining of a place, be it real or created, and depositing memories there for later use. Sherlock Holmes and Charles Augustus Magnussen both have mind palaces, the latter using his to store valuable blackmail information.
After it appeared that Jim Moriarty had returned from the dead, Sherlock used his mind palace to determine whether this was possible. After using his mind palace to investigate the case surrounding Emilia Ricoletti, he determined that Moriarty's survival was not possible.
Mind palaces appeared in the Sherlock episodes: