Foraging animals may benefit from remembering the location of a newly discovered food patch while continuing to explore nearby <up>1, 2</up>. For example, after encountering a drop of yeast or sugar, hungry flies often perform a local search <up>3, 4</up>. That is, rather than remaining on the food or simply walking away, flies execute a series of exploratory excursions during which they repeatedly depart and return to the resource. Fruit flies, Drosophila melanogaster, can perform this food-centered search behavior in the absence of external landmarks, instead relying on internal (idiothetic) cues 5. This path-integration behavior may represent a deeply conserved navigational capacity in insects <up>6, 7</up>, but its underlying neural basis remains unknown. Here, we used optogenetic activation to screen candidate cell classes and found that local searches can be initiated by diverse sensory neurons. Optogenetically induced searches resemble those triggered by actual food, are modulated by starvation state, and exhibit key features of path integration. Flies perform tightly centered searches around the fictive food site, even within a constrained maze, and they can return to the fictive food site after long excursions. Together, these results suggest that flies enact local searches in response to a wide variety of food-associated cues and that these sensory pathways may converge upon a common neural system for navigation. Using a virtual reality system, we demonstrate that local searches can be optogenetically induced in tethered flies walking on a spherical treadmill, laying the groundwork for future studies to image the brain during path integration. VIDEO ABSTRACT.