Inclusion Criteria:  Male or Female, between the ages of 18 and 80 at the time of screening. Able to read, understand, and provide written, dated informed consent prior to screening. Proficiency in English sufficient to complete questionnaires / follow instructions during fMRI assessments and aiTBS interventions. Stated willingness to comply with all study procedures, including availability for the duration of the study, and to communicate with study personnel about adverse events and other clinically important information. Currently diagnosed with Major Depressive Disorder (MDD) or Bipolar Disorder type II and meets criteria for a Major Depressive Episode, according to the criteria defined in the Diagnosis and Statistical Manual of Mental Disorders, Fifth Edition, Text Revision (DSM-5). Medical records confirming a history of moderate to severe treatment-resistance as defined by a score of 7-14 on the Maudsley Staging Method (MSM). MADRS score of ≥20 at screening (Visit 1). TMS naive. Access to ongoing psychiatric care before and after completion of the study. Must be on a stable antidepressant therapeutic regimen for 6 weeks prior to study enrollment and agree to continue this regimen throughout the study period. In good general health, as evidenced by medical history. For females of reproductive potential: use of highly effective contraception for at least 1 month prior to screening and agreement to use such a method during study participation.  Exclusion Criteria:  Pregnancy Primary psychiatric condition other than MDD requiring treatment except stable co-morbid anxiety disorder History of or current psychotic disorder or bipolar disorder Diagnosis of Intellectual Disability or Autism Spectrum Disorder Current moderate or severe substance use disorder or demonstrating signs of acute substance withdrawal Urine screening test positive for illicit substances Active suicidal ideation (defined as an MSSI > 8) or a suicide attempt within the past 90 days Any history of ECT (greater than 8 sessions) without meeting responder criteria Recent (during the current depressive episode) or concurrent use of rapid acting antidepressant agent (i.e., ketamine or a course of ECT) History of significant neurologic disease, including dementia, Parkinson's or Huntington's disease, brain tumor, seizure disorder, subdural hematoma, multiple sclerosis, or history of significant head trauma Contraindication to receiving rTMS (e.g., metal in head, history of seizure, known brain lesion) Contraindication to MRI (ferromagnetic metal in their body) Treatment with another investigational drug or other intervention within the study period Any other condition deemed by the PI to interfere with the study or increase risk to the participant