Executing experimental tasks in both normal research laboratories and large-scale scientific facilities often requires extensive human supervision and remains a key challenge on the path to fully autonomous, artificial intelligence (AI)-driven science. Here we demonstrate a large language model-driven agent that autonomously performs X-ray sample alignment on a synchrotron beamline by planning actions, executing instrumental commands, interpreting observations and iterating towards experimental goals. Based on existing large language models with structured tool-use via the model context protocol, our AI X-ray scientist was guided and tested using an in-house-built virtual experimental setup that mirrors a six-circle diffractometer at an operational synchrotron beamline. The agentic workflow developed in the virtual environment was directly deployed on a real beamline, where it correctly identified reference reflections and determined the orientation matrix, an essential first step in any type of single-crystal scattering experiment. Our AI X-ray scientist responded effectively to unexpected experimental conditions, demonstrating adaptive problem-solving and readiness for addressing practical experimental situations. Our study provides a step towards autonomous operation across diverse experimental environments at large-scale scattering facilities.
Similar content being viewed by others
Operating advanced scientific instruments with AI agents that learn on the job
AI agent behavioral science
Scalable 3D reconstruction for X-ray single particle imaging with online machine learning
Explore related subjects
• Machine Learning Applications in Materials Design
Artificial intelligence (AI) is rapidly transforming scientific research by accelerating simulations, predicting molecular and material structures and facilitating knowledge extraction from experimental data1,2,3,4,5,6,7,8. Although the long-term vision of autonomous scientific discovery is widely anticipated, wherein AI will not only analyse data but also plan and execute physical experiments, concrete progress towards this goal remains challenging in large scientific research infrastructures.
Recent studies have demonstrated promising applications of AI including machine learning and large language models (LLMs) in autonomous scientific discovery, such as Bayesian experimental design and active learning9,10,11,12,13,14,15,16,17,18,19, reinforcement-learning materials designers and experimental controllers20,21,22,23 and robotic diffractometer alignment21,24,25, as well as LLM-assisted scientific reasoning and agentic laboratory workflows14,26,27,28,29,30,31,32,33,34,35,36,37,38. In parallel, advances in embodied AI and robotics have enabled systems capable of executing complex physical tasks in real-world environments39,40,41. These developments signal the feasibility of AI systems that interact with the physical world. Further advances in LLMs, particularly those with enhanced reasoning capabilities and the ability to use tools via the model context protocol (MCP) have enabled the emergence of powerful agentic AI systems42,43,44,45,46,47 with the ability to think, reason and use external tools for addressing complex scientific problems48,49. Building on this foundation, a growing body of work has begun applying agentic AI systems to perform real-world experiments across chemistry, biology and materials science30,31,32,33,34,35,36,37,38.
These recent advances in agentic AI-driven experimentation in real-world settings bring hope for achieving autonomous physical reasoning and operation in large-scale research facilities, such as the X-ray, neutron and electron scattering facilities25,50,51,52,53,54. These facilities have been playing a foundational role in scientific discovery across materials science, chemistry, biology and physics7,55,56,57,58,59,60,61,62,63,64,65. However, these facilities are highly oversubscribed and require substantial human expertise for experimental operation. Meanwhile, increasing experimental complexity and major facility upgrades, including LCLS-II (Linac Coherent Light Source II) and the Advanced Photon Source Upgrade66,67,68, further intensify demands on beamtime efficiency and expert-driven operation.
Although many individual beamline operations can be addressed using deterministic optimization or scripted automation, real experimental workflows often require coordinating multiple steps under uncertainty, incomplete information and unexpected outcomes. Agentic AI systems offer a promising solution by serving as a flexible reasoning layer that autonomously sequences, interprets and adapts experimental actions through iterative tool use rather than executing a fixed prescripted workflow. Here, we present our methodology for developing an AI-driven X-ray scientist based on agentic LLM reasoning and structured tool use and demonstrate its deployment on a real X-ray beamline at the Stanford Synchrotron Radiation Lightsource (SSRL) at SLAC National Accelerator Laboratory. Rather than presenting new learning mechanisms or agentic AI architectures, this study centres on the development and deployment of existing reasoning-capable LLMs for closed-loop execution of a concrete experimental task at a synchrotron facility.
A key challenge in this development lies in exposing the agentic AI to real-world experimental environments and situations. As facility beamlines are complex and often oversubscribed, and experimental conditions can be very different from simulated conditions due to imperfections (for example, noise, spurious signals and technical limitations) and safety considerations (for example, radiation hazards and risks of motor collisions), making training an AI X-ray scientist directly from scratch on physical instruments impractical. Therefore, we developed a virtual beamline that replicated essential experimental operations and allowed our agentic AI to directly interact with it to perform simulated experiments. This enabled us to prepare our AI X-ray scientist in a virtual experimental environment before transitioning to a real experiment.
We showcase the capabilities of our AI X-ray scientist by asking it to determine the orientation matrix of a randomly aligned single-crystal sample, which is an essential and demanding prerequisite in many types of scattering experiments. This task involves navigation in reciprocal space using multiple degrees of freedom, often under strict physical constraints of motor limits and safety interlocks. Additional complications arising from unexpected situations such as hidden motor offsets, imperfect centres of rotation and uneven sample mounting can make the process even more challenging. Incomplete or missing information on residual stresses and the in-plane orientation of the sample69, as well as motor position reproducibility issues, can require human experts to undertake time-consuming trial-and-error procedures. For all these reasons, single-crystal sample alignment serves as an ideal testbed for evaluating the capabilities of our AI X-ray scientist.
We first introduce the overall workflow and guidance framework for AI X-ray scientists, followed by demonstrations in both virtual and real-beamline environments. We then benchmark multiple agentic AI models on orientation estimation and lattice parameter prediction tasks and finally demonstrate autonomous sample alignment at SSRL, including adaptation to unexpected motor offsets during real experimental operation.
Agentic AI-driven X-ray experimentation
Our agentic AI X-ray scientist was informed by physical knowledge and equipped with the necessary experimental tools via an MCP framework (‘MCP server and tools’ section in Methods). As illustrated in Fig. 1a, the AI X-ray scientist is granted access to terminal input/output history, detector images and motor scan results. We adopt the setup of a six-circle diffractometer70, a widely used and highly flexible instrument configuration. It includes six degrees of freedom: two detector motors (δ and ν) and four sample motors (ϕ, χ, η and μ).
a, AI X-ray scientist makes use of MCP tools to interact with the facility: it reads terminal commands and outputs, detector images and motor scan results and then issues terminal commands either through the MCP tool in virtual experiments or via a human experimentalist in real experiments for safety considerations. b, General workflow for sample orientation determination. The key steps are identification of two reference reflections. Transitions between stages are not preprogrammed but are decided by the AI X-ray scientist based on observed data and experimental context. 4S, four sample-orienting; 2D, two detector-orienting.
Within this framework, the AI X-ray scientist could issue beamline commands, such as those used by the X-ray instrument control software SPEC71, to operate the diffractometer. After a command is issued and executed, the AI X-ray scientist may check the experimental status or results, reason about the next steps and repeat this process until the experimental goal is achieved. A list of commands that the AI X-ray scientist can use is given in Table 1. In virtual experiments using the beamline simulator, all steps are carried out automatically by the AI X-ray scientist without human intervention, including command execution and results analysis. However, for the first real-beamline demonstration on BL17-2 at SSRL, the AI X-ray scientist autonomously generated the experimental commands, but their execution was relayed through a human experimentalist solely to satisfy facility safety requirements for this initial trial. This relay step ensured safety while preserving autonomy, as the exact commands proposed by the AI X-ray scientist were executed without modification.
In silico development and validation
We leverage in-context learning capabilities of agentic AI models72,73, where the preparation of guidance prompts play a central role. Given the limited availability of real beamtime, all guidance and testing were conducted using our in-house virtual beamline simulator (see ‘Virtual beamline for simulated experiments’ section in Methods for more details).
The overall sample alignment workflow provided in the guidance is summarized in Fig. 1b, consisting of the following major steps: (1) setup: the AI X-ray scientist acquires basic instrument and sample information, including the X-ray wavelength, lattice parameters and a list of accessible reflections. (2) Primary reflection search and optimization: the agent first moves to the theoretically calculated motor positions based on the target reflection’s 2θ angle and then performs one or more rounds of scans over η, χ and δ to optimize peak intensity and centre the Bragg peak; the motors μ and ν are not used, given the vertical reflection geometry (Fig. 1a). (3) Secondary reflection search and optimization: this step is similar to the previous step but with the added challenge of resolving in-plane orientation, often requiring a sufficiently wide ϕ scan. Motor movements are subject to physical limits (defined in Table 2), which are adopted from an operational beamline (BL17-2 at SSRL). In the zoomed-in view of Fig. 1b, the theoretical values for η are calculated from the sample surface normal vector n and the scattering vector Q, for Q vectors lying in the scattering plane.
Note that the high-level workflow shown in Fig. 1b serves as a conceptual scaffold rather than a hard-coded execution script. Although the overall goal and the set of available tools are specified, the AI X-ray scientist autonomously determines which tools to invoke, when to transition between the stages, which reflection peaks to probe and how to configure motor scans based on intermediate observations and the inferred experimental state. In practice, we provide detailed guidance prompts that describe the task structure and available tools at a high level, analogous to instructional documentation, while leaving all execution decisions to the AI agent (see ‘LLMs’ section of Methods for additional details; Supplementary Note 1).
We used the magnetic Weyl semimetal Co3Sn2S2 as our example material sample, which crystallizes in the rhombohedral space group \(R\bar{3}m\) (no. 166)74,75. In its conventional hexagonal cell, the lattice parameters are a = b ≈ 5.36 Å, c ≈ 13.02 Å and α = β = 90°, γ = 120° from the crystal structure file obtained via the Materials Project76,77. Figure 2a shows an example of the search and optimization process for the secondary reference reflection, (1, 0, 10), using our virtual beamline. As outlined in the workflow, the process begins with a wide ϕ scan, during which the AI X-ray scientist identifies a diffraction peak near ϕ ≈ −40.71°. A detector image is then acquired to confirm the presence of the peak, followed by an η scan to optimize its intensity. The AI X-ray scientist subsequently initiates a centring routine by scanning over χ and δ, whose effects on peak position are illustrated in Fig. 2a. The procedure concludes with a final η scan and another detector image to verify successful peak optimization. For each motor scan, the diffraction intensity plotted as a function of motor position corresponds to the integrated intensity within a specific region of interest (ROI): a vertical line ROI for χ and ϕ scans, a horizontal line ROI for δ scans and a centre area ROI for η scans. Note that in real experiments, it is quite rare to begin with no in-plane orientation information. The example shown here therefore represents a more challenging case than what is typically encountered, further highlighting the robustness and adaptability of the AI X-ray scientist.
a, Representative motor scans and detector image acquisitions performed by the AI X-ray scientist during a virtual single-crystal alignment procedure. Circular markers represent raw scan data, solid curves represent fitted peak profiles and vertical dashed lines indicate fitted peak positions. Detector images illustrate the corresponding diffraction patterns and regions of interest. Numbers 1–7 indicate the sequence of key actions during the procedure. b, Alignment error (in degrees) for sample orientation estimation across two agentic AI models. c, Absolute error in the estimated lattice constant c across the same two agentic AI models. d, Alignment error across different experimental scenarios for the Gemini 2.5 Flash-based AI X-ray scientist, including baseline conditions, increased motor offsets, multi-grain diffraction, reduced reasoning (thinking budget 512 tokens), and lowered LLM temperature settings. e, Absolute error in the estimated lattice constant c across the same experimental scenarios shown in d. In b–e, the box plots summarize the distribution of errors: the central line denotes the median, box edges indicate the range of 25th to 75th percentiles and whiskers extend to the minimum and maximum successful values. Individual data points from each run are shown as coloured circular markers, with colours corresponding to different experimental scenarios. Numbers in parentheses indicate the number of successful runs (alignment error ≤15° and ∣cpred − ctrue∣ ≤ 0.01 Å, respectively) over total attempts.
We note that the AI agent does not directly receive raw numerical detector arrays or tabular scan data. Detector images are provided to the AI agent as image inputs for qualitative interpretation. Results from motor scans are returned through MCP tools as rendered plots, with fitted curves and peak centres overlaid when fitting is successful, as illustrated in Fig. 2a.
To further assess the reliability of our AI X-ray scientist in completing the alignment process, we benchmarked two LLMs, Claude Sonnet 4 (ref. 78) and Gemini 2.5 Flash79 (see ‘LLMs’ section in Methods for details). Each model was evaluated via ten independent runs, with test setups incorporating unknown, randomly generated motor offsets: \(\Delta \eta \sim {\mathcal{N}}(0.{0}^{\circ },\,0.{5}^{\circ })\) and \(\Delta \phi \sim {\mathcal{N}}(0.{0}^{\circ },\,1.{5}^{\circ })\). In addition, both agentic AI models were informed with the nominal lattice parameters, whereas the simulated intensities used by the virtual beamline were intentionally generated using larger values a = b = 5.5 Å and c = 13.2 Å to increase task difficulty. The following two evaluation metrics were used to evaluate the performance of the two models:
• (1) Alignment error, defined as the relative angular deviation between the estimated and ground-truth orientation matrices$$\,\mathrm{Alignment}\,\mathrm{error}\,={\arccos }\left[\frac{1}{2}\times \left(\mathrm{tr}\,({{\bf{R}}}_{\mathrm{pred}}{{\bf{R}}}_{\mathrm{true}}^{{\top }})-1\right)\right],$$ (1) where Rpred and Rtrue are the predicted and true orientation matrices, respectively, and tr(·) denotes the matrix trace. We note that this may not be the most ideal metric, as diffraction peaks could be broad out of the plane and along 2θ but very sharp in θ. Nevertheless, it provides a general and intuitive measure of alignment accuracy.
Alignment error, defined as the relative angular deviation between the estimated and ground-truth orientation matrices
where Rpred and Rtrue are the predicted and true orientation matrices, respectively, and tr(·) denotes the matrix trace. We note that this may not be the most ideal metric, as diffraction peaks could be broad out of the plane and along 2θ but very sharp in θ. Nevertheless, it provides a general and intuitive measure of alignment accuracy.
• (2) Absolute error in the estimated lattice parameter c$$\,\mathrm{Lattice}\,\mathrm{parameter}\,c\,\mathrm{error}\,=| {c}_{\mathrm{pred}}-{c}_{\mathrm{true}}| ,$$ (2) where ctrue is the lattice constant used to generate the simulated intensities, and cpred is the value estimated by the AI X-ray scientists after lattice constant correction.
Absolute error in the estimated lattice parameter c
where ctrue is the lattice constant used to generate the simulated intensities, and cpred is the value estimated by the AI X-ray scientists after lattice constant correction.
The results for AI X-ray scientist based on two different LLMs are summarized in Fig. 2b,c. Both models successfully aligned the sample accurately in the majority of cases, consistently making alignment error below 5° for most runs. For runs with larger alignment errors, the primary cause was imperfect peak centreing by the AI X-ray scientist, for example, when adjusting the δ and χ motors. Nevertheless, in all such cases, the agent still successfully located the peak on the detector, allowing subsequent physically meaningful measurements. Some example detector images are provided in Supplementary Note 2. In terms of lattice parameter estimation, each model produced highly accurate c values, with the absolute error smaller than 0.01 Å, in more than half of the trials. Although this level of accuracy does not yet match the precision typically required in crystallography experiments, it is important to note that the most challenging step is often locating the correct peak in the first place for general experiments. Once the peak is identified, refining lattice parameters is comparatively straightforward, although it involves some repetitive procedures. The number of tool-use calls issued by each LLM is reported in Supplementary Note 3.
To better understand the overall performance of the agentic AI-driven workflow under various challenging conditions, we evaluate the Gemini 2.5 Flash-based AI X-ray scientist in multiple scenarios involving larger motor offsets, multi-grain diffraction, reduced reasoning budgets and lower LLM sampling temperature (Fig. 2d,e). Across these scenarios, the agent was generally able to recover the sample orientation and lattice parameter with reasonable accuracy in successful runs, although performance degraded under more adversarial conditions, particularly when reasoning depth was restricted. Representative examples and additional analyses, including failure modes associated with motor-limit behaviour and multi-grain peak fitting, are provided in Supplementary Notes 4 and 5. These results suggest that the workflow remains reasonably robust under imperfect and non-ideal experimental conditions.
Deploying the AI X-ray scientist on a real synchrotron experiment
The successful application of the AI X-ray scientist in virtual experiments is promising; however, real-world validation is an essential step given the presence of sample imperfections, instrument variability, safety constraints, observation noise and other factors not captured in simulation. In this section, we demonstrate that the AI X-ray scientist can perform autonomous tasks on a real hard X-ray beamline while retaining its core agentic workflow, requiring only necessary interface-level adaptations to accommodate the real-beamline experimental data stream.
We deployed the AI X-ray scientist on beamline BL17-2 at SSRL. Details about real experiments are presented in Methods section (Synchrotron X-ray experiment) and Supplementary Note 6. The same guidance used in the virtual experiments was provided, apart from one safety-related constraint: the AI X-ray scientist was prompted to output the terminal command it intended to run using the format ‘Execute Command: [commands]’, which was then relayed by a human experimentalist to the controlling terminal. After each execution, the AI was simply told ‘Please read the log and continue’. Beyond this fixed relay step, there was no additional interaction; the human presence served purely as a passive safety intermediary, without influencing the experiment’s outcome or the AI’s decision-making process. All other actions, including accessing terminal input/output histories, analysing scan results and acquiring detector images, were carried out independently by the AI X-ray scientist using MCP tools as detailed in the ‘MCP server and tools’ section in Methods.
For the real-world beamline experiments, we used a more capable model, Anthropic’s Claude Opus 478, to maximize robustness and minimize operational risk during limited and valuable beamtime. Although other tested models were also able to perform the task in simulation, the use of a larger model was a practical choice to ensure reliability under real experimental conditions. Due to beamtime constraints, real experiment configurations were not systematically repeated under identical conditions during the beamline session.
For real experimental demonstration, we used Co3Sn2S2, the same material system considered in the virtual experiments, whereas the AI X-ray scientist was provided with a different structure file from the Crystallography Open Database80,81. The Crystallography Open Database structure file was adopted in accord with standard experimental practice, which favours experimentally curated crystal structures in real measurements. This choice does not affect the agentic workflow, which is independent of the crystallographic data source. After acquiring basic experimental information during the setup phase, the AI X-ray scientist began planning and searching for the first reference reflection, as illustrated by the AI quote shown in Extended Data Fig. 1.
Given that Co3Sn2S2 has a hexagonal lattice with a substantially longer c axis, the AI X-ray scientist reasonably assumes that the c axis is aligned with the surface normal and selects a specular (0, 0, L) reflection, specifically (0, 0, 6), as the initial target. It sets the η and δ motors to the theoretical values corresponding to this reflection and captures a detector image, which reveals a faint peak (Fig. 3a). It then performs a scan over η and adjusts the motor to the angle that maximizes intensity (Fig. 3b). Notably, the AI agent identifies an unexpected offset of approximately 1.22° in η, potentially caused by the uneven surface of the copper sample holder. The AI agent highlights this deviation in its reasoning and updates η accordingly, as shown in Extended Data Fig. 2, showcasing its ability to adapt to experimental imperfections.
a–g, Actions taken by the AI X-ray scientist include: capturing a detector image after moving motors η and δ to the theoretical values for the (0, 0, 6) reflection (a); performing an η scan to optimize peak intensity (b); capturing a second detector image to verify the presence of the reflection (c); conducting a χ scan to centre the peak horizontally (d), followed by a δ scan to centre the peak vertically (e), and a final η scan for intensity optimization (f) ; and capturing the final detector image to confirm the optimized reflection before registering the current motor positions as corresponding to the first reference peak (0, 0, 6) (g). Circular markers represent raw scan data. The solid curves show peak fits and dashed vertical lines represent fitted peak centres, which are reproduced post hoc using the same fitting routines available to the AI X-ray scientist during experimental operation. The numbered annotations indicate the sequence of commands and actions executed by the AI X-ray scientist during the alignment procedure.
Next, the AI X-ray scientist captures another detector image to confirm that the intensity has been successfully optimized (Fig. 3c). It then proceeds through a centring process using χ and δ (Fig. 3d–f), mirroring the workflow from the virtual experiments. The final η optimization demonstrates the AI X-ray scientist’s ability to perform precise and high-quality sample alignment. Finally, it acquires a verification image (Fig. 3g) and sets the current diffractometer configuration as the primary reference reflection using the or0 0 0 6 command.
With the primary reference reflection identified, the AI X-ray scientist proceeds to locate the secondary reference reflection with the reasoning process for planning shown in Extended Data Fig. 3. Based on the calculated angular separation and peak intensities, the agent selects the (1, 0, 10) reflection as a suitable candidate, noting its sufficient intensity (7.2% of the strongest peak’s intensity) and the constraint to prevent the scattering vector from pointing below the sample surface (η = 2.06°). To account for the previously discovered offset in η (≈1.22°), it adjusts the target value to η = 0.84°, while setting δ ≈ 35.72° accordingly. Execution of this command successfully positions the detector to capture the (1, 0, 10) peak (Fig. 4a). Notably, the AI X-ray scientist was not provided with any prior information about the sample’s in-plane orientation. Nevertheless, the peak appears even before any ϕ scan is conducted (Fig. 4b), owing to relatively good initial sample placement and the peak’s broad intensity distribution in the ϕ degree of freedom. The AI X-ray scientist eventually identifies the correct in-plane orientation near ϕ ≈ −2.88°. Importantly, the AI X-ray scientist still performs a sufficiently wide ϕ scan that would have enabled successful alignment even under less favourable initial conditions. As shown in Fig. 4c–f, the agent carries out peak centring and intensity optimization, ultimately converging on a well-aligned configuration for the (1, 0, 10) reflection (Fig. 4g). Throughout this sequence, the AI scientist maintains focus on the Bragg peak, effectively ignoring a strong diffraction ring that appears in the detector image. The verification peak (2, 0, 14) is shown in Supplementary Note 7 to confirm the correct alignment.
This case highlights a challenging scenario where the AI X-ray scientist had no prior knowledge of the in-plane (H–K) orientation, which is a rare setup even in human-led experiments. Meanwhile, despite the presence of strong diffraction rings captured by the detector, the AI remained focused and successfully localized the Bragg peak. a–g, Actions taken include: capturing a detector image after moving motors η and δ to the theoretical values for the (1, 0, 10) reflection (a); performing a wide ϕ scan to determine the in-plane orientation (b); performing an η scan to optimize peak intensity (c); conducting a χ scan to centre the peak horizontally (d), followed by a δ scan to centre the peak vertically (e), and a final η scan for intensity optimization (f); capturing the final detector image to confirm the optimized reflection before associating the current motor positions with the second reference peak (1, 0, 10) (g). Circular markers, solid curves and dashed vertical lines follow the same conventions as in Fig. 3. The numbered annotations indicate the sequence of commands and actions executed by the AI X-ray scientist during the alignment procedure.
Although the encountered unexpected η offset and the corresponding adaptive alignment behaviour were observed during a limited number of real-beamline trials and should not be interpreted as a statistically established capability, this result demonstrates the potential of an LLM-driven agent to maintain robust closed-loop operation under unmodelled experimental conditions through iterative observation and reasoning.
We also carried out a real experimental demonstration using a single-crystal Si sample, in which the AI X-ray scientist successfully aligned the sample under a challenging situation involving a significant motor offset of Δη = 1.5° and extremely sharp peaks. Further details are provided in Supplementary Note 8. These real-world demonstrations provide proof-of-concept evidence that the AI X-ray scientist can operate reliably and flexibly in real experimental environments and may serve as an effective collaborator in experimental science.
Discussion
We presented a methodology for preparing an agentic AI X-ray scientist through virtual experimentation and validated its performance on a real-world synchrotron X-ray instrument. The AI X-ray scientist demonstrated promising performance on virtual benchmarks and successfully aligned samples in real experiments, including both a high-quality Si crystal sample with sharp peaks and a Co3Sn2S2 sample with broader peaks. These demonstrations across both virtual and real experiments and on samples with either sharp or broad peaks, highlight the robustness of our approach in preparing the AI X-ray scientist for experimental tasks, as well as its capabilities for transparent reasoning, interpretable decision-making and reliable execution under realistic constraints.
One particularly notable capability demonstrated during the real experiment was the AI X-ray scientist’s ability to identify and reuse an empirical correction associated with an unexpected motor offset during subsequent alignment steps. This behaviour illustrates adaptive reasoning and short-term experimental memory beyond fixed scripted workflows. Importantly, the preparation and refinement of these AI X-ray scientists can largely occur within virtual experimental environments, reducing dependence on costly and limited beamtime during development.
Rather than introducing a new learning algorithm or fine-tuning the underlying language model, this work focuses on how reasoning-capable LLMs can be operationalized for closed-loop experimental execution on real, large-scale scientific instruments. The key contribution is to show that, when coupled with structured tool interfaces, persistent experimental state and iterative in-context reasoning, such models can carry out multi-step autonomous experimental workflows in realistic scientific settings. Although the core reasoning model is used off the shelf, we view this as an enabling factor that lowers the barrier to deploying general-purpose AI X-ray scientists in experimental facilities and as a foundation for future work that may integrate learning-based components on top of such agentic control frameworks.
In the meantime, although the present study focuses on sample alignment, this task represents a broadly relevant prerequisite for many synchrotron X-ray, X-ray free electron laser and neutron experiments. A particularly important future direction is the development of meta-agents that can assist in constructing and refining instrument-specific guidance prompts, thereby reducing the upfront effort required to adapt the framework to new beamlines, instruments and experimental workflows. Future work may further extend these capabilities through improved tool interfaces, retrieval-augmented reasoning, data-driven experimental planning and task-specific adaptation strategies17,82,83,84,85,86.
Taken together, our results demonstrate that agentic AI X-ray scientists can perform meaningful tasks in real experimental settings. We envision a future where autonomous AI systems serve not just as tools for automation but as scientific assistants or even collaborators that improve efficiency of complex facilities and enable entirely new modes of experimentation. With continued development, we believe that agentic AI holds the potential to reshape the research landscape and greatly accelerate the pace of scientific discovery.
Virtual beamline for simulated experiments
We built a virtual beamline that exposes AI X-ray scientists to simulated experiments for preparing guidance prompts, without relying on highly limited experimental beamtime. The beamline simulator was written in Python and can be run on a typical laptop or desktop computer. The key function is to determine the momentum transfer Q for each detector pixel, which we calculate using the formalism by You70. We first calculate Rsample and Rdetector. Specifically, we have
The diffraction intensities captured by the detector pixels are calculated as
where Rsample is the rotation matrix applied to the sample, and Qc denotes the scattering vector determined by the detector geometry before applying the sample rotation
Here, λ is the X-ray wavelength, \({\widehat{{\bf{k}}}}_{{\rm{in}}}\) is a unit vector in the lab Cartesian coordinate system representing the incident beam direction, and \({\widehat{{\bf{k}}}}_{{\rm{out}}}\) is a unit vector in the same coordinate system pointing to the individual detector pixels, determined from Rdetector and the detector distance from the sample.
The diffraction intensity I(Q) used in our beamline simulator is calculated by the implementation provided in pymatgen87,88. Gaussian broadening with σQ = 0.026 Å−1 is applied to simulated peaks, followed by a non-isotropic stretch with relative factors of 1.0, 1.5 and 0.75 along H, K and L directions, respectively, to make simulated intensities more ‘realistic’ to the AI X-ray scientist. The detector image is then obtained using equation (8) for all calculated Q vectors, and a series of imperfections, such as inactive and hot pixels and readout noise, are added to the final image. We note that these steps are not intended to produce quantitatively exact diffraction intensities but rather to generate detector images that visually resemble experimental data for preparing our AI X-ray scientist. An example detector image can be found in Supplementary Note 2. Further details about our virtual beamline are provided in our Python implementation included in the source code (see ‘Data availability’ and ‘Code availability’ sections). The interactions between the AI and the virtual beamline are mediated through MCP.
MCP server and tools
We developed an MCP server89 hosting the necessary tools to enable interactions between the AI X-ray scientist and the virtual beamline. The general workflow proceeds as follows: the AI X-ray scientist first creates a new Python session, which maintains its own global state. Within this session, the AI instantiates a Python object, experiment (implemented as a Python class), representing the virtual experiment. This object hosts the sample and diffractometer states, enabling it to mimic experimental operations (for example, moving motors or performing scans) and generate simulated detector images. The AI then issues ‘terminal commands’ via the MCP tool execute_command. These commands are not executed directly on a real system terminal; instead, they are parsed by simple keyword detection and directed to trigger the corresponding Python methods on the virtual experiment object, thereby emulating the behaviour and workflow of the real-beamline control software. The AI X-ray scientist can complete essential experimental operations through the commands introduced in Table 1 using this MCP tool. Some other auxiliary MCP tools are also made available to the AI X-ray scientist, such as get_sample_information for querying the basic sample and experimental information including lattice parameters, attainable reflections and X-ray wavelength. In virtual experiments, the AI X-ray scientists directly obtain results after calling an MCP tool run. In real experiments, given the relay step of terminal commands, additional MCP tools are prepared, including read_log, explore_directory, read_and_plot_image and read_and_plot_spec, such that the AI X-ray scientist can check out terminal inputs/outputs, recent file changes, detector images and scan results.
In the current implementation, terminal command extraction from the LLM output is performed using a keyword-based parsing strategy, designed to mirror established beamline control workflows (for example, those used in SPEC-like interfaces). Although this approach proved sufficient for the experiments reported here, we acknowledge that keyword-based parsing can be susceptible to ambiguity or formatting errors. More structured output schemes, such as enforcing JavaScript Object Notation-based schemas or typed interfaces (for example, via pydantic models), represent a promising direction for improving robustness and reliability in future implementations.
Synchrotron X-ray experiment
The Synchrotron X-ray experiment was carried out at beamline BL17-2 of the SSRL, SLAC National Accelerator Laboratory. The incident X-ray energy was set to 16.0 keV, corresponding to a wavelength of around 0.7749 Å. The Co3Sn2S2 sample was mounted on a copper holder, and measurements were performed at room temperature under ambient air. Photographs of the sample and the six-circle diffractometer are provided in Supplementary Note 6. We note that, during deployment from the virtual to the real beamline, minor environment-specific adjustments were made to MCP tools to match the real-beamline control interface; however, the AI agent’s prompting, reasoning structure and decision logic remained unchanged.
Claude Opus 4 was accessed via the Claude Desktop interface. Claude Sonnet 4 was accessed both via the Claude Desktop interface and via LibreChat90 using application programming interface (API) access. Gemini 2.5 Flash was accessed through LibreChat using API access.
In LibreChat, the maximum number of agent steps was set to 100. The model parameters were all default values preconfigured by LibreChat as follows unless otherwise noted: the parameters for Claude Sonnet 4 are temperature = 1.0, top-P = 0.7 and top-K = 5 with 2,000 thinking budget, whereas for Gemini 2.5 Flash, the parameters are temperature = 1.00, top-P = 0.95 and top-K = 40 with the ‘thinking’ feature enabled with the budget set to ‘Auto’; the maximum output length was capped at 8,192 tokens. Anthropic’s Claude models accessed via the Claude Desktop interface do not expose user-accessible controls for inference parameters and were therefore used with their default configurations; however, for the Claude Sonnet 4 model, we observed behaviour consistent with runs performed via API-based access.
Both agentic AI models were initialized with a combination of a short prompt and a long guidance prompt, with the agent prompted to ‘Please continue.’ whenever the process is interrupted such as by reaching the maximum number of steps. The short prompt specified essential information, such as the working directory containing the structure file and the expected experimental outputs, along with key reminders for the AI X-ray scientist. The long guidance prompt provided additional context and detailed instructions. More information about these prompts is provided in Supplementary Note 1. Information about complete conversation histories for the results presented in deploying the AI X-ray scientist on a real synchrotron experiment can be found in Supplementary Note 9.
Guidance prompts were primarily developed within the virtual beamline environment. The process began with writing detailed documentation for each MCP tool, specifying its purpose, required inputs, returned outputs and appropriate usage, often supplemented with illustrative examples. We then provided high-level workflow guidance describing the overall experimental procedure and alignment objectives. These documents were designed to be generalizable for accomplishing the alignment task while remaining agnostic to the specific crystal under study.
Although the long guidance prompt provides detailed step-by-step instructions for the workflow, execution order and control flow are not hard-coded and are instead determined by the AI agent. Decisions such as selecting target reference reflections and transitioning between peak searching and refinement are autonomously determined by the AI agent, distinguishing our approach from traditional script-based automation. Prompt preparation further involved iterative identification of failure modes during simulated operation (for example, unreasonable scan ranges), followed by refinements that guide the agent towards safer and more reliable behaviours. Behaviours that were insufficiently followed by the AI agent despite being described in the long prompt are explicitly reiterated in the short guidance prompt.
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.
Data availability
The data that support the findings of this study are publicly available via Zenodo at https://doi.org/10.5281/zenodo.20017861 (ref. 91). Source data are provided with this paper.
Code availability
The source code of this study is publicly available via Zenodo at https://doi.org/10.5281/zenodo.20017991 (ref. 92).
References
• Chen, Z. et al. Machine learning on neutron and x-ray scattering and spectroscopies. Chem. Phys. Rev. 2, 031301 (2021).Article Google Scholar
Chen, Z. et al. Machine learning on neutron and x-ray scattering and spectroscopies. Chem. Phys. Rev. 2, 031301 (2021).
• Kochkov, D. Machine learning–accelerated computational fluid dynamics. Proc. Natl Acad. Sci. USA 118, e2101784118 (2021).Article MathSciNet Google Scholar
Kochkov, D. Machine learning–accelerated computational fluid dynamics. Proc. Natl Acad. Sci. USA 118, e2101784118 (2021).
Article MathSciNet Google Scholar
• Jumper, J. Highly accurate protein structure prediction with alphafold. Nature 596, 583–589 (2021).Article Google Scholar
Jumper, J. Highly accurate protein structure prediction with alphafold. Nature 596, 583–589 (2021).
• Chitturi, S. Capturing dynamical correlations using implicit neural representations. Nat. Commun. 14, 5852 (2023).Article Google Scholar
Chitturi, S. Capturing dynamical correlations using implicit neural representations. Nat. Commun. 14, 5852 (2023).
• Wang, H. Scientific discovery in the age of artificial intelligence. Nature 620, 47–60 (2023).Article Google Scholar
Wang, H. Scientific discovery in the age of artificial intelligence. Nature 620, 47–60 (2023).
• Li, J. & Lopez, S. A. Machine learning accelerated photodynamics simulations. Chem. Phys. Rev. 4, 031309 (2023).Article Google Scholar
Li, J. & Lopez, S. A. Machine learning accelerated photodynamics simulations. Chem. Phys. Rev. 4, 031309 (2023).
• Plumley, R. On ultrafast X-ray scattering methods for magnetism. Adv. Phys. X 9, 2423935 (2024). Google Scholar
Plumley, R. On ultrafast X-ray scattering methods for magnetism. Adv. Phys. X 9, 2423935 (2024).
• Li, H. Machine learning-accelerated discovery of heat-resistant polysulfates for electrostatic energy storage. Nat. Energy 10, 90–100 (2025).Article Google Scholar
Li, H. Machine learning-accelerated discovery of heat-resistant polysulfates for electrostatic energy storage. Nat. Energy 10, 90–100 (2025).
• Yamawaki, M., Ohnishi, M., Ju, S. & Shiomi, J. Multifunctional structural design of graphene thermoelectrics by Bayesian optimization. Sci. Adv. 4, eaar4192 (2018).Article Google Scholar
Yamawaki, M., Ohnishi, M., Ju, S. & Shiomi, J. Multifunctional structural design of graphene thermoelectrics by Bayesian optimization. Sci. Adv. 4, eaar4192 (2018).
• Lookman, T., Balachandran, P. V., Xue, D. & Yuan, R. Active learning in materials science with emphasis on adaptive sampling using uncertainties for targeted design. npj Comput. Mater. 5, 21 (2019).Article Google Scholar
Lookman, T., Balachandran, P. V., Xue, D. & Yuan, R. Active learning in materials science with emphasis on adaptive sampling using uncertainties for targeted design. npj Comput. Mater. 5, 21 (2019).
• McMichael, R. D., Dushenko, S. & Blakley, S. M. Sequential Bayesian experiment design for adaptive Ramsey sequence measurements. J. Appl. Phys. 130, 144401 (2021).Article Google Scholar
McMichael, R. D., Dushenko, S. & Blakley, S. M. Sequential Bayesian experiment design for adaptive Ramsey sequence measurements. J. Appl. Phys. 130, 144401 (2021).
• Ament, S. Autonomous materials synthesis via hierarchical active learning of nonequilibrium phase diagrams. Sci. Adv. 7, eabg4930 (2021).Article Google Scholar
Ament, S. Autonomous materials synthesis via hierarchical active learning of nonequilibrium phase diagrams. Sci. Adv. 7, eabg4930 (2021).
• MacLeod, B. P. A self-driving laboratory advances the pareto front for material properties. Nat. Commun. 13, 995 (2022).Article Google Scholar
MacLeod, B. P. A self-driving laboratory advances the pareto front for material properties. Nat. Commun. 13, 995 (2022).
• Szymanski, N. J. An autonomous laboratory for the accelerated synthesis of novel materials. Nature 624, 86–91 (2023).Article Google Scholar
Szymanski, N. J. An autonomous laboratory for the accelerated synthesis of novel materials. Nature 624, 86–91 (2023).
• Teixeira Parente, M. Active learning-assisted neutron spectroscopy with log-gaussian processes. Nat. Commun. 14, 2246 (2023).Article Google Scholar
Teixeira Parente, M. Active learning-assisted neutron spectroscopy with log-gaussian processes. Nat. Commun. 14, 2246 (2023).
• Chen, Z. Bayesian experimental design and parameter estimation for ultrafast spin dynamics. Mach. Learn. Sci. Technol. 4, 045056 (2023).Article Google Scholar
Chen, Z. Bayesian experimental design and parameter estimation for ultrafast spin dynamics. Mach. Learn. Sci. Technol. 4, 045056 (2023).
• Chen, Z. et al. Implicit neural representations for experimental steering of advanced experiments. Cell Rep. Phys. Sci. 6, 102333 (2025).Article Google Scholar
Chen, Z. et al. Implicit neural representations for experimental steering of advanced experiments. Cell Rep. Phys. Sci. 6, 102333 (2025).
• Chu, T., Estrada, J. B. & Bryngelson, S. H. Bayesian optimal design accelerates discovery of soft material properties from bubble dynamics. Comput. Mech. 76, 431–447 (2025).Article MathSciNet Google Scholar
Chu, T., Estrada, J. B. & Bryngelson, S. H. Bayesian optimal design accelerates discovery of soft material properties from bubble dynamics. Comput. Mech. 76, 431–447 (2025).
Article MathSciNet Google Scholar
• Nair, A. S. & Foppa, L. A critical examination of active learning workflows in materials science. Digit. Discov. https://doi.org/10.1039/D6DD00081A (2026).Article Google Scholar
Nair, A. S. & Foppa, L. A critical examination of active learning workflows in materials science. Digit. Discov. https://doi.org/10.1039/D6DD00081A (2026).
• Karpovich, C., Pan, E. & Olivetti, E. A. Deep reinforcement learning for inverse inorganic materials design. npj Comput. Mater. 10, 287 (2024).Article Google Scholar
Karpovich, C., Pan, E. & Olivetti, E. A. Deep reinforcement learning for inverse inorganic materials design. npj Comput. Mater. 10, 287 (2024).
• Yotsumoto, Y., Nakajima, Y., Takamoto, R., Takeichi, Y. & Ono, K. Autonomous robotic experimentation system for powder X-ray diffraction. Digit. Discov. 3, 2523–2532 (2024).Article Google Scholar
Yotsumoto, Y., Nakajima, Y., Takamoto, R., Takeichi, Y. & Ono, K. Autonomous robotic experimentation system for powder X-ray diffraction. Digit. Discov. 3, 2523–2532 (2024).
• Bloor, M. Control-informed reinforcement learning for chemical processes. Ind. Eng Chem. Res. 64, 4966–4978 (2025).Article Google Scholar
Bloor, M. Control-informed reinforcement learning for chemical processes. Ind. Eng Chem. Res. 64, 4966–4978 (2025).
• Nguyen, T. M. & Truong, T. N. Inverse design using goal-conditioned reinforcement learning for organic semiconductor materials from benzene and thiophene-based polycyclic aromatic compounds. npj Comput. Mater. 11, 372 (2025).Article Google Scholar
Nguyen, T. M. & Truong, T. N. Inverse design using goal-conditioned reinforcement learning for organic semiconductor materials from benzene and thiophene-based polycyclic aromatic compounds. npj Comput. Mater. 11, 372 (2025).
• Masina, S. Automated high-throughput high-resolution X-ray diffraction capabilities at SSRL BL 2-1. Struct. Dyn. 12, A243 (2025).Article Google Scholar
Masina, S. Automated high-throughput high-resolution X-ray diffraction capabilities at SSRL BL 2-1. Struct. Dyn. 12, A243 (2025).
• Crain, C. A. et al. Design of a robot-automated flat plate/reflection geometry X-ray diffraction setup for accelerated materials discovery and structural screening. Rev. Sci. Instrum. 96, 023904 (2025).Article Google Scholar
Crain, C. A. et al. Design of a robot-automated flat plate/reflection geometry X-ray diffraction setup for accelerated materials discovery and structural screening. Rev. Sci. Instrum. 96, 023904 (2025).
• Zhang, Y. et al. A comprehensive survey of scientific large language models and their applications in scientific discovery. In Proc. 2024 Conference on Empirical Methods in Natural Language Processing (eds Al-Onaizan, Y. et al.) 8783–8817 (Association for Computational Linguistics, Miami, 2024); https://doi.org/10.18653/v1/2024.emnlp-main.498
Zhang, Y. et al. A comprehensive survey of scientific large language models and their applications in scientific discovery. In Proc. 2024 Conference on Empirical Methods in Natural Language Processing (eds Al-Onaizan, Y. et al.) 8783–8817 (Association for Computational Linguistics, Miami, 2024); https://doi.org/10.18653/v1/2024.emnlp-main.498
• Ghafarollahi, A. & Buehler, M. J. ProtAgents: protein discovery via large language model multi-agent collaborations combining physics and machine learning. Digit. Discov. 3, 1389–1409 (2024).Article Google Scholar
Ghafarollahi, A. & Buehler, M. J. ProtAgents: protein discovery via large language model multi-agent collaborations combining physics and machine learning. Digit. Discov. 3, 1389–1409 (2024).
• Lei, G., Docherty, R. & Cooper, S. J. Materials science in the era of large language models: a perspective. Digit. Discov. 3, 1257–1272 (2024).Article Google Scholar
Lei, G., Docherty, R. & Cooper, S. J. Materials science in the era of large language models: a perspective. Digit. Discov. 3, 1257–1272 (2024).
• Schmidgall, S. et al. Agent laboratory: using LLM agents as research assistants. in Findings of the Association for Computational Linguistics: EMNLP 2025 (eds Christodoulopoulos, C., Chakraborty, T., Rose, C. & Peng, V.) 5977–6043 (Association for Computational Linguistics, Suzhou, China, 2025); https://doi.org/10.18653/v1/2025.findings-emnlp.320
Schmidgall, S. et al. Agent laboratory: using LLM agents as research assistants. in Findings of the Association for Computational Linguistics: EMNLP 2025 (eds Christodoulopoulos, C., Chakraborty, T., Rose, C. & Peng, V.) 5977–6043 (Association for Computational Linguistics, Suzhou, China, 2025); https://doi.org/10.18653/v1/2025.findings-emnlp.320
• Boiko, D. A., MacKnight, R., Kline, B. & Gomes, G. Autonomous chemical research with large language models. Nature 624, 570–578 (2023).Article Google Scholar
Boiko, D. A., MacKnight, R., Kline, B. & Gomes, G. Autonomous chemical research with large language models. Nature 624, 570–578 (2023).
• Dai, T. Autonomous mobile robots for exploratory synthetic chemistry. Nature 635, 890–897 (2024).Article Google Scholar
Dai, T. Autonomous mobile robots for exploratory synthetic chemistry. Nature 635, 890–897 (2024).
• Fushimi, K. Development of the autonomous lab system to support biotechnology research. Sci. Rep. 15, 6648 (2025).Article Google Scholar
Fushimi, K. Development of the autonomous lab system to support biotechnology research. Sci. Rep. 15, 6648 (2025).
• Yang, J. Zero-shot autonomous microscopy for scalable and intelligent characterization of 2D materials. ACS Nano 19, 35493–35502 (2025).Article Google Scholar
Yang, J. Zero-shot autonomous microscopy for scalable and intelligent characterization of 2D materials. ACS Nano 19, 35493–35502 (2025).
• Zhang, Z. et al. A multimodal robotic platform for multi-element electrocatalyst discovery. Nature 647, 390–396 (2025).Article Google Scholar
Zhang, Z. et al. A multimodal robotic platform for multi-element electrocatalyst discovery. Nature 647, 390–396 (2025).
• Qu, Y. et al. CRISPR-GPT for agentic automation of gene-editing experiments. Nat. Biomed. Eng 10, 245–258 (2026).Article Google Scholar
Qu, Y. et al. CRISPR-GPT for agentic automation of gene-editing experiments. Nat. Biomed. Eng 10, 245–258 (2026).
• Song, T. A multiagent-driven robotic ai chemist enabling autonomous chemical research on demand. J. Am. Chem. Soc. 147, 12534–12545 (2025).Article Google Scholar
Song, T. A multiagent-driven robotic ai chemist enabling autonomous chemical research on demand. J. Am. Chem. Soc. 147, 12534–12545 (2025).
• Tom, G. Self-driving laboratories for chemistry and materials science. Chem. Rev. 124, 9633–9732 (2024).Article Google Scholar
Tom, G. Self-driving laboratories for chemistry and materials science. Chem. Rev. 124, 9633–9732 (2024).
• Ramos, M. C., Collison, C. J. & White, A. D. A review of large language models and autonomous agents in chemistry. Chem. Sci. 16, 2514–2572 (2025).Article Google Scholar
Ramos, M. C., Collison, C. J. & White, A. D. A review of large language models and autonomous agents in chemistry. Chem. Sci. 16, 2514–2572 (2025).
• Kim, M. J. et al. OpenVLA: an open-source vision-language-action model. In Proc. 8th Conference on Robot Learning (eds Agrawal, P. et al.) 2679–2713 (PMLR, 2025); https://proceedings.mlr.press/v270/kim25c.html
Kim, M. J. et al. OpenVLA: an open-source vision-language-action model. In Proc. 8th Conference on Robot Learning (eds Agrawal, P. et al.) 2679–2713 (PMLR, 2025); https://proceedings.mlr.press/v270/kim25c.html
• Ruan, Y. An automatic end-to-end chemical synthesis development platform powered by large language models. Nat. Commun. 15, 10160 (2024).Article Google Scholar
Ruan, Y. An automatic end-to-end chemical synthesis development platform powered by large language models. Nat. Commun. 15, 10160 (2024).
• Mon-Williams, R., Li, G., Long, R., Du, W. & Lucas, C. G. Embodied large language models enable robots to complete complex tasks in unpredictable environments. Nat. Mach. Intell. 7, 592–601 (2025).Article Google Scholar
Mon-Williams, R., Li, G., Long, R., Du, W. & Lucas, C. G. Embodied large language models enable robots to complete complex tasks in unpredictable environments. Nat. Mach. Intell. 7, 592–601 (2025).
• Wei, J. et al. Chain-of-thought prompting elicits reasoning in large language models. Adv. Neural Inf. Process. Syst. 35, 24824–24837 (2022).Article Google Scholar
Wei, J. et al. Chain-of-thought prompting elicits reasoning in large language models. Adv. Neural Inf. Process. Syst. 35, 24824–24837 (2022).
• Yao, S. et al. Tree of thoughts: deliberate problem solving with large language models. Adv. Neural Inf. Process. Syst. 36, 11809–11822 (2023).Article Google Scholar
Yao, S. et al. Tree of thoughts: deliberate problem solving with large language models. Adv. Neural Inf. Process. Syst. 36, 11809–11822 (2023).
• Singh, I. et al. ProgPrompt: generating situated robot task plans using large language models. In 2023 IEEE International Conference on Robotics and Automation (IEEE, 2023); https://doi.org/10.1109/ICRA48891.2023.10161317
Singh, I. et al. ProgPrompt: generating situated robot task plans using large language models. In 2023 IEEE International Conference on Robotics and Automation (IEEE, 2023); https://doi.org/10.1109/ICRA48891.2023.10161317
• Yao, S. et al. ReAct: synergizing reasoning and acting in language models. In The 11th International Conference on Learning Representations (2023); https://openreview.net/forum?id=WE_vluYUL-X
Yao, S. et al. ReAct: synergizing reasoning and acting in language models. In The 11th International Conference on Learning Representations (2023); https://openreview.net/forum?id=WE_vluYUL-X
• Minaee, S. et al. Large language models: a survey. Preprint at https://arxiv.org/abs/2402.06196 (2024).
Minaee, S. et al. Large language models: a survey. Preprint at https://arxiv.org/abs/2402.06196 (2024).
• Hou, X., Zhao, Y., Wang, S. & Wang, H. Model context protocol (MCP): landscape, security threats, and future research directions. ACM Trans. Softw. Eng Methodol. https://doi.org/10.1145/3796519 (2025).Article Google Scholar
Hou, X., Zhao, Y., Wang, S. & Wang, H. Model context protocol (MCP): landscape, security threats, and future research directions. ACM Trans. Softw. Eng Methodol. https://doi.org/10.1145/3796519 (2025).
• Ma, Y. et al. SciAgent: tool-augmented language models for scientific reasoning. In Proc. 2024 Conference on Empirical Methods in Natural Language Processing (eds Al-Onaizan, Y. et al.) 15701–15736 (Association for Computational Linguistics, 2024); https://doi.org/10.18653/v1/2024.emnlp-main.880
Ma, Y. et al. SciAgent: tool-augmented language models for scientific reasoning. In Proc. 2024 Conference on Empirical Methods in Natural Language Processing (eds Al-Onaizan, Y. et al.) 15701–15736 (Association for Computational Linguistics, 2024); https://doi.org/10.18653/v1/2024.emnlp-main.880
• Wu, J., Zhu, J., Liu, Y., Xu, M. & Jin, Y. Agentic reasoning: a streamlined framework for enhancing LLM reasoning with agentic tools. In Proc. 63rd Annual Meeting of the Association for Computational Linguistics Vol. 1 (eds Che, W. et al.) 28489–28503 (2025); https://doi.org/10.18653/v1/2025.acl-long.1383
Wu, J., Zhu, J., Liu, Y., Xu, M. & Jin, Y. Agentic reasoning: a streamlined framework for enhancing LLM reasoning with agentic tools. In Proc. 63rd Annual Meeting of the Association for Computational Linguistics Vol. 1 (eds Che, W. et al.) 28489–28503 (2025); https://doi.org/10.18653/v1/2025.acl-long.1383
• Corrao, A. A. et al. A modular framework for collaborative human-AI, multi-modal and multi-beamline synchrotron experiments. Preprint at https://arxiv.org/abs/2509.22959 (2025).
Corrao, A. A. et al. A modular framework for collaborative human-AI, multi-modal and multi-beamline synchrotron experiments. Preprint at https://arxiv.org/abs/2509.22959 (2025).
• Ding, L. & Do, C. SasAgent: multi-agent AI system for small-angle scattering data analysis. J. Appl. Cryst. 59, 578–585 (2026).Article Google Scholar
Ding, L. & Do, C. SasAgent: multi-agent AI system for small-angle scattering data analysis. J. Appl. Cryst. 59, 578–585 (2026).
• Yao, L. et al. Operationalizing serendipity: multi-agent AI workflows for enhanced materials characterization with theory-in-the-loop. Preprint at https://arxiv.org/abs/2508.06569 (2025).
Yao, L. et al. Operationalizing serendipity: multi-agent AI workflows for enhanced materials characterization with theory-in-the-loop. Preprint at https://arxiv.org/abs/2508.06569 (2025).
• Hellert, T., Bertwistle, D., Leemann, S. C., Sulc, A. & Venturini, M. Agentic artificial intelligence for multistage physics experiments at a large-scale user facility particle accelerator. Phys. Rev. Res. 8, L012017 (2026).Article Google Scholar
Hellert, T., Bertwistle, D., Leemann, S. C., Sulc, A. & Venturini, M. Agentic artificial intelligence for multistage physics experiments at a large-scale user facility particle accelerator. Phys. Rev. Res. 8, L012017 (2026).
• Vriza, A., Prince, M. H., Zhou, T., Chan, H. & Cherukara, M. J. Operating advanced scientific instruments with AI agents that learn on the job. npj Comput. Mater. 12, 160 (2026).Article Google Scholar
Vriza, A., Prince, M. H., Zhou, T., Chan, H. & Cherukara, M. J. Operating advanced scientific instruments with AI agents that learn on the job. npj Comput. Mater. 12, 160 (2026).
• Kotani, A. & Shin, S. Resonant inelastic X-ray scattering spectra for electrons in solids. Rev. Mod. Phys. 73, 203 (2001).Article Google Scholar
Kotani, A. & Shin, S. Resonant inelastic X-ray scattering spectra for electrons in solids. Rev. Mod. Phys. 73, 203 (2001).
• Ihee, H., Wulff, M., Kim, J. & Adachi, S. I. Ultrafast X-ray scattering: structural dynamics from diatomic to protein molecules. Int. Rev. Phys. Chem. 29, 453–520 (2010).Article Google Scholar
Ihee, H., Wulff, M., Kim, J. & Adachi, S. I. Ultrafast X-ray scattering: structural dynamics from diatomic to protein molecules. Int. Rev. Phys. Chem. 29, 453–520 (2010).
• Bostedt, C. et al. Linac coherent light source: the first five years. Rev. Mod. Phys. 88, 015007 (2016).Article Google Scholar
Bostedt, C. et al. Linac coherent light source: the first five years. Rev. Mod. Phys. 88, 015007 (2016).
• Meisburger, S. P., Thomas, W. C., Watkins, M. B. & Ando, N. X-ray scattering studies of protein structural dynamics. Chem. Rev. 117, 7615–7672 (2017).Article Google Scholar
Meisburger, S. P., Thomas, W. C., Watkins, M. B. & Ando, N. X-ray scattering studies of protein structural dynamics. Chem. Rev. 117, 7615–7672 (2017).
• Mühlbauer, S. et al. Magnetic small-angle neutron scattering. Rev. Mod. Phys. 91, 015004 (2019).Article MathSciNet Google Scholar
Mühlbauer, S. et al. Magnetic small-angle neutron scattering. Rev. Mod. Phys. 91, 015004 (2019).
Article MathSciNet Google Scholar
• Zhang, J. N. Trace doping of multiple elements enables stable battery cycling of LiCoO2 at 4.6 V. Nat. Energy 4, 594–603 (2019).Article Google Scholar
Zhang, J. N. Trace doping of multiple elements enables stable battery cycling of LiCoO2 at 4.6 V. Nat. Energy 4, 594–603 (2019).
• Cao, C. Emerging X-ray imaging technologies for energy materials. Mater. Today 34, 132–147 (2020).Article Google Scholar
Cao, C. Emerging X-ray imaging technologies for energy materials. Mater. Today 34, 132–147 (2020).
• Allen, A. J. Selected advances in small-angle scattering and applications they serve in manufacturing, energy and climate change. J. Appl. Cryst. 56, 787–800 (2023).Article Google Scholar
Allen, A. J. Selected advances in small-angle scattering and applications they serve in manufacturing, energy and climate change. J. Appl. Cryst. 56, 787–800 (2023).
• Hamdalla, T. A. Synchrotron-based operando X-ray diffraction and X-ray absorption spectroscopy study of LiCo0.5Fe0.5PO4 mixed d-metal olivine cathode. Sci. Rep. 13, 2169 (2023).Article Google Scholar
Hamdalla, T. A. Synchrotron-based operando X-ray diffraction and X-ray absorption spectroscopy study of LiCo0.5Fe0.5PO4 mixed d-metal olivine cathode. Sci. Rep. 13, 2169 (2023).
• Lee, Y., Oang, K. Y., Kim, D. & Ihee, H. A comparative review of time-resolved X-ray and electron scattering to probe structural dynamics. Struct. Dyn. 11, 031301 (2024).Article Google Scholar
Lee, Y., Oang, K. Y., Kim, D. & Ihee, H. A comparative review of time-resolved X-ray and electron scattering to probe structural dynamics. Struct. Dyn. 11, 031301 (2024).
• Sun, T. et al. Pinpointing chemomechanical origins of Na cathode degradation. J. Am. Chem. Soc. 147, 21375–21384 (2025).Article Google Scholar
Sun, T. et al. Pinpointing chemomechanical origins of Na cathode degradation. J. Am. Chem. Soc. 147, 21375–21384 (2025).
• Galayda, J. N. et al. The LCLS-II: a high power upgrade to the LCLS. In 9th International Particle Accelerator Conference (eds Koscielniak, S. et al.) 18–23 (JACoW, 2018); https://doi.org/10.18429/JACoW-IPAC2018-MOYGB2
Galayda, J. N. et al. The LCLS-II: a high power upgrade to the LCLS. In 9th International Particle Accelerator Conference (eds Koscielniak, S. et al.) 18–23 (JACoW, 2018); https://doi.org/10.18429/JACoW-IPAC2018-MOYGB2
• Zhang, H. The linac coherent light source ii photoinjector laser infrastructure. High Power Laser Sci. Eng 12, e51 (2024).Article Google Scholar
Zhang, H. The linac coherent light source ii photoinjector laser infrastructure. High Power Laser Sci. Eng 12, e51 (2024).
• Kerby, J. The advanced photon source upgrade: a brighter future for X-ray science. Synchrotron Radiat. News 36, 26–27 (2023).Article Google Scholar
Kerby, J. The advanced photon source upgrade: a brighter future for X-ray science. Synchrotron Radiat. News 36, 26–27 (2023).
• Harrington, G. F. & Santiso, J. Back-to-basics tutorial: X-ray diffraction of thin films. J. Electroceram. 47, 141–163 (2021).Article Google Scholar
Harrington, G. F. & Santiso, J. Back-to-basics tutorial: X-ray diffraction of thin films. J. Electroceram. 47, 141–163 (2021).
• You, H. Angle calculations for a ‘4S + 2D’ six-circle diffractometer. Appl. Crystallogr. 32, 614–623 (1999).Article Google Scholar
You, H. Angle calculations for a ‘4S + 2D’ six-circle diffractometer. Appl. Crystallogr. 32, 614–623 (1999).
• Certified scientific software SPEC—X-ray diffraction software. Certified Scientific Software https://www.certif.com/content/spec/ (2017).
Certified scientific software SPEC—X-ray diffraction software. Certified Scientific Software https://www.certif.com/content/spec/ (2017).
• Brown, T. et al. Language models are few-shot learners. Adv. Neural Inf. Process. Syst. 33, 1877–1901 (2020). Google Scholar
Brown, T. et al. Language models are few-shot learners. Adv. Neural Inf. Process. Syst. 33, 1877–1901 (2020).
• Dong, Q. et al. A survey on in-context learning. In Proc. 2024 Conference on Empirical Methods in Natural Language Processing (eds Al-Onaizan, Y. et al.) 1107–1128 (Association for Computational Linguistics, 2024); https://doi.org/10.18653/v1/2024.emnlp-main.64
Dong, Q. et al. A survey on in-context learning. In Proc. 2024 Conference on Empirical Methods in Natural Language Processing (eds Al-Onaizan, Y. et al.) 1107–1128 (Association for Computational Linguistics, 2024); https://doi.org/10.18653/v1/2024.emnlp-main.64
• Weihrich, R., Anusca, I. & Zabel, M. Half-antiperovskites: structure and type-antitype relations of shandites M3/2AS (M: Co, Ni; A: In, Sn). Zeitschrift Fur Anorganische Und Allgemeine Chemie 631, 1463–1470 (2005).Article Google Scholar
Weihrich, R., Anusca, I. & Zabel, M. Half-antiperovskites: structure and type-antitype relations of shandites M3/2AS (M: Co, Ni; A: In, Sn). Zeitschrift Fur Anorganische Und Allgemeine Chemie 631, 1463–1470 (2005).
• Kanagaraj, M., Ning, J. & He, L. Topological Co3Sn2S2 magnetic weyl semimetal: from fundamental understanding to diverse fields of study. Rev. Phys. 8, 100072 (2022).Article Google Scholar
Kanagaraj, M., Ning, J. & He, L. Topological Co3Sn2S2 magnetic weyl semimetal: from fundamental understanding to diverse fields of study. Rev. Phys. 8, 100072 (2022).
• Horton, M. K. et al. Accelerated data-driven materials science with the Materials Project. Nat. Mater. 24, 1522–1532 (2025).Article Google Scholar
Horton, M. K. et al. Accelerated data-driven materials science with the Materials Project. Nat. Mater. 24, 1522–1532 (2025).
• Jain, A. et al. Commentary: The Materials Project: a materials genome approach to accelerating materials innovation. APL Mater. 1, 011002 (2013).Article Google Scholar
Jain, A. et al. Commentary: The Materials Project: a materials genome approach to accelerating materials innovation. APL Mater. 1, 011002 (2013).
• Introducing Claude 4. Anthropic https://www.anthropic.com/news/claude-4 (2025).
Introducing Claude 4. Anthropic https://www.anthropic.com/news/claude-4 (2025).
• Comanici, G. et al. Gemini 2.5: pushing the frontier with advanced reasoning, multimodality, long context, and next generation agentic capabilities. Preprint at https://arxiv.org/abs/2507.06261 (2025).
Comanici, G. et al. Gemini 2.5: pushing the frontier with advanced reasoning, multimodality, long context, and next generation agentic capabilities. Preprint at https://arxiv.org/abs/2507.06261 (2025).
• Vaqueiro, P. & Sobany, G. G. A powder neutron diffraction study of the metallic ferromagnet Co3Sn2S2. Solid State Sci. 11, 513–518 (2009).Article Google Scholar
Vaqueiro, P. & Sobany, G. G. A powder neutron diffraction study of the metallic ferromagnet Co3Sn2S2. Solid State Sci. 11, 513–518 (2009).
• Gražulis, S. Crystallography open database (COD): an open-access collection of crystal structures and platform for world-wide collaboration. Nucleic Acids Res. 40, D420–D427 (2012).Article Google Scholar
Gražulis, S. Crystallography open database (COD): an open-access collection of crystal structures and platform for world-wide collaboration. Nucleic Acids Res. 40, D420–D427 (2012).
• Lewis, P. et al. Retrieval-augmented generation for knowledge-intensive NLP tasks. Adv. Neural Inf. Process. Syst. 33, 9459–9474 (2020). Google Scholar
Lewis, P. et al. Retrieval-augmented generation for knowledge-intensive NLP tasks. Adv. Neural Inf. Process. Syst. 33, 9459–9474 (2020).
• Luo, H. et al. Beyond context limits: subconscious threads for long-horizon reasoning. Preprint at https://arxiv.org/abs/2507.16784 (2025).
Luo, H. et al. Beyond context limits: subconscious threads for long-horizon reasoning. Preprint at https://arxiv.org/abs/2507.16784 (2025).
• Granade, C. E., Ferrie, C., Wiebe, N. & Cory, D. G. Robust online Hamiltonian learning. New J. Phys. 14, 103013 (2012).Article MathSciNet Google Scholar
Granade, C. E., Ferrie, C., Wiebe, N. & Cory, D. G. Robust online Hamiltonian learning. New J. Phys. 14, 103013 (2012).
Article MathSciNet Google Scholar
• Huan, X. & Marzouk, Y. M. Simulation-based optimal Bayesian experimental design for nonlinear systems. J. Comput. Phys. 232, 288–317 (2013).Article MathSciNet Google Scholar
Huan, X. & Marzouk, Y. M. Simulation-based optimal Bayesian experimental design for nonlinear systems. J. Comput. Phys. 232, 288–317 (2013).
Article MathSciNet Google Scholar
• McMichael, R. D. & Blakley, S. M. Simplified algorithms for adaptive experiment design in parameter estimation. Phys. Rev. Appl. 18, 054001 (2022).Article Google Scholar
McMichael, R. D. & Blakley, S. M. Simplified algorithms for adaptive experiment design in parameter estimation. Phys. Rev. Appl. 18, 054001 (2022).
• Ong, S. P. Python materials genomics (pymatgen): a robust, open-source Python library for materials analysis. Comput. Mater. Sci. 68, 314–319 (2013).Article Google Scholar
Ong, S. P. Python materials genomics (pymatgen): a robust, open-source Python library for materials analysis. Comput. Mater. Sci. 68, 314–319 (2013).
• De Graef, M. & McHenry, M. E. Structure of Materials: An Introduction to Crystallography, Diffraction and Symmetry (Cambridge Univ. Press, 2012); https://doi.org/10.1017/CBO9781139051637
De Graef, M. & McHenry, M. E. Structure of Materials: An Introduction to Crystallography, Diffraction and Symmetry (Cambridge Univ. Press, 2012); https://doi.org/10.1017/CBO9781139051637
• Introducing the Model Context Protocol. Anthropic https://www.anthropic.com/news/model-context-protocol (2024).
Introducing the Model Context Protocol. Anthropic https://www.anthropic.com/news/model-context-protocol (2024).
• Avila, D. et al. LibreChat. GitHub https://github.com/danny-avila/LibreChat (2025).
Avila, D. et al. LibreChat. GitHub https://github.com/danny-avila/LibreChat (2025).
• Chen, Z. et al. Data for an agentic artificially intelligent X-ray scientist. Zenodo https://doi.org/10.5281/zenodo.20017861 (2026).
Chen, Z. et al. Data for an agentic artificially intelligent X-ray scientist. Zenodo https://doi.org/10.5281/zenodo.20017861 (2026).
• Chen, Z. et al. Code for an agentic artificially intelligent X-ray scientist. Zenodo https://doi.org/10.5281/zenodo.20017991 (2026).
Chen, Z. et al. Code for an agentic artificially intelligent X-ray scientist. Zenodo https://doi.org/10.5281/zenodo.20017991 (2026).
Acknowledgements
We are grateful to the Stanford Synchrotron Radiation Lightsource, SLAC National Accelerator Laboratory and, in particular, to P. Pianetta and P. McIntyre for their strong support in granting the rapid-access beamtime for this project, without which this work would not have been possible. This work was primarily supported by the US Department of Energy, Office of Science, Basic Energy Sciences under award no. DE-SC0022216. Use of the Stanford Synchrotron Radiation Lightsource, SLAC National Accelerator Laboratory, is supported by the US Department of Energy, Office of Science, Office of Basic Energy Sciences under contract no. DE-AC02-76SF00515. Part of this work was supported by the Linac Coherent Light Source, SLAC National Accelerator Laboratory, under contract no. DE-AC02-76SF00515. Additional support was provided by the US Department of Energy, Office of Science, Office of Basic Energy Sciences under award no. FWP-101101 for the project ‘ILLUMINE—Intelligent Learning for Lightsource and Neutron Source User Measurements Including Navigation and Experiment Steering’ and by the Department of Energy, Laboratory Directed Research and Development programme at SLAC National Accelerator Laboratory, under contract no. DE-AC02-76SF00515. Part of this work was supported by the US Department of Energy, Office of Science, Basic Energy Sciences under the BES AI Pathfinder project MAIQMag: Multimodal AI for two-dimensional Quantum Magnets. C.P. was supported by the US Department of Energy, Office of Basic Energy Sciences, Division of Materials Sciences and Engineering. The work at Northeastern University benefited from the resources of Northeastern University’s Advanced Scientific Computation Center, the Discovery Cluster, the Massachusetts Technology Collaborative award no. MTC-22032, and the National Energy Research Scientific Computing Center through DOE grant no. DE-AC02-05CH11231. During the preparation of this work, we used the LLM ChatGPT by OpenAI to refine the language and enhance the readability of this study. After using this tool, we reviewed and edited the content as needed and take full responsibility for the content of the publication.
Author information
Authors and Affiliations
• Stanford Institute for Materials and Energy Sciences, Stanford University, Stanford, CA, USAZhantao Chen, Alexander N. Petsch, Aidan J. Israelski, Rajan Plumley, Cheng Peng, Yuan Ni & Joshua J. Turner
Stanford Institute for Materials and Energy Sciences, Stanford University, Stanford, CA, USA
Zhantao Chen, Alexander N. Petsch, Aidan J. Israelski, Rajan Plumley, Cheng Peng, Yuan Ni & Joshua J. Turner
• Linac Coherent Light Source, SLAC National Accelerator Laboratory, Menlo Park, CA, USAZhantao Chen, Alexander N. Petsch, Aidan J. Israelski, Rajan Plumley, Lingjia Shen, Cong Wang, Yuan Ni, Jana B. Thayer & Joshua J. Turner
Linac Coherent Light Source, SLAC National Accelerator Laboratory, Menlo Park, CA, USA
Zhantao Chen, Alexander N. Petsch, Aidan J. Israelski, Rajan Plumley, Lingjia Shen, Cong Wang, Yuan Ni, Jana B. Thayer & Joshua J. Turner
• Walker Department of Mechanical Engineering, The University of Texas at Austin, Austin, TX, USAZhantao Chen
Walker Department of Mechanical Engineering, The University of Texas at Austin, Austin, TX, USA
• Texas Materials Institute, The University of Texas at Austin, Austin, TX, USAZhantao Chen
Texas Materials Institute, The University of Texas at Austin, Austin, TX, USA
• Department of Physics, Carnegie Mellon University, Pittsburgh, PA, USARajan Plumley
Department of Physics, Carnegie Mellon University, Pittsburgh, PA, USA
• Department of Physics, Northeastern University, Boston, MA, USAArun Bansil
Department of Physics, Northeastern University, Boston, MA, USA
• Quantum Materials and Sensing Institute, Northeastern University, Burlington, MA, USAArun Bansil
Quantum Materials and Sensing Institute, Northeastern University, Burlington, MA, USA
• Department of Physics and Astronomy, Howard University, Washington, DC, USASugata Chowdhury
Department of Physics and Astronomy, Howard University, Washington, DC, USA
• Department of Nuclear Science and Engineering, Massachusetts Institute of Technology, Cambridge, MA, USAMingda Li
Department of Nuclear Science and Engineering, Massachusetts Institute of Technology, Cambridge, MA, USA
• Stanford Synchrotron Radiation Lightsource, SLAC National Accelerator Laboratory, Menlo Park, CA, USAVivek Thampy
Stanford Synchrotron Radiation Lightsource, SLAC National Accelerator Laboratory, Menlo Park, CA, USA
• Zhantao ChenView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Alexander N. PetschView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Aidan J. IsraelskiView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Rajan PlumleyView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Lingjia ShenView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Cong WangView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Cheng PengView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Yuan NiView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Arun BansilView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Sugata ChowdhuryView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Mingda LiView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Jana B. ThayerView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Vivek ThampyView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
• Joshua J. TurnerView author publicationsSearch author on:PubMed Google Scholar
Search author on:PubMed Google Scholar
Contributions
Conceptualization: Z.C., A.N.P., J.B.T. and J.J.T. Methodology: Z.C., A.N.P., C.W. and V.T. Experiments: Z.C., A.N.P., A.J.I., R.P., L.S., C.P., Y.N., V.T. and J.J.T. Experimental resources: M.L., J.B.T., V.T. and J.J.T. Software: Z.C. and A.N.P. Writing: Z.C., A.N.P., A.B. and J.J.T., with input from all authors.
Corresponding authors
Correspondence to Zhantao Chen or Joshua J. Turner.
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature Machine Intelligence thanks Nathan Szymanski, Francesco Ricci and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Extended data
Extended Data Fig. 1 AI reasoning trace for selecting the primary reference reflection.
The AI X-ray Scientist selects the specular (0, 0, 6) reflection with corresponding motor positions in vertical scattering geometry from the crystallographic peak table, and proposes the initial command for locating the primary reference peak.
Extended Data Fig. 2 AI reasoning trace for identifying an unexpected motor offset.
After performing an η scan of the primary (0, 0, 6) reflection, the AI X-ray Scientist identifies a sharp intensity maximum at η = 8.9845°, recognizes an offset of approximately 1.22∘ from the expected motor position, and updates the motor position accordingly.
Extended Data Fig. 3 AI reasoning trace for selecting the secondary reference reflection.
The AI X-ray Scientist evaluates candidate non-specular reflections, selects the (1, 0, 10) peak based on accessibility and relative intensity, calculates the corresponding motor positions in vertical scattering geometry, and incorporates the previously identified η offset before issuing the command to locate the secondary reference reflection.
Supplementary information
Supplementary Information (download PDF )
Supplementary Figs. 1–9 and Notes 1–9.
Reporting Summary (download PDF )
Peer Review File (download PDF )
Supplementary Data 1 (download PDF )
Full AI-agent conversation history corresponding to the Co3Sn2S2 real-beamline experiment.
Supplementary Data 2 (download PDF )
Full AI-agent conversation history corresponding to the single-crystal Si real-beamline experiment.
Source data
Source Data Fig. 2 (download XLSX )
Source data for motor scans and benchmarking plots of the virtual beamline experiments.
Source Data Fig. 3 (download XLSX )
Source data for motor scans for the primary reference reflection of the beamline experiment at SSRL.
Source Data Fig. 4 (download XLSX )
Source data for motor scans for the secondary reference reflection of the beamline experiment at SSRL.
Rights and permissions
About this article
Cite this article
Chen, Z., Petsch, A.N., Israelski, A.J. et al. An agentic artificially intelligent X-ray scientist. Nat Mach Intell 8, 1075–1086 (2026). https://doi.org/10.1038/s42256-026-01261-5
• Received: 25 August 2025
• Accepted: 28 May 2026
• Published: 01 July 2026
• Version of record: 01 July 2026
Version of record: 01 July 2026
• Issue date: July 2026
• DOI: https://doi.org/10.1038/s42256-026-01261-5
DOI: https://doi.org/10.1038/s42256-026-01261-5
Anyone you share the following link with will be able to read this content:
Sorry, a shareable link is not currently available for this article.
Provided by the Springer Nature SharedIt content-sharing initiative