Social memory and ritual performance