Memristors are a leading candidate for future storage and neuromorphic computing technologies 1-10 due to characteristics such as device scalability, multi-state switching, fast switching speed, high switching endurance and CMOS compatibility 6,[11][12][13][14][15][16] . Most research and development efforts have been focused on improving device switching performance in optimal conditions, and the reliability of memristors in harsh environments such as at high temperature and on bending substrates has so far received much less attention. Since the programming processes in memristors based on traditional oxide materials mostly rely on ion moving and ionic valence changing 16,17 , the thermal instability at elevated temperatures could result in device failure 18 . Thus, to the best of our knowledge, there has been no reliable switching behaviours observed in memristors at temperatures above 200 °C 18,19 , which limits their potential application in harsh electronics such as those demanded in aerospace, military, automobile, geothermal, oil and gas industries. Common high temperature electronic materials, such as SiC and III-nitride 20,21 , are not adoptable in fabricating memristors, and therefore searching for new materials and structures for robust memristors with good performance is desirable.By stacking two-dimensional (2D) layered materials together 22-30 , van der Waals (vdW) heterostructures can combine the superior properties of each 2D component. 2D materials have shown excellent structural stability 31,32 and electrical properties, which could provide significant improvements in the robustness of electronic devices. For example, graphene possesses unparalleled breaking strength, and ultra-high thermal and chemical stabilities 33 ; molybdenum disulfide (MoS 2 ) has shown good flexibility, large Young's modulus (comparable to stainless steel), 34 and excellent thermal stability up to 1,100 °C 32 ; and various functionalized 2D material layers, or certain grain boundaries within 2D materials, have shown switching behaviours [35][36][37][38][39][40][41][42][43][44] . Since both the thickness and roughness of 2D layered materials can be controlled accurately at the atomic scale, the reliability and uniformity of the electronic devices based on such materials and their vdW heterostructures could also be optimized.In this Article, we report robust memristors based on a vdW heterostructure made of fully layered 2D materials (graphene/MoS 2−x O x / graphene), which exhibit repeatable bipolar resistive switching with endurance up to 10 7 and high thermal stability with an operating temperature of up to 340 °C. The MoS 2−x O x layer was found to be responsible for the high thermal stability of the devices by performing high temperature in situ high-resolution transmission electron microscopy (HRTEM) studies. Further in situ scanning transmission electron microscopy (STEM) investigations on the cross section of a functional device revealed a well-defined conduction channel and a switching mechanism based on the migr...