Depression is a common psychological disorder, accompanied by a disturbance of the gut microbiota and its metabolites. Recently, microbiota-derived tryptophan metabolism and AMPK/mTOR pathway were found to be strongly linked to the development of depression. Shugan Hewei Decoction (SHD) is a classical anti-depression traditional Chinese medicine formula. Although, we have shown that SHD exerted antidepressant effects via cecal microbiota and cecum NLRP3 inflammasome, the specific mechanism of SHD on metabolism driven by gut microbiota is unknown. In this study, we focus on the tryptophan metabolism and AMPK/mTOR pathway to elucidate the multifaceted mechanisms of SHD. Male rats were established to the chronic unpredictable stress (CUS)/social isolation for 6weeks, and SHD-L (7.34g/kg/d), SHD-H (14.68g/kg/d), Fructooligosaccharide (FOS) (3.15g/kg/d) were given by intragastric administration once daily during the last 2weeks. Behavioral experiments were carried out to evaluate the model. The colonic content was taken out for shotgun metagenomic sequencing combined with the untargeted metabolomics, the targeted tryptophan metabolomics. ELISA was used to detect the levels of zonula occludens 1 (ZO-1), Occludin in colon, as well as lipopolysaccharide (LPS), diamine oxidase (DAO), D-lactate (DLA) in serum. The expressions of mRNA and proteins of adenosine monophosphate-activated protein kinase (AMPK)/mammalian target of rapamycin (mTOR) pathway of autophagy were examined using RT-qPCR and Western blot in colon. SHD modulated gut microbiota function and biological pathways, which were related to tryptophan metabolism. In addition, SHD could regulate microbiota-derived tryptophan production (such as reduction of 3-HK, 3-HAA etc., increment of ILA, IAA etc.), which metabolites belong to kynurenine (KYN) and indole derivatives. Further, SHD reduced intestinal permeability and enhanced the intestinal barrier function. Moreover, SHD could upregulate the levels of AMPK, microtubule associated protein light chain 3 (LC3), autophagy related protein 5 (ATG5) and Beclin1, downregulate the levels of mTOR, p62, promoted autophagy in colon. Spearman's analysis illustrated the close correlation between tryptophan metabolites and intestinal barrier, AMPK/mTOR pathway. SHD may exert antidepressant-like effects by regulating microbiota-derived tryptophan metabolism, and triggering the AMPK/mTOR pathway of autophagy, enhancing the intestinal barrier function.