Abstract Remaining useful life (RUL) prediction of bearings holds significant importance in enhancing the reliability and durability of rotating machinery. Bearings undergo a gradual degradation process that unfolds over multiple stages. In this paper, a novel framework for forecasting the RUL of bearings is put forward, which includes the construction of a health indicator with a stage division algorithm (SDA) and the estimation of the health indicator using a new trend memory attention-based gated recurrent unit (TMAGRU). The SDA, based on the K-Means++ algorithm and angle recognition algorithm, is introduced to distinguish the degradation stage based on the health indicator. Inspired by the double exponential smoothing technique and attention mechanism, the proposed TMAGRU network effectively incorporates both the historical health information in the slow degradation stage and its trend. Experimental results conducted on IEEE PHM Challenge 2012 dataset and XJTU-SY dataset demonstrate the superior predictive performance of the proposed approach compared to several state-of-the-art predictive networks.