The initiation of T-cell responses in lymph nodes requires T cells to integrate signals delivered by dendritic cells (DCs) during long-lasting contacts (synapses) or more transient interactions (kinapses). However, it remains extremely challenging to understand how a specific sequence of contacts established by T cells ultimately dictates T-cell fate. Here, we have coupled a computational model of T-cell migration and interactions with DCs with a real-time, flow cytometry-like representation of T-cell activation. In this model, low-affinity peptides trigger T-cell proliferation through kinapses but we show that this process is only effective under conditions of high DC densities and prolonged antigen availability. By contrast, high-affinity peptides favor synapse formation and a vigorous proliferation under a wide range of antigen presentation conditions. In line with the predictions, decreasing the DC density in vivo selectively abolished proliferation induced by the low-affinity peptide. Finally, our results suggest that T cells possess a biochemical memory of previous stimulations of at least 1-2 days. We propose that the stability of T-cell-DC interactions, apart from their signaling potency, profoundly influences the robustness of T-cell activation. By offering the ability to control parameters that are difficult to manipulate experimentally, the virtual lymph node model provides new possibilities to tackle the fundamental mechanisms that regulate T-cell responses elicited by infections or vaccines.