B and The lymphocytes.
Memory cells are created after a lymphocyte comes in contact with an antigen.
T-Cells come in contact with an antigen presenting cell, that has a fragment of antigen, after which the cell differentiate to memory cells and plasma cells.
Same way, B-cells come into contact with an antigen directly to form plasma cells and memory cells.
Memory cells are for secondary infections while plasma cells secrete cytokines or antibodies respectively.