Thoth was believed to have filled many roles in the world of the gods. It was believed that he invented writing and was the vizier and official scribe of the afterworld. The Book of the Dead was written by him. He and Ma'at were believed to stand on either side of Re in his boat as he (as the Sun) traveled across the sky. It was thought that they also may have directed the course that the boat took. It was widely believed that Thoth invented the magical and hermetic arts, and thus the Tarot deck is frequently referred to as the "Book of Thoth" He was associated with the moon; as the sun vanished, Thoth tried to dispel the darkness with his light.
Thoth is shown attending all major scenes involving the gods, but most especially at the judgement of the deceased. It is here that he (shown as a dog-headed ape) sits on the top of the balance that weighs the heart of the deceased to determine if it is as light as ma'at. The concept of ma'at is one of truth, justice, and "that which is straight". It may even be related to "cosmic order". The baboon Thoth informs the ibis-headed Thoth when the balance is at equilibrium. The ibis-headed Thoth then makes his report to the other gods who then pass judgement on the deceased.