The ability to flexibly switch our responses to external stimuli according to contextual information is critical for successful interactions with a complex world. Context-dependent computations are necessary across many domains1-3, yet their neural implementations remain poorly understood. Here we developed a novel behavioural task in rats to study context-dependent selection and accumulation of evidence for decision-making4-6. Under assumptions supported by both monkey and rat data, we first show mathematically that this computation can be supported by three dynamical solutions and that all networks performing the task implement a combination of these solutions. These solutions can be identified and tested directly with experimental data. We further show that existing electrophysiological and modelling data are compatible with the full variety of possible combinations of these solutions, suggesting that different individuals could use different combinations. To study variability across individual subjects, we developed automated, high-throughput methods to train rats on our task and trained many subjects using these methods. Consistent with theoretical predictions, neural and behavioural analyses revealed substantial heterogeneity across rats, despite uniformly good task performance. Our theory further predicts a specific link between behavioural and neural signatures, which was robustly supported in the data. In summary, our results provide an experimentally supported theoretical framework to analyse individual variability in biological and artificial systems that perform flexible decision-making tasks, open the door to cellular-resolution studies of individual variability in higher cognition, and provide insights into neural mechanisms of context-dependent computation more generally.