Gamma-ray polarization is one of the most promising tools to probe the universe at extreme conditions and search for new physics. The Alpha Magnetic Spectrometer (AMS) is a precision particle physics detector on the International Space Station. With its high accuracy thin silicon strip detectors and permanent magnet, AMS is unique to study the polarization of high energy gamma-rays. The detection of gamma-rays above a few hundreds of MeV typically utilize the electron–positron pair production process, and the key step is to reconstruct the vertex where gamma-ray converts into the electron–positron pair. We present a new vertex reconstruction algorithm that is based on an extended cellular automaton to determine the direction and energy information of gamma-rays from the electron and positron trajectories in the AMS tracker. The vertex reconstruction efficiency is significantly improved with the presented algorithm over the entire energy range above 100 MeV and reaches >90% above 1 GeV. The fake rate is drastically reduced over the entire energy range and is reduced from ∼10% to ∼3% at 200 MeV. The presented algorithm will thus provide the basis for measuring gamma-ray polarization with AMS.