Delphi-2M is a generative foundation model trained on the medical histories of 400,000 UK Biobank participants. It learns to predict the timing and co-occurrence of more than 1,000 ICD-10 diagnoses across the life course, encoding each disorder as a 120-dimensional vector. Two disorders with similar embeddings tend to affect similar patients, at similar ages, and alongside similar other conditions.