Kava (Piper methysticum) is an ethnomedicinal shrub native to the Polynesian islands with well-established anxiolytic and analgesic properties. Its main psychoactive principles, kavalactones, form a unique class of polyketides that interact with the human central nervous system through mechanisms distinct from those of conventional psychiatric drugs. However, an unknown biosynthetic machinery and difficulty in chemical synthesis hinder the therapeutic use of kavalactones. In addition, kava also produces flavokavains, which are chalconoids with anticancer properties structurally related to kavalactones. Here, we report de novo elucidation of the key enzymes of the kavalactone and flavokavain biosynthetic network. We present the structural basis for the evolutionary development of a pair of paralogous styrylpyrone synthases that establish the kavalactone scaffold and the catalytic mechanism of a regio- and stereo-specific kavalactone reductase that produces a subset of chiral kavalactones. We further demonstrate the feasibility of engineering styrylpyrone production in heterologous hosts, thus opening a way to develop kavalactone-based non-addictive psychiatric therapeutics through synthetic biology.