We present a study of the infrared properties of X-ray selected, moderate-luminosity (i.e. LX= 1042–1044 erg s−1) active galactic nuclei (AGNs) up to z ≈ 3, in order to explore the links between star formation in galaxies and accretion on to their central black holes. We use 100 and 160 μ m fluxes from GOODS-Herschel – the deepest survey yet undertaken by the Herschel telescope – and show that in the vast majority of cases (i.e. >94 per cent) these fluxes are dominated by emission from the host galaxy. As such, these far-infrared bands provide an uncontaminated view of star formation in the AGN host galaxies. We find no evidence of any correlation between the X-ray and infrared luminosities of moderate AGNs at any redshift, suggesting that global star formation is decoupled from nuclear (i.e. AGN) activity in these galaxies. On the other hand, we confirm that the star formation rates of AGN hosts increase strongly with redshift, by a factor of 43+27− 18 from z < 0.1 to z = 2–3 for AGNs with the same range of X-ray luminosities. This increase is entirely consistent with the factor of 25–50 increase in the specific star formation rates (SSFRs) of normal, star-forming (i.e. main-sequence) galaxies over the same redshift range. Indeed, the average SSFRs of AGN hosts are only marginally (i.e. ≈20 per cent) lower than those of main-sequence galaxies at all surveyed redshifts, with this small deficit being due to a fraction of AGNs residing in quiescent (i.e. low SSFR) galaxies. We estimate that 79 ± 10 per cent of moderate-luminosity AGNs are hosted in main-sequence galaxies, 15 ± 7 per cent in quiescent galaxies and <10 per cent in strongly starbursting galaxies. We derive the fractions of all main-sequence galaxies at z < 2 that are experiencing a period of moderate nuclear activity, noting that it is strongly dependent on galaxy stellar mass (Mstars), rising from just a few per cent at Mstars∼ 1010 M⊙ to ≳20 per cent at Mstars≥ 1011 M⊙. Our results indicate that it is galaxy stellar mass that is most important in dictating whether a galaxy hosts a moderate-luminosity AGN. We argue that the majority of moderate nuclear activity is fuelled by internal mechanisms rather than violent mergers, which suggests that high-redshift disc instabilities could be an important AGN feeding mechanism.