We propose an efficient scheme for optimizing the optical memory of a sequence of signal light pulses in a system of ultracold atoms in ∧ configuration.The memory procedure consists of write-in,storage,and retrieval phases.By applying a weak microwave field in the storage stage,additional phase-dependent terms are included,and the contrast of the output signal pulses can be dynamically controlled(enhanced or suppressed) through manipulating the relative phase φ between optical and microwave fields.Our numerical analysis shows that the contrast is enhanced to the most extent when φ = 1.5π.In addition,the contrast is in proportion to the Rabi frequency of the microwave field with a certain relative phase.