Do psilocybin or DMT fall under triptans?
No, the term ‘triptans’ refers to anti-migraine medicines. Triptans are, however, derived from tryptamine, a naturally occurring compound that plays a role in various biological processes in the body. Psilocybin and DMT are indeed tryptamines, but they are not triptans. The structure of psilocybin and DMT is, however, very similar to that of certain triptans such as sumatriptan (see below).
And below, DMT and psilocybin:

The term ‘triptans’ therefore mainly refers to these medicines. Due to their structural similarities, psilocybin is also thought to be effective in treating migraine.
More about DMT:
No, psilocybin and DMT traps not within the group triptans. Triptans are medicines specifically developed for the treatment of migraine, such as sumatriptan, rizatriptan and zolmitriptan. These medicines act on the 5-HT1B/1D serotonin receptors and constrict the blood vessels in the brain to relieve migraine attacks.
Psilocybin and DMT On the other hand, these belong to the tryptamines, a broader class of compounds related to the amino acid tryptophan. They have a completely different mechanism of action. Psilocybin is converted in the body into psilocin, which acts primarily on the 5-HT2A receptors and is responsible for psychedelic effects. DMT (N,N-dimethyltryptamine) has a similar structure and also acts on serotonin receptors, but is more potent and has a shorter duration of action, particularly when smoked or vaped.
The confusion arises because both triptans and psilocybin/DMT are based on the tryptamine structure. These structural similarity This means that both can affect serotonin systems, but their medical applications and effects are entirely different. It is interesting to note, however, that it is precisely because of this similarity that psilocybin is being investigated as a potential treatment for migraine, as is also discussed in the forum thread on psilocybin and migraine.
In short: psilocybin and DMT are no triptans, but they do belong to the same chemical family as tryptamines — an important distinction for both medical safety and therapeutic use.