Fruit fly larvae, which exist widely in nature, achieve peristaltic motion via the contraction and elongation of their bodies and the asymmetric friction generated by the front and rear parts of their bodies when they are in contact with the ground. Herein, we report the development of an untethered, magnetic, temperature-sensitive hydrogel-based soft robot that mimics the asymmetric micro-patterns of fruit-fly-larvae gastropods and utilizes cyclic deformation to achieve directional peristaltic locomotion. Due to Néel relaxation losses of nanomagnetic Fe3O4 particles, the hydrogel-based soft robot is capable of converting changes in external alternating magnetic stimuli into contracting and expanding deformation responses which can be remotely controlled via a high-frequency alternating magnetic field (AMF) to realize periodic actuation. Furthermore, the Fe3O4 particles included in the hydrogel-based soft robot cause it to follow a gradient magnetic field in confined liquid environments and can be coupled with AMFs for the targeted release of water-soluble drugs or targeted magnetic hyperthermia therapy (MHT). We believe that such a controlled motion can enable highly targeted drug delivery, as well as vascular disease detection and thrombus removal tasks, without the use of invasive procedures.