betaFeedback

WorksPhysics and Astronomy

The Agentic AI Kerr Lab: LLM Agents for Kerr Microscopy Experiments with Magnetic Skyrmions

Abstract

Magnetic skyrmions are topological spin textures that can be observed directly by magnetic microscopy and driven by fields and currents, which makes them a model system for fundamental physics and candidates for spintronic devices. Magneto-optical Kerr microscopy is a method to image them in real time; however, most experiments use an inefficient cycle of consecutive imaging, analysis and excitation in which every step requires the judgement of the experimentalist operating the setup. Here we present the Agentic AI Kerr Lab (AgentKerr), in which an agent based on a large language model operates this cycle automatically and efficiently on a Kerr microscope. Rather than relying on pattern detection by a language model, a convolutional neural network trained on Kerr images turns live images into skyrmion observables such as position, size and shape, on which the agent bases its decisions. The architecture lets agents operate the instruments safely, as every hardware action is checked deterministically against an action policy, independently of the agent that issues it. With no procedure given, the agent determines by itself how to create, tune and move skyrmions, and writes its own analyses. The approach can be transferred to other spin textures and points towards magnetic imaging experiments in which the researcher poses the question and the agent finds the way to realize the experiments that yield the answer.

Dipolar magnetic skyrmions are micron-sized, topologically stabilised, particle-like spin textures studied both for fundamental physics and for spintronic applications such as memory, sensing and unconventional computing [1, 2, 3, 4, 5, 6]. Magneto-optical Kerr microscopy, a table-top laboratory technique, images them directly and in real time [3, 4]. Experiments run in a cycle of imaging, analysis and excitation. Convolutional neural networks have automated the detection of skyrmions [7], but advanced experimental questions require elaborate analyses and a decision at every step, making the experimentalist operating the equipment often the bottleneck. Agents based on large language models (LLMs) combine reasoning with the use of external tools [8] and have begun to plan and execute laboratory work, from chemistry and self-driving laboratories [9, 10, 11] to instruments such as scanning probe, X-ray, electron, optical and quantum-sensing microscopes [12, 13, 14, 15, 16, 17, 18], in several cases with image or measurement feedback. Connecting agents to specialised hardware, however, raises the question of how their actions are structured and controlled, and workflow and verification layers outside the language model have been proposed [11, 18, 19, 20]. This work introduces the Agentic AI Kerr Lab (AgentKerr), in which an LLM agent closes this operating cycle on a magneto-optical Kerr microscope, as shown in Figure 1 and Figure 2: a convolutional neural network turns live images into quantitative skyrmion observables from which the agent chooses the next operation, a trust boundary keeps the safety of the hardware independent of the agent, and even instruments without a programming interface become accessible to agents and their workflows.

Figure 1. Architecture of the Agentic AI Kerr Lab. The researcher states a goal, and LLM agents plan the experiment through the MCP orchestrator, with human interaction in the live monitor. On the workflow level, the U-Net segments the Kerr images and code execution runs analyses and complex experimental workflows. Below the trust boundary, the security layer checks all actions before virtual instruments apply them to the setup.

Figure 2. The agentic loop and an example run. a) The researcher asks a question; the agent runs the experiment and analyses it until the question is answered. b) As an example, one run from stripes to round skyrmions: measured mean axis ratio after each decision step, i.e. each pass through the loop. The agent chose the length of the in-plane pulses within safety limits; at step 7 a pulse annihilated the skyrmions, and the agent renucleated the state with skyrmions.

Quantitative perception of Kerr micrographs

The experiments use a commercial Kerr microscope (evico magnetics) that records images at video rate, with out-of-plane and in-plane magnetic fields and electrical currents applied to the sample. Kerr images of skyrmions change from measurement to measurement in shape, motion blur, contrast, intensity gradients, defects and noise, so conventional image processing has to be redesigned by hand for each measurement and does not reliably separate skyrmions from defects. Instead, a convolutional U-Net [21] segments the live images pixel-wise into skyrmions, defects and background, where the background comprises magnetic and non-magnetic regions and their boundaries [7, 22]; the model is trained on diverse skyrmions and defects on the micrometre length scale; where needed, the agent can adapt the pre- and post-processing. Running in PyTorch, with optimised post-processing that filters objects by size and shape, the segmentation reaches about 30 frames per second at 672 × 512 pixels on a GPU (NVIDIA GeForce RTX 2070) with about 0.5 GB of GPU memory, enabling real-time analysis. The agent therefore works with quantitative observables rather than raw pixels, which vision-language models still do not always analyse reliably [15].

