The formation of groups of interacting individuals improves performance and fitness in many decentralised systems, from micro-organisms to social insects, from robotic swarms to artificial intelligence algorithms. Often, group formation and high-level coordination in these systems emerge from individuals with limited information-processing capabilities implementing low-level rules of communication to signal to each other. Here, we show that, even in a community of clueless individuals incapable of processing information and communicating, a dynamic environment can coordinate group formation by transiently storing memory of the earlier passage of individuals. Our results identify a new mechanism of indirect coordination via shared memory that is primarily promoted and reinforced by dynamic environmental factors, thus overshadowing the need for any form of explicit signalling between individuals. We expect this pathway to group formation to be relevant for understanding and controlling self-organisation and collective decision making in both living and artificial active matter in real-life environments.