Major Depressive Disorder (MDD) is a complex, heterogeneous condition affecting millions worldwide. Computational neuropsychiatry offers potential breakthroughs through the mechanistic modeling of this disorder. Using the Kolmogorov theory (KT) of consciousness, we developed a foundational model where algorithmic agents interact with the world to maximize an Objective Function evaluating affective valence. Depression, defined in this context by a state of persistently low valence, may arise from various factors—including inaccurate world models (cognitive biases), a dysfunctional Objective Function (anhedonia, anxiety), deficient planning (executive deficits), or unfavorable environments. Integrating algorithmic, dynamical systems, and neurobiological concepts, we map the agent model to brain circuits and functional networks, framing potential etiological routes and linking with depression biotypes. Finally, we explore how brain stimulation, psychotherapy, and plasticity-enhancing compounds such as psychedelics can synergistically repair neural circuits and optimize therapies using personalized computational models.