A deity appeared before Kumárakassapa in Andhavana and propounded a riddle:
"There is an anthill burning day and night. The brahmin said: 'Take your tool, Sumedha (sage), and dig.' As the brahmin dug, he came across, successively, a bar, a frog, a forked passage, a strainer, a tortoise, a cleaver, a joint of meat - all of which he was told to cast out and dig on. He then came across a cobra, which he was asked not to harm, but to worship."
At the suggestion of the deity, Kassapa related the story to the Buddha, who solved the riddle. The anthill is the body, the brahmin the arahant, the tool wisdom, digging perseverance, the bar ignorance, the forked passage doubting, the strainer the five nívaranas, the tortoise the fivefold upádána - kkhandhas, the cleaver the fivefold pleasures of sense, the joint of meat passion's delights (nandírága), and the cobra (nága) the arahant monk (M.i.142ff).
According to the Commentary (MA.i.340), Kumárakassapa was not an arahant at the time of the preaching of the sutta. The deity was a deity of the Suddhávása brahma world. He was one of five friends who, in the time of Kassapa Buddha, had entered the Order and who, in order to meditate uninterruptedly, had climbed a rock by means of a ladder which they had then removed, thus cutting off their return. The eldest became an arahant in three days, the second (anuthera) was this deity, who had become an anágámí. The third was Pukkusáti, the fourth Báhiya Dárucíriya and the last Kumárakassapa. This deity was responsible for the arahantship both of Báhiya and Kassapa, for Kassapa took the Vammíka Sutta as the subject of his meditations and thus developed insight.