Improving wakefulness in patients with excessive sleepiness associated with narcolepsy or other sleep disorders. It may also be used for other conditions as determined by your doctor. Modafinil is a wakefulness-promoting agent. Exactly how it works is not known, but it is thought to work by altering the natural chemicals (neurotransmitters) in the brain.