In Greek mythology, Agamedes /ˌæɡəˈmiːdiːz/ (Ancient Greek: Ἀγαμήδης, Agamēdēs) was a son of Erginus (or, according to some traditions, the son of Stymphalus and grandson of Arcas). He 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.
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 Cicero 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 to do whatsoever they wished for six days and, on the seventh, their greatest wish would be granted. They did and were found dead on the seventh day. The saying "those whom the gods love die young" comes from this story.
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 Rhampsinitus. 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 caught in one of these snares, and Trophonius cut off his head to keep Agamedes's identity secret.