The temples play a role in the Hindu epic poem, the Mahābhārata, where the temples are traditionally believed to have been the site where the Pandava brothers spent a significant portion of their exile. It is also traditionally believed by Hindus to be the site where the brothers engaged in a riddle contest with the Yakshas, as described in the Yaksha Prashna. Another tradition states that the Hindu deity Krishna laid the foundation of the temple, and established a hand-made shivling in it.