  Dating stars is a major challenge with a deep impact on many astrophysical
fields. One of the most promising techniques for this is using chemical
abundances. Recent space- and ground-based facilities have improved the
quantity of stars with accurate observations. This has opened the door for
using Bayesian inference tools to maximise the information we can extract from
them. Our aim is to present accurate and reliable stellar age estimates of FGK
stars using chemical abundances and stellar parameters. We used one of the most
flexible Bayesian inference techniques (hierarchical Bayesian models) to exceed
current possibilities in the use of chemical abundances for stellar dating. Our
model is a data-driven model. We used a training set that has been presented in
the literature with ages estimated with isochrones and accurate stellar
abundances and general characteristics. The core of the model is a prescription
of certain abundance ratios as linear combinations of stellar properties
including age. We gathered four different testing sets to assess the accuracy,
precision, and limits of our model. We also trained a model using chemical
abundances alone. We found that our age estimates and those coming from
asteroseismology, other accurate sources, and also with ten Gaia benchmark
stars agree well. The mean absolute difference of our estimates compared with
those used as reference is 0.9 Ga, with a mean difference of 0.01 Ga. When
using open clusters, we reached a very good agreement for Hyades, NGC 2632,
Ruprecht 147, and IC4651. We also found outliers that are a reflection of
chemical peculiarities and/or stars at the limit of the validity ranges of the
training set. The model that only uses chemical abundances shows slightly worse
mean absolute difference (1.18 Ga) and mean difference (-0.12 Ga).