An agentic magnetic microscope

Building on the U-Net, AgentKerr operates the full cycle, as shown in Figure 1: LLM agents, run in clients such as Codex or Claude Desktop, plan each experiment from the researcher’s goal and reach AgentKerr through an orchestrator based on the Model Context Protocol (MCP) [23], which routes all calls and provides a live monitor for user input. Since language-model outputs are inherently uncertain, the safety of the system does not depend on the agent: a trust boundary separates the agent space from the instrument space, where an action policy bounds experimental settings such as values, step sizes, waiting times and pulse durations by a fixed configuration, and, in the other direction, an access policy grants access to the measuring instruments only to specified entities. AgentKerr currently controls the microscope through the graphical user interface of its software: a researcher’s mouse and keyboard input is recorded once, then modified and replayed as requested by the agent, verified by OCR and visual analysis; laboratories can thus connect agents to existing instruments without an API, while instruments with an API connect directly to AgentKerr.

Behind this security layer, virtual instruments receive the control actions and apply them to the real experiment; they are digital twins of the devices and include an emulator for testing. The video camera then records new images, and the U-Net returns the geometric shape and position of every skyrmion. These are passed to the agent directly or through the code execution tool, in which the agent writes its own analyses, such as ensemble statistics or tracking, including plots, before planning the next steps. Code execution and the U-Net form the workflow level above the trust boundary, so that all their hardware access also passes the security layer: the agent can plan complex workflows that are then executed deterministically in a sandbox with restricted external access.

Agent-driven skyrmion experiments

With this architecture, the agent operates in the closed loop of Figure 2a. We ran agentic experiments with GPT-6 Astra, GPT-6 Luna and GPT-5.6 Luna as the underlying large language models; Figure 2b shows one representative run, in which the agent transforms a stripe-domain state into round skyrmions. Recordings of this run and of further experiments are available as a video on Zenodo [24]: the nucleation of single skyrmions, the adjustment of the skyrmion radius to a target value, current-driven control, and analyses that the agent wrote on request, including advanced plots. No procedure was given for the run of Figure 2b, the radius adjustment or current-driven control; for single-skyrmion nucleation, the researcher outlined a strategy. As the state of a spin texture depends on the path of excitation, not only on the final values, the agent chose every step from the observed state and, for example at step 7 in Figure 2b, corrected its course after a failed step.

Towards robust, unattended experiments

At the moment, it is clear that this is not a finished project but AgentKerr is work in progress. Procedures the agent derived in these experiments are being captured as skills [25], human-readable instruction files loaded when a task requires them, so that the agent can carry out complex multi-step workflows such as field sweeps or nucleation protocols directly, without deriving them anew, and unattended. A further step is to connect the instrument through an API, which makes agent-based operation more direct than GUI automation. Future research directions include transferring the approach to other spin textures and magnetic imaging techniques and coupling it to micromagnetic simulations [26] for insight into the underlying physics. Ultimately, experiments would require the researcher only to pose the question and to critically assess the result.

Acknowledgments

We acknowledge funding from ERC Synergy 3D-MAGiC (856538); Horizon Europe NIMFEIA (101070290) and MSCA TOPOCOM (101119608); DFG SPP 2137 Skyrmionics (403502522) and TRR 173 (268565370; A01, A12, B02); TopDyn, State of Rhineland-Palatinate; National Research Council of Science & Technology (NST), Korean government MSIT (GTL24041-000).

