Agamedes

In Greek mythology, Agamedes (Ἀγαμήδης, Agamēdēs) was a son of Erginus (or, according to some traditions, the son of Stymphalus and grandson of Arcas).

Family
Agamedes was father of Cercyon by Epicaste, who also brought to him a stepson, Trophonius, who was by some believed to be a son of Apollo. According to others, Agamedes was a son of Apollo and Epicaste, or of Zeus and Iocaste, and father of Trophonius. In the most common accounts, Trophonius was his brother.

Mythology
The two brothers are said to have distinguished themselves as architects, especially in building temples and palaces. They built Apollo's temple housing the oracle of Delphi. A tradition mentioned by Pindar states that Agamedes and Trophonius, after having built this temple, prayed to the god to grant them in reward for their labor what was best for men. The oracle told the brothers that they would get their reward after seven days and should do whatsoever they wished for until then. They did and were found dead in their beds on the seventh night. Cicero mentions the same story, only shortening the number of days to three. This may connect to the saying of Menander that “those whom the gods love die young.”

They also built a treasury of Hyrieus, king of Hyria in Boeotia. The scholiast on Aristophanes gives a somewhat different account from Charax of Pergamum, and makes them build the treasury for King Augeas. The story about this treasury in Pausanias bears a great resemblance to that which Herodotus relates of the treasury of the Egyptian king Rhampsinit. In the construction of the treasury of Hyrieus, Agamedes and Trophonius contrived to place one stone in such a manner that it could be taken away outside, and thus formed an entrance to the treasury, without anybody perceiving it. Agamedes and Trophonius constantly robbed the treasury; and the king, seeing that locks and seals were uninjured while his treasures were constantly decreasing, set traps to catch the thief. Agamedes was caught in one of these snares, and with profound grief, Trophonius cut off his head to keep Agamedes's identity secret.

After this, Trophonius was immediately swallowed up by the earth and turned into an immortal subterranean god. On this spot there was afterwards, in the grove of Lebadeia, the so-called cave of Agamedes, with a column by the side of it. Here also was the oracle of Trophonius, and those who consulted it first offered a ram to Agamedes and invoked the deified man.

The question as to whether the story about the Egyptian treasury is derived from Greece, or whether the Greek story was an importation from Egypt, has been answered by modern scholars in both ways; but Müller has rendered it very probable that the tradition took its rise among the Minyans, was transferred from them to Augeas, and was known in Greece long before the reign of Psammetichus I, during which the intercourse between the two countries was opened.

In popular culture

 * In The Dark Prophecy, Agamedes is shown to be an orange-colored ghost with the name of Agamethus. He lives in the Waystation and helps Apollo throughout the book. At the end of the book, he leaves Waystation to find his half-brother, Trophonius.