Accretion states, which are universally observed in stellar mass black holes in X-ray binaries, might be expected in active galactic nuclei (AGN). This is the case at low luminosities, when the jet-corona coupling dominates the energy output in both populations. Previous attempts to extend this framework to a wider AGN population have been extremely challenging due to heavy hydrogen absorption of the accretion disc continuum and starlight contamination from the host galaxies. We present the luminosity-excitation diagram (LED), based on the [O IV]_25.9um_ and [Ne II]_12.8um_ mid-infrared nebular line fluxes. This tool enables to probe the accretion disc contribution to the ionizing continuum. When applied to a sample of 167 nearby AGN, the LED recovers the characteristic q-shaped morphology outlined by individual X-ray binaries during a typical accretion episode, allowing us to tentatively identify the main accretion states. The soft state would include broad-line Seyferts and about half of the Seyfert 2 population, showing highly excited gas and radio-quiet cores consistent with disc-dominated nuclei, in agreement with previous studies. The hard state mostly includes low-luminosity AGN (<= 10-3^ LEdd) characterized by low-excitation radio-loud nuclei and a negligible disc contribution. The remaining half of Seyfert 2 nuclei and the bright LINERs show low excitation at high accretion luminosities and could be identified with the bright hard and intermediate states. Their hosts show ongoing star formation in the central kiloparsecs. We discuss the above scenario, its potential links with the galaxy evolution picture, and the possible presence of accretion state transitions in AGN, as suggested by the growing population of changing-look quasars.