In this article, we evidence the lower formation energy and improved stability of the conductive filament (CF) formed in TiN\Ta2O5\Ta resistive-switching memory cells treated in NH3 atmosphere at 400 °C. This annealing treatment results in (i) lower forming voltage, (ii) lower CF resistance, and (iii) longer retention lifetime of the oxygen-vacancy (Vo) chain constituting the CF. Atomistic insights into these processes are provided by ab initio calculations performed for hydrogen (H) species incorporated in non-stoichiometric Ta2O5 supercells: (i) Vo formation energy is reduced by the presence of H, (ii) Vo-chain CF conductivity is increased by Vo + OH complex formation, and (iii) Vo-chain retention is strengthened by the stable Vo + OH complex. As a result, efficient CF formation and excellent state stability are obtained after 15 days at 250 °C.