Depakote, also known as valproic acid or divalproex sodium, is a medication primarily used to treat epilepsy, bipolar disorder, and migraines. It works by stabilizing electrical activity in the brain, which helps to prevent seizures and regulate mood swings associated with these conditions.