Recent studies suggest that changes in the gut microbiome, as well as social isolation, are closely correlated with mental disorders. We argue that these correlations are intertwined, and the way these interlinkages lead to mental disorders could be productively explored using computational models of agent-environment interactions. To illustrate this approach, we present a reinforcement learning model of social isolation, and discuss how an extension of this model -- based on social stress-related changes to gut states -- could account for the role of the gut microbiome in the emergence of mental disorders.