The prevalence of antibiotic resistance in urinary tract infections (UTIs) often renders the prescribed antimicrobial treatment ineffective, highlighting the need for personalized prediction of resistance at time of care. Here, crossing a 10-year longitudinal dataset of over 700,000 community-acquired UTIs with over 6,000,000 personally-linked records of antibiotic purchases, we show that the resistance profile of infections can be predicted based on patient-specific demographics and clinical history. Age, gender, and retirement home residence had strong, yet differential and even non-monotonic, associations with resistance to different antibiotics. Resistance profiles were also associated with the patient's records of past urine samples and antibiotic usage, with these associations persisting for months and even longer than a year. Drug usage selected specifically for its own cognate resistance, which led indirectly, through genetic linkage, also to resistance to other, even mechanistically unrelated, drugs. Applying machine learning models, these association patterns allowed good personalized predictions of resistance, which could inform and better optimize empirical prescription of antibiotics.The resistance of bacterial pathogens to commonly used antibiotics is a growing public health concern, threatening the efficacy of life-saving antibiotic drugs 1,2 . Antibiotic use and misuse can benefit resistant strains, exacerbating the problem over time [3][4][5] . At the single patient level, the efficacy of antimicrobial treatment is critically dependent on correctly matching antibiotic choice to the specific susceptibilities of the pathogen 6-8 . Ideally, correct prescription should be based on direct measurement of the antibiotic susceptibilities of the infecting pathogen. In practice, though, to save time and resources, drugs are often prescribed empirically in absence of culture susceptibility measurements, risking incorrect and ineffective treatment. difficult to discern the direction of causality 17,35 . Finally, the time extent of these positive and negative associations of resistance with prior antibiotic usage and prior resistant samples is not well resolved, and it is also unclear whether and how these associations vary across resistances to different antibiotics.Here, we present a systematic big-data analysis of a large population of UTI patients to unravel predictive features of antibiotic resistance. We analyze a patient-level longitudinal dataset of community and retirement-home acquired UTI cultures collected by Maccabi Healthcare Services (MHS), Israel's second largest Health Maintenance Organizations, serving a diverse population of~2 million patients. We first analyze correlations between demographic factors and antibiotic resistance. Then, comparing resistance data of multiple infections from the same patient, we unravel long-term "memory" of resistance over time. We also combine these culture records with patient-linked records of antibiotic use to quantify the extent and time of direct and indi...