On the Origins of Ayahuasca

The ayahuasca drink is made from the stem of the ayahuasca vine. Sometimes, but rarely, the drink is made from the vine alone; almost invariably other plants are added. It is in fact this companion plant that contains the potent hallucinogen dimethyltryptamine; the vine contains MAO inhibitors. How in the world did indigenous peoples in the Upper Amazon come up with the idea of combining DMT with an MAO inhibitor? And when and where did they first do it?