Mimosa tenuiflora (Willd.) Poir., Fabaceae, is a characteristic of northeastern Brazil and is known by the population as “jurema-preta.” The barks have an indole alkaloid called N,N-dimethyltryptamine, a substance that acts in a similar way to serotonin and provides hallucinogenic, anxiolytic, and antidepressant effects. The objective of this study was the optimization of the extraction process of M. tenuiflora using factorial planning to quantify the N,N-dimethyltryptamine present in the standardized extract of M. tenuiflora with monitoring by high-performance liquid chromatography with diode array detector and nuclear magnetic resonance. In order to optimize the extraction process, a 23 factorial design was performed, varying three factors at two different levels and using stirring, temperature, and solvent as independent factors, and the amount of N,N-dimethyltryptamine as dependent factor. After the isolation step, the N,N-dimethyltryptamine was characterized by analytical techniques. In this work, the application of ethanol, stirring, and temperature (25 °C) proved to be the best conditions for the extraction of N,N-dimethyltryptamine in the standardized extract. We also identified the flavoalcaloid yuremamine in the standardized extract of M. tenuiflora through nuclear magnetic resonance analysis. Therefore, both the development of an optimized method for extracting N,N-dimethyltryptamine from the standardized extract of M. tenuiflora and the identification of yuremamine represent a great contribution to the bioprospecting of the M. tenuiflora species. Graphical Abstract: [Figure not available: see fulltext.] © 2022, The Author(s) under exclusive licence to Sociedade Brasileira de Farmacognosia.