Ānanda has an important role in establishing the order of "bhikkhunis", when he requests the Buddha on behalf of the latter's foster-mother Mahāpajāpati Gotamī () to allow her to be ordained. Ānanda also accompanies the Buddha in the last year of his life, and therefore is witness to many tenets and principles that the Buddha conveys and establishes before his death, including the well-known principle that the Buddhist community should take his teaching and discipline as their refuge, and that the Buddha will not appoint a new leader. The final period of the Buddha's life also shows that Ānanda is still very much attached to the Buddha's person, and he witnesses the Buddha's passing with great sorrow. Shortly after the Buddha's death, the First Council is convened, and Ānanda manages to attain enlightenment just before the council starts, which is a requirement. He has a historical role during the council as the living memory of the Buddha, reciting many of the Buddha's discourses and checking them for accuracy. During the same council, however, he is chastised by Mahākassapa () and the rest of the Saṅgha for allowing women to be ordained and failing to understand or respect the Buddha at several crucial moments. Ānanda continues to teach until the end of his life, passing on his spiritual heritage to his pupils Sāṇavāsī () and Majjhantika (), among others, who later assume a leading role in the Second and Third Councils. Ānanda dies in 463 BCE, and "stūpas" (monuments) are erected at the river where he dies. Ānanda is one of the most loved figures in Buddhism. Ānanda is known for his memory, erudition and compassion, and is often praised by the Buddha for these matters. He functions as a foil to the Buddha, however, in that he still has worldly attachments and is not yet enlightened, as opposed to the Buddha. In the Sanskrit textual traditions, Ānanda is widely considered the patriarch of the Dhamma, who stands in a spiritual lineage, receiving the teaching from Mahākassapa and passing them on to his own pupils. Ānanda has been honored by "bhikkhunis" since early medieval times for his merits in establishing the nun's order. In recent times, the composer Richard Wagner wrote a draft for a libretto about Ānanda, which was made into the opera Wagner Dream by Jonathan Harvey in 2007.