One of the most fascinating observations within the craft, is the ability for some skilled brethern to learn huge portions of ritual. Of course all members of the craft who rise through the various offices must learn some lines and remember their duties in the lodge, and as we go through the various degrees ourselves, we are given phrases and various private ways of proving we are who we claim to be.
The process of rememberance are not new, the techniques go back to antiquity, before the advent of the printing press, writing materials were scarce and expensive - many also could not read or write, therefore a trained memory was seen as a valuable asset.
It is attributed to the Greek poet Simonides the creation of the 'art of artificial memory' who could remember the names of all those who were present at a great banquet, who after a great accident could recall each guest in detail - largely based on the position of the guests and the images he associated with each (rules for images and rules for places).
After Simonides, these techniques were perfected by several teachers, one manuscript, writen by an anonymous man - known as 'Ad Herennium' -http://en.wikipedia.org/wiki/Rhetorica_ad_Herennium
It formalises the theme that in order to remember something, one should remember lines as being part of a building, with various rooms, and to associate striking images in each room.
http://en.wikipedia.org/wiki/Method_of_loci - discusses the concept of the memory palace, again linking the mason (the 'builder') creating the architecture of 'thoughts'