We aimed to use the recently developed Bayesian causal forest (BCF) method to develop and validate an individualised treatment selection algorithm for two major type 2 diabetes drug classes, sodium–glucose cotransporter 2 inhibitors (SGLT2i) and glucagon-like peptide-1 receptor agonists (GLP1-RA). The gene discussed is GCG; the disease is type 2 diabetes mellitus.