Goddess Matangi has been associated in Buddhism and also finds mention in the Divyavadana which is a Buddhist collection of stories concerning previous lives of the Buddha that was probably written around 250-300 C.E. these texts relates Matangi as the daughter of elephant hunter king Matang.
Once upon a time, Ananda who was Lord Buddha`s disciple went out begging for food. While roaming he became very thirsty and saw a girl drawing water from a well. He immediately approached her and requested her for some water and asked for water. The girl refused as she was a daughter of Candala or low caste. Inspite of knowing the fact Ananda was ready to drink water from her hands. As he drank water, the young girl named Prakrti admired his youthful body and became fascinated by him. She desired to have him as her husband.
After Ananda had returned to the monastery, Prakrti requested her mother Mahavidyadhari to use her magical powers and attract Ananda to her. Her mother initially hesitated and refused but when Prakriti threatened suicide her mother agreed to help her. Prakrti mother cleaned an area and built an altar. She then offered flowers in the fire on the altar and began reciting mantras to attract Ananda for her daughter.
Mahavidyadhari`s magic spells compelled Ananda`s heat to crave for Prakrti. She remembered her charm and hence left his monastery to find her. On arriving there, Ananda realized his mistake and prayed to the Buddha to rescue him. Lord Buddha being aware of his predicament nullified the power of the candela woman`s mantras. Ananda thus became calm and returned to the monastery.
When Prakrti came to know that Buddha had overcome his mother`s magic she went to the Buddha. She told him that she desired Ananda and wanted to have him as her husband. The Buddha told her that the only way to execute her desire was to become a nun herself. Prakrti impressed by the teachings of Buddha agreed to be initiated as a nun. She cut off her hair and wore the simple dress of a Buddhist nun.
After Prakrti`s was initiated into the Buddhist order, the Lord narrated her story that put the company between her and Ananda in perspective. He said that in the past there was king named Trisanku who ruled over the elephant hunters. He had a son named Sardulakarna, for whom he wished to have a suitable bride. Trisanku wanted to marry his son with a Brahmin`s daughter named Prakrti. He thought her to be suitable for his son. He thus set out to arrange for a wedding and travelled with an entourage of his ministers. When the Brahman saw that Trishanku was an elephant hunter of low caste he rejected his proposal for a marriage. However Trisanku impressed him with his vast knowledge of spiritual matters and the arts and the sciences. The Brahman thus surrendered and allowed the marriage to take place.
The Brahmin`s daughter was the same Prakrti who in her next life desired Ananda and Trisanku`s son Sardulakarna was Ananda in that life. This explained the mutual attraction of the pair in this life. The elephant-hunter king, the Buddha said, was he himself.