Episodic memory is characteristic of many actively foraging animals that exploit definable territories, enabling them to map contexts and environmental features in space and time. Memories are stored as episodic sequences of associative experiences, whose recall allows cognitive mapping of territories and social networks, predictive outcomes of imagined situations, and synthetic creativity in niche modification. These abilities are underused in artificial intelligence (AI) as most existing models are unwieldy in their need for computational power, and they lack the goal-directed motivation of animals. Here we show how simple associative learning rules are expansible for efficient episodic memory in an agent-based foraging simulation with a novel computational module, the Feature Association Matrix (FAM). The FAM enables highly efficient foraging and spatial navigation. It reproduces how higher-order conditioning mechanisms give rise to spatial cognitive mapping by chaining pair-wise associations and encoding them with additional contexts, similar to function of the vertebrate hippocampus. The dynamics are a biologically inspired, bottom-up enhancement of AI for higher-order cognition. This computationally light module provides a framework to create more complex memory systems to enable more adaptive and dynamic behaviors in autonomous agents. By mediating learning of spatiotemporal sequences and spatial mapping, the FAM offers significant potential for developing generalized cognitive mapping for more abstract thought.