Agamotto is mentioned throughout the film. He was the founder of the Masters of the Mystic Arts and their three sanctuaries thousands of years ago, and created the Eye of Agamotto from the Time Stone as his personal item. At some unknown point, he was succeeded by another sorcerer as the Masters' leader, beginning a series of successions that led to the Ancient One, and then Doctor Strange.
Agamotto appears as the former Sorcerer Supreme for Earth. Before the series began, he was captured, his eye was removed and sealed away in another dimension. He returned in "Eye of Agamotto Part 1", and fully appeared in Part 2, where he is revealed to be evil and wanted his eye back. He was able to change most of the Avengers into their evil counterparts. It took the willpower of Hulk and the mind of Doctor Strange to reseal him back in his dimension.