Dear student,
Yes vaccine creates memory in B and T cells for future preventions. The immunisation or vaccination is based on the property of ‘memory’ of the immune system. Some T cells are T memory cells which stays ready to encounter if the same infection is detected and B-cells then produce antibodies against the same. Since memory B cells also have the memory of that infection, the production of antibodies is faster in this case.
Regards