We present a coherent database of spectroscopic observations of far-IR fine-structure lines from the Herschel/PACS archive for a sample of 170 local AGN, plus a comparison sample of 20 starburst galaxies and 43 dwarf galaxies. Published Spitzer/IRS and Herschel/SPIRE line fluxes are included to extend our database to the full 10-600 $mu m$ spectral range. The observations are compared to a set of CLOUDY photoionisation models to estimate the above physical quantities through different diagnostic diagrams. We confirm the presence of a stratification of gas density in the emission regions of the galaxies, which increases with the ionisation potential of the emission lines. The new [OIV]25.9$mu m$/[OIII]88$mu m$ vs [NeIII]15.6$mu m$/[NeII]12.8$mu m$ diagram is proposed as the best diagnostic to separate: $i)$ AGN activity from any kind of star formation; and $ii)$ low-metallicity dwarf galaxies from starburst galaxies. Current stellar atmosphere models fail to reproduce the observed [OIV]25.9$mu m$/[OIII]88$mu m$ ratios, which are much higher when compared to the predicted values. Finally, the ([NeIII]15.6$mu m$ + [NeII]12.8$mu m$)/([SIV]10.5$mu m$ + [SIII]18.7$mu m$) ratio is proposed as a promising metallicity tracer to be used in obscured objects, where optical lines fail to accurately measure the metallicity. The diagnostic power of mid- to far-infrared spectroscopy shown here for local galaxies will be of crucial importance to study galaxy evolution during the dust-obscured phase at the peak of the star formation and black-hole accretion activity ($1 < z < 4$). This study will be addressed by future deep spectroscopic surveys with present and forthcoming facilities such as JWST, ALMA, and SPICA.