Fabrication of ultrathin (sub-2 nm) oxide semiconductor memristors poses the fundamental challenge of achieving oxide growth with atomic precision in terms of electronic structure and defect formation. Recently, ultrathin memristors consisting of bilayers of mixed \(\textrm{Al}_2\) \(\textrm{O}_3\) and MgO atomic layers were fabricated using an in vacuo atomic layer deposition process. This approach offers a unique platform for precise atomic control of oxygen vacancies in the device in which the vacancies are introduced by placing MgO atomic layers between pristine \(\textrm{Al}_2\) \(\textrm{O}_3\) layers. In this work, we present a systematic operando Hard X-ray PhotoElectron Spectroscopy (HAXPES) study of the switching of such memristors, combined with complementary current-voltage and capacitance-voltage (C-V) measurements. We used a memristor stack of \(\textrm{Al}_2\) \(\textrm{O}_3\) /MgO atomic layers, with the MgO-containing oxide deposited on the bottom Al metal electrode and a pure \(\textrm{Al}_2\) \(\textrm{O}_3\) layer below the top Pd electrode. HAXPES analysis shows a substantial change in the chemical shift of the Aluminum oxide when switching between the ”OFF” and ”ON” states indicative of a redistribution of oxygen vacancies in the device active layer. Interestingly, subsequent switching to the OFF state shows hysteretic behavior indicating the retention of some oxygen vacancies in the top \(\textrm{Al}_2\) \(\textrm{O}_3\) layer. This vacancy retention can be correlated with the stochastic behavior of the switching voltage observed in these devices. C–V measurements show a clear frequency-dependent response in the OFF state, consistent with enhanced polarization and vacancy trapping at low frequencies.