This cohort study examines the overall survival, genomic profile, immune profile, and genomic ancestries of patients with KRAS-mutated gallbladder cancer or cholangiocarcinoma. This evidence concerns the gene KRAS and cholangiocarcinoma.