In the title compound, C19H19N5, the piperidine ring adopts a chair conformation. The pyridine ring is essentially planar, with a maximum deviation of 0.039 (2) Å for a C atom substituted with a carbonitrile group. The mean plane of the central pyridine ring makes the dihedral angles of 37.90 (14) and 56.10 (12)° with the piperidine and benzene rings, respectively. In the crystal, mol-ecules are linked via N-H⋯N and C-H⋯N hydrogen bonds, forming chains along [101], and enclosing R 2 (2)(17) ring motifs. The chains are linked by further C-H⋯N hydrogen bonds, forming two-dimensional networks lying parallel to (10-1), and enclosing inversion dimers with R 2 (2)(20) ring motifs.