History-dependent decision-making across species