Many proposed neural circuits for learning are theoretically well-grounded but have limited biological evidence to support them. Emerging anatomical and functional data from neurons in the fruit fly brain allows us to identify interconnections in the mushroom body neuropil that form an ‘incentive circuit’, supporting rich dynamics of memory acquisition, consolidation and forgetting. In addition, new insights into dopamine function in the fruit fly brain motivate a novel ‘dopaminergic plasticity rule’ that alters the weights between input sensory patterns and output neurons of the mushroom body. Three output neurons and three dopaminergic neurons for each valence (i.e. attraction or avoidance) allow the flexible formation of short-term memories, transfer to long-term memory, and balancing between opposing valences for similar stimuli, resulting in an effective exploration-exploitation trade-off. Each element of the proposed circuit is mapped to identified neurons in the fruit fly brain, and we show that the simulated responses produced by modelling this circuit and plasticity rule closely replicate experimental data recorded in these neurons, while a reward prediction error rule causes catastrophic forgetting. By testing our model in 92 olfactory conditioning paradigms collected from previous studies, we show a strong correlation to the resulting behaviour. Finally, when this circuit is used for controlling the behaviour of simulated flies, it replicates many features of fly behaviour such as the differential acquisition of aversive and attractive memories despite symmetry in the neural circuitry. This provides new insight into the underlying mechanisms of associative learning that might generalise beyond the fruit fly brain.