Legends vary, but Valmiki is often said to have been a Brahmin named Ratnakar who became a robber. After an encounter with a sage, he transformed into a great sage himself. He meditated for years until anthills grew around him, thereby earning him the name Valmiki (from Sanskrit valmika, “anthill”).