As this New York Times article explains, the ancient Greeks knew how. Thanks to a first-century BC textbook on rhetoric, we can, too.
The answer lies in a discovery supposedly made by the poet Simonides of Ceos in the fifth century B.C. After a tragic banquet-hall collapse, of which he was the sole survivor, Simonides was asked to give an account of who was buried in the debris. When the poet closed his eyes and reconstructed the crumbled building in his imagination, he had an extraordinary realization: he remembered where each of the guests at the ill-fated dinner had been sitting. Even though he made no conscious effort to memorize the layout of the room, it nonetheless left a durable impression. From that simple observation, Simonides reportedly invented a technique that would form the basis of what came to be known as the art of memory. He realized that if there hadn’t been guests sitting at a banquet table but, say, every great Greek dramatist seated in order of birth — or each of the words of one of his poems or every item he needed to accomplish that day — he would have remembered that instead. He reasoned that just about anything could be imprinted upon our memories, and kept in good order, simply by constructing a building in the imagination and filling it with imagery of what needed to be recalled. This imagined edifice could then be walked through at any time in the future. Such a building would later come to be called a memory palace.
Virtually all the details we have about classical memory training — indeed, nearly all the memory tricks in the competitive mnemonist’s arsenal — can be traced to a short Latin rhetoric textbook called “Rhetorica ad Herennium,” written sometime between 86 and 82 B.C. It is the only comprehensive discussion of the memory techniques attributed to Simonides to have survived into the Middle Ages. The techniques described in this book were widely practiced in the ancient and medieval worlds. Memory training was considered a centerpiece of classical education in the language arts, on par with grammar, logic and rhetoric. Students were taught not just what to remember but how to remember it. In a world with few books, memory was sacrosanct.
(H/T: James McGrath)