Today is a feast I didn't know we commemorated in the Church--the Presentation of the Virgin Mary in the Temple. While not in Scripture, tradition has long held that in thanksgiving for her birth, Mary's parents, Joachim and Anne took her to the temple when she was three years old to be educated there. (I've also read that this took place when Mary was 12.)
This is also a possible explanation for Mary's perpetual virginity--that as a woman dedicated in the Temple at a young age, Mary was promised to God, hence her question to the Angel at the Annunciation: "How can this be, since I do not know man?"
Some scholars point to the existence of the Essenes, a Jewish sect which flourished from a few centuries before Christ to about a century after, which espoused voluntary poverty, celibacy and asceticism, as proof that the possibility of an order of celibate women who lived in the temple around the first century could have existed.
In fact, there is a theory that Anna in Luke 2:36-38, was one such woman, and, perhaps, recognized the young Mary as having grown up among the women of the temple when she brought Jesus in for His own presentation and circumcision, 8 days after His birth.
Hat tip to Fr Dwight Longenecker.