Urinary tract infection (UTI) is one of the most prevalent human bacterial infections. Due to the rapid rise of multidrug-resistant uropathogens in global circulation, new therapeutic approaches, including vaccines and immunotherapy, are urgently needed. However, the development of these therapies is impeded by an incomplete understanding of how memory develops during UTI. Here, we found that reducing bacteria load early in infection, by reducing the quantity of bacteria used for infection or with antibiotics, completely abrogated the protective memory response. As we observed that a mixed T helper cell polarization bias, comprised of Th1, Th2, and Th17 T cells, develops, we hypothesized that reducing antigen load likely altered T helper cell polarization. Surprisingly, T helper cell polarization was unchanged in these scenarios, however, we identified a population of tissue resident memory (TRM) T cells that was significantly reduced in the absence of sufficient antigen, supporting that this population is necessary for protection. To demonstrate that they are sufficient for memory against recurrent UTI, we depleted circulating and lymph node-resident T cells, and observed that mice were still protected against a second infection. Our findings uncover an unappreciated mechanism of immunity to UTI and key role for TRM cells in the memory response to bacterial infection in the bladder, providing a target for non-antibiotic-based immunotherapy and/or new vaccine strategies to improve the response to UTI.