The nature of gas and stars in the circumnuclear regions of AGN: a chemical approach