The central tetrahydropyridine ring of the title compound, C19H17N3O2, adopts a screw-boat conformation. In the crystal, strong C—H. . .O and N—H. . .N hydrogen bonds form dimers with R22(14) and R22(12) ring motifs, respectively, between consecutive molecules along the c-axis direction. Intermolecular N—H. . .O and C—H. . .O hydrogen bonds connect these dimers, forming a three-dimensional network. C—H. . . interactions and – stacking interactions contribute to the stabilization of the molecular packing. A Hirshfeld surface analysis indicates that the contributions from the most prevalent interactions are H. . .H (47.1%), C. . .H/H. . .C (20.9%), O. . .H/H. . .O (15.3%) and N. . .H/ H. . .N (11.4%). © 2022 International Union of Crystallography. All rights reserved.