Scientists studied the adaptive immune system as a kind of artificial intelligence that can be trained to produce the correct response to invasion by pathogens. This work may lead to more effective vaccines and immune boosting therapies.