In the title compound, C15H15N5O, the benzene and pyridine rings make a dihedral angle of 30.86 (7)°. In the crystal, chains of molecules are wrapped around the screw axes into compressed helices, through hydrogen bonding between the hydroxy and cyano groups. The chains are linked by weak C—H⋯N and C—H⋯O interactions. The π conjugated unit of the molecule is almost perpendicular to the helix axis, and the formation of the helix is allowed by a gauche-type torsion angle in the hydroxyethyl tail. In this way, consecutive chromophore units along the chain are placed in a strict antiparallel arrangement, and this is energetically favoured because of the high dipole moment of the molecule.