Brains are evolved to learn, enabling animals to respond flexibly to an unpredictable world and to draw on experience to guide future behaviors. To learn efficiently, brains need to balance a high degree of flexibility in the representation of the outside world with the limited neuronal infrastructure available to them. Focusing on the Drosophila melanogaster olfactory system, my research investigates how the neuronal circuits that enable efficient learning are pre-configured to interpret the world. In my presentation, I will explore two key questions: First, what are the neural pre-configurations that allow the brain to learn efficiently from the environment? Second, how are these pre-configurations shaped by the ecological conditions in which brains evolve? Using a wide range of approaches — from neuronal connectivity mapping and behavioral assays to cross-species comparisons and the study of species interactions — we reveal the subtle ways in which ecology shapes neuronal circuit architecture and function.