Abstract
<jats:p>First-principles X-ray photoelectron spectroscopy (XPS) is an indispensable complement to experiment for assigning core-level binding energies and chemical shifts, but a single core-level binding energy requires a multi-step, human-supervised computational campaign: structure construction, geometry relaxation, convergence testing, final-state core-hole simulation, and output interpretation—each step gated on inspecting the previous one and each executed against the idiosyncrasies of a batch-scheduled supercomputer. We present an open, modular framework that delegates the orchestration of this campaign to a large-language-model (LLM) agent while keeping every scientifically consequential decision under human control. The framework is organized as three composable, software-agnostic libraries—structure building, quantum-chemistry input generation, and a uniform high-performance-computing (HPC) gateway—beneath an LLM supervisor built on a durable, checkpointed state graph. The agent exposes 51 typed tools, pauses for human approval through a graph-level interrupt mechanism, and survives the hours-to-days latency of HPC queues by persisting its entire state and resuming on job completion. For the XPS physics we implement two complementary final-state ∆SCF backends: the modern VASP periodic recipe (ICORELEVEL=2 with per-atom species promotion and an explicitly set valenceelectron count, exposing the full-, half-, and excited-core-hole variants) for solids and surfaces, and a molecular Q-Chem core-ionization recipe (a ground-state probe to locate the core orbital, then a two-block neutral/cation job that holds the hole with the maximum-overlap method) for gas-phase species, including open-shell radicals via restricted open-shell Kohn–Sham and heavy elements via effective core potentials. We describe the architecture, the design rationale for placing the LLM at the orchestration layer rather than hard-coding workflows, the core-hole bookkeeping for both backends, and the human-in-the-loop control model. As an end-to-end demonstration the agent computes C 1s and O 1s binding energies for a set of eleven gas-phase reaction intermediates (closed-and open-shell, including an iodine-bearing species), autonomously recovering from several structure-and input-level faults under human supervision; the resulting chemical-shift trends are internally consistent and reproduce known qualitative orderings.</jats:p>