At a banquet given by a nobleman of Thessaly named Scopas, the poet Simonides of Ceos chanted a lyric poem in honour of his host but including a passage in praise of Castor and Pollux. Scopas meanly told the poet that he would only pay him half the sum agreed upon for the panegyric and that he must obtain the balance from the twin gods to whom he had devoted half the poem. A little later, a message was brought in to Simonides that two young men were waiting outside who wished to see him. He rose from the banquet and went out but could find no one. During his absence the roof of the banqueting hall fell in, crushing Scopas and all the guests to death beneath the ruins; the corpses were so mangled that the relatives who came to take them away for burial were unable to identify them. But Simonides remembered the places at which they had been sitting at the table and was therefore able to indicate to the relatives which were their dead. The invisible callers, Castor and Pollux, had handsomely paid for their share in the panegyric by drawing Simonides away from the banquet just before the crash. And this experience suggested to the poet the principles of the art of memory of which he is said to have been the inventor. Noting that it was through his memory of the places at which the guests had been sitting that he had been able to identify the bodies, he realised that orderly arrangement is essential for good memory.
He inferred that persons desiring to train this faculty (of memory) must select places and form mental images of the things they wish to remember and store those images in the places, so that the order of the places will preserve the order of the things, and the images of the things will denote the things themselves, and wc shall employ the places and images respectively as a wax writing-tablet and the letters written on it. — Cicero, De oratore, II, lxxxvi, 351-4
The vivid story of how Simonides invented the art of memory is told by Cicero in his De oratore when he is discussing memory as one of the five parts of rhetoric; the story introduces a brief description of the mnemonic of places and images (loci and imagines) which was used by the Roman rhetors. — Frances Yates, The Art of Memory, 1996