MainThe risk of disease varies substantially between individuals and throughout life, with complex interactions between genetic predisposition, environmental factors and accumulated comorbidities. Understanding these dynamic risk patterns could transform early detection, prevention and personalized treatment strategies11,12,13. The increasing availability of large-scale EHRs linked to genetic data provides unprecedented opportunities to model these complex disease trajectories at a population scale3,14,15. However, extracting meaningful patterns from these rich, longitudinal datasets remains challenging owing to patient population heterogeneity, the temporal nature of disease progression and intricate relationships between diverse conditions.Traditional EHR analyses treat diseases in isolation or as pairwise associations, missing how multiple conditions co-evolve1. Recent unsupervised clustering methods16 typically ignore temporal dynamics, intra-disease biological variability and genetic effects on progression17,18.We present ALADYNOULLI, a generative model that integrates germline genetic data with longitudinal EHRs to identify latent disease signatures modelling individual-specific health trajectories over time. ALADYNOULLI addresses these limitations by identifying shared disease signatures that capture biological processes common across multiple conditions, enabling more accurate prediction even for rare diseases through information sharing with related, more common conditions. ALADYNOULLI offers several key advantages over existing methods: (1) for replicable signatures, it generates disease signatures showing high cross-cohort stability and alignment with established clinical phenotypes in the cases examined (familial hypercholesterolaemia, clonal haematopoiesis and type 1 versus type 2 diabetes); (2) for temporal modelling, it captures how disease risk evolves dynamically over the life course; (3) for genetic integration, it directly incorporates genetic information into the model architecture; (4) as a unified framework, it simultaneously models the majority of prevalent conditions in the EHR, sharing information across related conditions, and improving prediction even for diseases with limited data19; (5) for individual-specific trajectories, it provides personalized risk profiles that adapt as new clinical information becomes available; and (6) for principled bias adjustment, it is grounded in an explicit likelihood specification, supporting principled adjustment for selection bias through inverse probability weighting. By jointly modelling multiple diseases and their genetic determinants, ALADYNOULLI improves disease risk prediction, enhances genetic discovery and reveals patient subgroups within diagnostic categories.Methods overviewDisease patterns among individuals vary by onset, progression speed and composition, reflecting different underlying biological mechanisms. ALADYNOULLI models the probability of each disease for an individual by integrating across multiple latent signatures (Fig. 1).Fig. 1: ALADYNOULLI model overview and applications.Hypothetical patient (#123) timeline showing the sequence and timing of major diagnoses over the life course (top). Key model components include: population-level disease signatures (φ), with each line representing the age-dependent risk trajectory for a specific disease within a signature; individual signature loadings (λ) transformed to θ via softmax, for a representative patient, showing how contributions from different signatures evolve over time; and disease risk prediction (π) for selected diseases, integrating population-level signatures and individual loadings to generate personalized risk trajectories (middle). Applications of the model, including genomic discovery, therapeutic targeting and patient matching (for example, digital twin identification or stratification of patients with the same diagnosis but different risk profiles) are also shown (bottom). CAD, coronary artery disease; COPD, chronic obstructive pulmonary disease; GERD, gastroesophageal reflux disease; T2DM, type 2 diabetes mellitus.For each individual i, disease d and timepoint t, πidt is the hazard of disease occurrence, that is, the probability of occurrence assuming the individual is still at risk. In ALADYNOULLI, this is a weighted combination of signature-specific probabilities, in which each signature captures patterns of diseases that tend to occur together (Supplementary Table 1): $${\pi }_{idt}=\kappa \cdot \mathop{\sum }\limits_{k=1}^{K}{\theta }_{ikt}\cdot \,{\rm{sigmoid}}\,({\phi }_{kdt}).$$