There is considerable interest in screening ultralarge chemical libraries for ligand discovery, both empirically and computationally1–4. Efforts have focused on readily synthesizable molecules, inevitably leaving many chemotypes unexplored. Here we investigate structure-based docking of a bespoke virtual library of tetrahydropyridines—a scaffold that is poorly sampled by a general billion-molecule virtual library but is well suited to many aminergic G-protein-coupled receptors. Using three inputs, each with diverse available derivatives, a one pot C–H alkenylation, electrocyclization and reduction provides the tetrahydropyridine core with up to six sites of derivatization5–7. Docking a virtual library of 75 million tetrahydropyridines against a model of the serotonin 5-HT2A receptor (5-HT2AR) led to the synthesis and testing of 17 initial molecules. Four of these molecules had low-micromolar activities against either the 5-HT2A or the 5-HT2B receptors. Structure-based optimization led to the 5-HT2AR agonists (R)-69 and (R)-70, with half-maximal effective concentration values of 41 nM and 110 nM, respectively, and unusual signalling kinetics that differ from psychedelic 5-HT2AR agonists. Cryo-electron microscopy structural analysis confirmed the predicted binding mode to 5-HT2AR. The favourable physical properties of these new agonists conferred high brain permeability, enabling mouse behavioural assays. Notably, neither had psychedelic activity, in contrast to classic 5-HT2AR agonists, whereas both had potent antidepressant activity in mouse models and had the same efficacy as antidepressants such as fluoxetine at as low as 1/40th of the dose. Prospects for using bespoke virtual libraries to sample pharmacologically relevant chemical space will be considered.