Accurately characterizing the thermomechanical parameters of nanoscale systems is essential for understanding their performance and building innovative nanoscale technologies due to their distinct behaviours. Fractional thermal transport models are commonly utilized to correctly depict the heat transfer that occurs in these nanoscale systems. The current study presents a novel mathematical thermoelastic model that incorporates a new fractional differential constitutive equation for heat conduction. This heat equation is useful for understanding the effects of thermal memory. An application of a fractional-time Atangana–Baleanu (AB) derivative with a local and non-singular kernel was utilized in the process of developing the mathematical model that was suggested. To deal with effects that depend on size, nonlocal constitutive relations are introduced. Furthermore, in order to take into consideration, the viscoelastic behaviour of the material at the nanoscale, the fractional Kelvin–Voigt model is utilized. The proposed model is highly effective in properly depicting the unusual thermal conductivity phenomena often found in nanoscale devices. The study also considered the mechanical deformation, temperature variations, and viscoelastic characteristics of the functionally graded (FG) nanostructured beams. The consideration was made that the material characteristics exhibit heterogeneity and continuous variation across the thickness of the beam as the nanobeam transitions from a ceramic composition in the lower region to a metallic composition in the upper region. The complicated thermomechanical features of simply supported viscoelastic nanobeams that were exposed to harmonic heat flow were determined by the application of the model that was constructed. Heterogeneity, nonlocality, and fractional operators are some of the important variables that contribute to its success, and this article provides a full study and illustration of the significance of these characteristics. The results that were obtained have the potential to play a significant role in pushing forward the design and development of tools, materials, and nanostructures that have viscoelastic mechanical characteristics and graded functions.