Recent work suggests that dopamine neurons have a role in cognitive processing that is distinct from their established role in reward prediction error coding. Here, the authors recorded from midbrain dopamine neurons in monkeys as they performed a task requiring working memory and visual search. Activity in dorsolateral ventral midbrain neurons correlated with working memory demand, whereas activity in ventromedial ventral midbrain neurons represented reward prediction, suggesting that the involvement of midbrain dopamine signalling in different aspects of a cognitive task varies along a dorsolateral–ventromedial axis.