Objective: Deep brain stimulation (DBS) of the ventral internal capsule/striatum (VCVS) is a potentially effective treatment for several mental health disorders when conventional therapeutics fail. Its effectiveness, however, depends on correct programming to engage VCVS sub-circuits. VCVS programming is currently an iterative, time-consuming process, with weeks between setting changes and reliance on noisy, subjective self-reports. An objective measure of circuit engagement might allow individual settings to be tested in seconds to minutes, reducing the time to response and increasing patient and clinician confidence in the chosen settings. Here, we present an approach to measuring and optimizing that circuit engagement. Approach: We leverage prior results showing that effective VCVS DBS engages cognitive control circuitry and improves performance on the Multi-Source Interference Task (MSIT), that this engagement depends primarily on which contact(s) are activated, and that circuit engagement can be tracked through a state space modeling framework. We develop a simulation framework based on those empirical results, then combine this framework with an adaptive optimizer to simulate a principled exploration of electrode contacts and identify the contacts that maximally improve cognitive control. We explore multiple optimization options (algorithms, number of inputs, speed of stimulation parameter changes) and compare them on problems of varying difficulty. Main results: We show that an Upper Confidence Bound (UCB1) algorithm outperforms other optimizers, with roughly 80% probability of convergence to a global optimum when used in a majority-vote ensemble. Significance: We show that the optimization can converge even with lag between stimulation and effect, and that a complete optimization can be done in a clinically feasible timespan (a few hours). Further, the approach requires no specialized recording or imaging hardware, and thus could be a scalable path to expand the use of DBS in psychiatric and other non-motor applications.