AstraZeneca has agreed to buy Boston-based Modella AI, the companies said on Tuesday, as the drug industry increases its use of artificial intelligence to accelerate the discovery of new drugs.