Stochastic epidemic models with varying infectivity and waning immunity have recently been introduced. In this talk, I present a new model, based on the work of Forien et al. (2025), that incorporates memory of the last infection. To this end, a parametric approach is introduced and I will consider a piecewise deterministic Markov process that models both the evolution of the parameter (also called the trait) and the age of infection of individuals over time. At each new infection, a new trait is randomly assigned to the infected individual according to a Markov kernel, and their age is reset to zero. In the large population limit, we derive a partial differential equation (PDE) that describes the joint density of traits and ages. The main goal is to study the conditions under which endemic equilibria exist for the deterministic PDE model and to establish an endemicity threshold that depends on the model parameters. This is joint work with Arsene Brice Zotsa-Ngoufack.