One of the most powerful psychedelics, dimethyltryptamine (DMT), has a history that extends back to pre-Columbian South America in the form of Ayahuasca, a brewed drink capable of inducing a psychedelic experience and used in ceremonies and shamanic medicine among indigenous people.  The strong alteration of state of consciousness that the molecule can produce earned DMT the nickname “The Spirit Molecule.” Animals, including humans, produce DMT endogenously, but the physiological function of DMT remains unknown.
DMT is contained in different concentration in various plants including Mimosa hostilis, Mimosa tenuiflora, Psychotria viridis, and Diplopterys cabrerana. 
Even though DMT metabolizes quickly, it leaves users with profound religious and spiritual experiences. Because of this, DMT is still legal in countries like Brazil, but only for religious purposes. That is slowly starting to change though, thanks to the other legal loophole that permits DMT usage: research.
As the world of psychotherapy marches towards an acceptance of psychedelics, DMT is showing a lot of potential as a treatment for several psychological maladies that were previously thought to be beyond the reach of pharmacology.  Whatever the reason for using DMT, be it spiritual or therapeutic, purity and efficiency are two factors to consider when choosing an extraction method.
Traditional religious practitioners commonly employed the direct extraction method as the simplest method for extracting DMT. Using a process known as maceration, ground up plant material is allowed to sit in a variety of solvents for an extended period of time. The solvent slowly extracts DMT, and then the filtration process isolates it. The solution can be shaken to help diffuse DMT into the solvent. This technique has been effective for centuries, but it does require waiting several days or weeks to maximize the extraction yields from the plant material. For those who are willing to wait, the final variable becomes which solvent provides the highest purity. Ayahuasca is typically made with boiled water, but there are many more options available now compared to pre-Columbian South America. One study tested this question, and found a short list of solvents that prove to be the most efficient.  n-Hexane, ethyl acetate, n-butanol, dichloromethane, chloroform, anhydrous ethanol, sodium sulfate, sodium chloride, sodium hydroxide, and ammonium hydroxide all produce a purity of 80-95%. However, another study found that soaking the material in hydrochloric acid for 24 hours prior to the maceration led to purity above 95%.  This study also claimed that hydrochloric acid could shorten the extraction time, but not as significantly as other available extraction methods. Using these solvents over water puts an added emphasis on the filtration process, though. If the extracted DMT is meant for human consumption, it is essential to make sure that the final product is clear of any remaining solvents to ensure safety.
Soxhlet extraction allows for more rapid extraction and higher yields from less plant material compared to maceration.  Continuously heating, filtering, and recycling the solvent allows for the isolation of DMT in a matter of hours instead of days. This technique is relatively new when compared to the centuries old direct method and DMT does not degrade significantly when exposed to heat.  One experiment employed methanol as solvent and the solution was heated to 60 degrees Celsius for three 1-hour periods.  At the end of the experiment, there were more plant derived impurities in the DMT compared to other traditional methods. So if speed and yield are priorities over purity, Soxhlet extraction may prove a superior strategy.
Matrix Solid-Phase Dispersion Method
An extraction technique that combines the best of the previously mentioned methods is matrix solid-phase dispersion.  In one experiment, researchers crushed plant material from Anadenanthera colubrina and Mimosa tenuiflora (both in the subfamily Mimosoideae), and combined it with n-hexane as a solvent. They then placed the solution under vacuum and heated it to temperatures as high as 280 °C. After allowing increased DMT extraction by letting it sit for 24 hours, the researchers eventually filtered and purged the solvent from the solution. The heating procedure takes 29 minutes, followed by the 24 hour absorption period, but the remaining DMT had a purity between 85-90%. This means that matrix solid-phase dispersion produces higher purity than Soxhlet extraction, but is significantly faster than direct extraction. Considering the active heating process only takes 29 minutes, the scalability to allow mass production seems feasible using this extraction method. If DMT does ever receive regulatory status, this may prove the most efficient way to mass isolate the spirit molecule.
- Cameron, Lindsay P., and David E. Olson. “Dark classics in chemical neuroscience: N, N-Dimethyltryptamine (DMT).” ACS chemical neuroscience 9.10 (2018): 2344-2357.
- Hirshfeld-Flores, A. (2002). DMT: The Spirit Molecule: A Doctor’s Revolutionary Research Into the Biology of Near-Death and Mystical Experiences. American Journal of Psychiatry, 159(8), 1448–1449. Blackledge, Robert D., and Charlotte M. Taylor. “Psychotria viridis-A Botanical Source of dimethyltryptamine (DMT).” Microgram 1.1-2 (2003): 18-22.
- Reckweg, Johannes T., et al. “The clinical pharmacology and potential therapeutic applications of 5‐methoxy‐N, N‐dimethyltryptamine (5‐MeO‐DMT).” Journal of Neurochemistry 162.1 (2022): 128-146.
- Abubakar, Abdullahi R., and Mainul Haque. “Preparation of medicinal plants: Basic extraction and fractionation procedures for experimental purposes.” Journal of pharmacy & bioallied sciences 12.1 (2020): 1.
- Rossi, Giordano Novak, et al. “Internet method for the extraction of N, N-dimethyltryptamine from Mimosa hostilis roots: Does it really extract dimethyltryptamine?.” Journal of Psychedelic Studies 3.1 (2019): 1-6.
- Gaujac, Alain, et al. “Application of analytical methods for the structural characterization and purity assessment of N, N-dimethyltryptamine, a potent psychedelic agent isolated from Mimosa tenuiflora inner barks.” Microchemical Journal 109 (2013): 78-83.
- López-Bascón, M. A., and MD Luque De Castro. “Soxhlet extraction.” Liquid-phase extraction. Elsevier, 2020. 327-354.
- de Oliveira Silveira, Gabriela, et al. “Stability evaluation of DMT and harmala alkaloids in ayahuasca tea samples.” Molecules 25.9 (2020): 2072.
- Fasanello, Jack A., and Andrea D. Placke. “The isolation, identification, and quantitation of dimethyltryptamine (DMT) in Mimosa hostilis.” Microgram 5 (2007): 41-52.
- Gaujac, Alain, et al. “Determination of N, N-dimethyltryptamine in Mimosa tenuiflora inner barks by matrix solid-phase dispersion procedure and GC–MS.” Journal of Chromatography B 881 (2012): 107-110.