References

  1. [1]A. Fert, N. Reyren, and V. Cros, Magnetic skyrmions: advances in physics and potential applications, Nat. Rev. Mater. 2, 17031 (2017).DOI
  2. [2]M. Bhukta, T. Dohi, K. Leutner, M.-A. Syskaki, F. Kammerbauer, D. M. Tran, S. Wintz, M. Weigand, S. Finizio, J. Raabe, H. Ohldag, T. Denneulin, J. V. Vas, R. E. Dunin-Borkowski, R. Frömter, and M. Kläui, Time-resolved imaging of antiferromagnetic skyrmion interactions, Nat. Phys. 22, 1615 (2026).DOI
  3. [3]J. Zázvorka, F. Jakobs, D. Heinzе, N. Keil, S. Kromin, S. Jaiswal, K. Litzius, G. Jakob, P. Virnau, D. Pinna, K. Everschor-Sitte, L. Rózsa, A. Donges, U. Nowak, and M. Kläui, Thermal skyrmion diffusion used in a reshuffler device, Nat. Nanotech. 14, 658 (2019).
  4. [4]K. Raab, M. A. Brems, G. Beneke, T. Dohi, J. Rothörl, F. Kammerbauer, J. H. Mentink, and M. Kläui, Brownian reservoir computing realized using geometrically confined skyrmion dynamics, Nat. Commun. 13, 6982 (2022).
  5. [5]G. Beneke, T. B. Winkler, K. Raab, M. A. Brems, F. Kammerbauer, P. Gerhards, K. Knobloch, S. Krishnia, J. H. Mentink, and M. Kläui, Gesture recognition with Brownian reservoir computing using geometrically confined skyrmion dynamics, Nat. Commun. 15, 8103 (2024).
  6. [6]K. Leutner, T. B. Winkler, R. Gruber, R. Frömter, J. Göttinger, H. Fanghorh, and M. Kläui, Skyrmion automation and readout in confined counter-sensor device geometries, Phys. Rev. Appl. 20, 064021 (2023).DOI
  7. [7]I. Labrie-Boulay, T. B. Winkler, D. Franzen, A. Romanova, H. Fanghorh, and M. Kläui, Machine-learning-based detection of spin structures, Phys. Rev. Appl. 21, 014014 (2024).
  8. [8]S. Yao, J. Zhao, D. Yu, N. Du, J. Shafran, K. R. Narasimhan, and Y. Cao, ReAct: Synergizing reasoning and acting in language models, in The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023 (OpenReview.net, 2023).arxiv.org/abs/2210.03629
  9. [9]D. A. Boiko, R. MacKnight, B. Kline, and G. Gomes, Autonomous chemical research with large language models, Nature 624, 570 (2023).DOI
  10. [10]A. M. Bran, S. Cox, O. Schilter, C. Baldassari, A. D. White, and P. Schwaller, Augmenting large language models with chemistry tools, Nat. Mach. Intell. 6, 525 (2024).DOI
  11. [11]M. Müller, J. Bai, W. Gottstein, A. Mandal, M. Naze­ri, E. Savino, Y. Fang, S. Das, S. P. García Carrillo, Y. Kang, J. B. Pérez-Sánchez, S. Pilon, M. Fitzner, T. Noël, F. Gu, V. Bernales, and A. Aspuru-Guzik, La Agente Óptima: Towards agentic self-driving laboratories (2026), arXiv:2609.04564 [cs.AI].arxiv.org/abs/2609.04564
  12. [12]I. Mandal, J. Soni, M. Zaki, M. M. Smedskjaer, K. Wondraczek, L. Wondraczek, N. N. Gosvami, and N. M. A. Krishnan, Evaluating large language model agents for automation of atomic force microscopy, Nat. Commun. 16, 9104 (2025).DOI
  13. [13]B. N. Slautin, S. L. Sanchez, A. Swanger, Y. Liu, G. Duscher, V. V. Shvartsman, M. Ahmadi, and S. Valinin, Hierarchical automation of scanning probe microscopy through agentic orchestration and algorithmic control (2026), arXiv:2609.04015 [cond-mat.mtrl-sci].arxiv.org/abs/2609.04015
  14. [14]Z. Chen, A. N. Petsch, A. J. Israelski, R. Plumley, L. Shen, C. Wang, C. Peng, Y. Ni, A. Bansil, S. Chowdhury, M. Li, J. B. Thayer, V. Thampy, and J. J. Turner, An agentic artificially intelligent X-ray scientist, Nat. Mach. Intell. 8, 1075 (2026).DOI
  15. [15]M. Du, Y. Luo, S. Banerjee, M. Wojcik, J. Popovic, and M. J. Cherukara, Experiment automation agents: automating materials characterization with vision language model agents, npj Comput. Mater. 10.1038/s41524-026-02213-8 (2026).DOI
  16. [16]M. K. Wall, A. J. Pattison, E. S. Barnard, S. M. Ribet, and P. Ercius, TEM Agent: enhancing transmission electron microscopy with modern AI tools, npj Comput. Mater. 12, 316 (2026).DOI
  17. [17]J. Yang, R. A. Yin, C. Jiang, Y. Hu, X. Zhu, X. Hu, S. Kumar, S. K. Holmes, X. Wang, X. Zhai, K. Rong, Y. Zhu, T. Zhang, Z. Yin, Y. Cao, H. Tang, A. D. Franklin, J. Kong, N. Z. Gong, Z. Ren, and H. Wang, Zero-shot autonomous microscopy for scalable and intelligent characterization of 2D materials, ACS Nano 19, 35493 (2025).arxiv.org/abs/2504.10281
  18. [18]T. Isogawa, R. Okabe, N. Phadetsuwannukun, M. Li, and P. Cappellaro, Agentic AI for scientific reasoning in autonomous quantum sensing experiments (2026), arXiv:2607.25145 [quant-ph].arxiv.org/abs/2607.25145
  19. [19]V. Jamali, A. Aghazadeh, and J. Kacher, Thinking microscopes: agentic AI and the future of electron microscopy, npj Comput. Mater. 12, 149 (2026).DOI
  20. [20]Y. Kang, S. X. Leong, H. S. Park, J. Bai, S. Papidocha, Y. Zhao, R. Zhang, M. Gimeno, S. Lo, E. S. Isbrandt, H. Hao, Y. Cao, F. Katzenburg, F. Du, A. Aspuru-Guzik, and V. Bernales, El Agente Seguro: An agent for chemical safety, ChemRxiv preprint, version 2, doi:10.26434/chemrxiv-15004378/v2 (2026).DOI
  21. [21]O. Ronneberger, P. Fischer, and T. Brox, U-Net: Convolutional networks for biomedical image segmentation, in Medical Image Computing and Computer-Assisted Intervention – MICCAI 2015, Lecture Notes in Computer Science, Vol. 9351, edited by N. Navab, J. Hornegger, W. M. Wells, and A. F. Frangi (Springer International Publishing, Cham, 2015) pp. 234–241.arxiv.org/abs/1505.04597
  22. [22]K. Leutner, Simulation and Detection of Topological Spin Structures, Master’s thesis, Johannes Gutenberg University Mainz (2023).
  23. [23]Anthropic, Introducing the Model Context Protocol, https://www.anthropic.com/news/model-context-protocol (2024), specification: https://modelcontextprotocol.io/specification, accessed 11 October 2026.
  24. [24]K. Leutner, Y. Zhou, A. Kumar, T. B. Winkler, R. Frömter, H. Fanghor, and M. Kläui, The Agentic AI Kerr Lab: LLM agents for Kerr microscopy experiments with magnetic skyrmions (supplementary video), Zenodo (2026), doi:10.5281/zenodo.2376472.DOI
  25. [25]Agent Skills, Agent Skills: an open format for giving agents new capabilities – Specification, https://agentskills.io/specification, open standard, originally developed by Anthropic; accessed 11 October 2026.
  26. [26]C. Abert, F. Bruckner, A. Voronov, M. Lang, S. A. Pathak, S. Holt, R. Kraft, R. Allayarov, P. Flauger, S. Koraltan, T. Schref, A. Chumak, H. Fanghor, and D. Suess, NeuralMag: an open-source nodal finite-difference code for inverse micromagnetics, npj Comput. Mater. 11, 193 (2025).DOI

Paper details

vlnc:W_2mgstd2j
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 1

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents