Manipulation of intake of serotonin precursor tryptophan has been exploited to rapidly induce and alleviate depression symptoms. While studies show that this latter effect is dependent on genetic vulnerability to depression, the effect of habitual tryptophan intake in the context of predisposing genetic factors has not been explored. Our aim was to investigate the effect of habitual tryptophan intake on mood symptoms and to determine the effect of risk variants on depression in those with high and low tryptophan intake in the whole genome and specifically in serotonin and kynurenine pathways. 63,277 individuals in the UK Biobank with data on depressive symptoms and tryptophan intake were included. We compared two subpopulations defined by their habitual diet of a low versus a high ratio of tryptophan to other large amino acids (TLR). A modest protective effect of high dietary TLR against depression was found. NPBWR1 among serotonin genes and POLI in kynurenine pathway genes were significantly associated with depression in the low but not in the high TLR group. Pathway-level analyses identified significant associations for both serotonin and kynurenine pathways only in the low TLR group. In addition, significant association was found in the low TLR group between depressive symptoms and biological process related to adult neurogenesis. Our findings demonstrate a markedly distinct genetic risk profile for depression in groups with low and high dietary TLR, with association with serotonin and kynurenine pathway variants only in case of habitual food intake leading to low TLR. Our results confirm the relevance of the serotonin hypothesis in understanding the neurobiological background of depression and highlight the importance of understanding its differential role in the context of environmental variables such as complexity of diet in influencing mental health, pointing towards emerging possibilities of personalised prevention and intervention in mood disorders in those who are genetically vulnerable.