Taewoo Park

Research

MagLab

The harness I put around my own working day in magnetism and spintronics: literature, physics, simulation, fitting, figures, instruments, authoring and provenance in one CLI — the model orchestrating, deterministic tools computing.

The whole working day, not one bottleneck in it

spinloop removes the simulation bottleneck. MagLab is what I built around everything else I do between one simulation and the next: auditing literature, translating material stacks into parameters, checking units and ranges, moving between simulation scales, fitting spintronic effects, generating reproducible figures, drafting instrument scripts, keeping a notebook, reviewing manuscripts, and turning verified results into papers, posters and grant text.

My own work stopped being limited only by ideas some time ago. It is limited by coordination overhead — too many papers to audit, too many file formats, too many unit conventions, and too much undocumented context living in notebooks, scripts and my own head. Which is why I do not think a useful scientific AI system can be a chatbot. It needs a controlled environment where a model requests deterministic tools, receives structured results, and exposes enough of the process to be inspected.

The LLM plans, routes, explains and drafts; the modules do the science

Numerical values come from formula modules, data files, fitters, simulations, literature records or explicit user input — never from the model's recollection. I made figures vector artefacts tied to data and provenance rather than raster guesses, and drafts start from verified results and stay marked for human review.

For magnetism and spintronics this matters more than usual, because one project crosses material stacks, magnetic units, transport geometries, micromagnetic assumptions, solver-specific files, fitted effect models and publication figures. The mistakes are easy ones — mixing CGS and SI, reporting a fit parameter outside a physical range, citing a paper that does not support the claim — so I built the harness around those failure modes rather than around a feature list.

Every model tool call passes deny rules, a physics sanity oracle and an autonomy gate, with tools tiered from the read-only, destructive and network hints they declare. I let the default mode run read-only offline tools freely and prompt on a terminal for anything irreversible, because a harness that asks permission for everything is one I would stop using — and where there is no terminal to prompt, the action is refused rather than silently performed.

Schema check, physics oracle, trust gate, honesty gate, then a W3C PROV ledger
Schema check, physics oracle, trust gate, honesty gate, then a W3C PROV ledger

Most of it runs before a model is connected at all

Formula evaluation, unit conversion, the physics oracle, material lookup and stack building all run without LLM credentials. The install audit checks the active folder, the backend, the feature extras, the GPU, SSH and no-GPU simulation paths, the bilingual manuals, figure and export readiness, and the physics and provenance gates.

A model backend gets connected only when orchestration, drafting, review or agent workflows are actually wanted. During model calls the REPL prints a compact activity trace: the stage, the elapsed time, the stop instruction, and the tool and file references visible to the harness. I do not print hidden model reasoning. What I print is what ran, which Python module mediated it, and which workspace files were touched.

The installation audit
The installation audit
Materials and physics, offline
Materials and physics, offline
Persona review and anomaly explanation
Persona review and anomaly explanation

Global config, local artefacts, and a visible workspace context

MagLab keeps its global configuration, data and cache in the user's application directories, but reads and writes project artefacts relative to the folder it was launched in. Opening a research folder produces a project file, a visible brief, and a tree view filterable by type or restricted to what has changed.

The research REPL on first run, with the workspace context it has loaded
The research REPL on first run, with the workspace context it has loaded

Keywords out of a folder, then an evidence matrix rather than a list

Extract keywords from a folder of papers, search the major indexes, build an evidence matrix, and inspect authors, journal metrics, citation graphs and local corpus context. Offline extraction works without any connector; the index paths need the relevant extras and network, and the README says which is which.

scholar-megasearch attacks the same problem from the other direction — breadth across twenty databases in one fan-out. One builds the corpus; this keeps it usable inside a running project.

Keyword extraction over a local paper folder
Keyword extraction over a local paper folder

Mock results are labelled MOCK, never SIMULATED

Generate and validate micromagnetic specs, prepare DFT and atomistic inputs, parse solver outputs, and connect the scales into one pipeline. A simulation doctor chooses among mock, CPU, local GPU, SSH GPU and SSH HPC paths, and it does not open a connection to a host unless explicitly asked to probe one.

The part I care most about is what happens when no solver is installed. The pipeline still runs end to end on the mock backend — but every value is recorded with a provenance type of MOCK and never SIMULATED. A workflow artefact and a physical result are different objects, and I will not let the ledger blur them. OOMMF, MuMax3, VAMPIRE, VASP and Quantum ESPRESSO are the user's to install, and the tool says so.

A multiscale run on the mock backend, with eight provenance DataPoints recorded
A multiscale run on the mock backend, with eight provenance DataPoints recorded

Sixteen spintronic effect models behind one command

AMR, AHE, OHE, PHE, SMR, USMR, ST-FMR, FMR and Kittel, damping, spin pumping and ISHE, DMI, domain-wall, skyrmion and Thiele, hysteresis and Curie temperature models all sit in one registry, loaded from CSV or HDF5, inspected before use, fitted through lmfit, and wired into the notebook and provenance hooks.

Before trusting the output the manual asks for the same four things every time: the required columns, the geometry assumptions, the parameter bounds, and the residuals with their provenance IDs. I never use a model as the judge of physics, fitting, citation or numerical correctness.

Loading a measurement, inspecting a model, running the fit
Loading a measurement, inspecting a model, running the fit

Parameterised SVG objects, not freehand raster pictures

A figure is declared as a specification, rendered as vector output in a journal's style, composed into multi-panel layouts and exported — DataPoint binding, axis labels, units and journal width all checkable before it is trusted.

The schematic primitives are where most of the work went: editable SVG objects with journal-aware style tokens, bounded thin-film stack scaling, role-aware material colours and explicit scene frames for composing device, stack and measurement-geometry panels. One targets a double-column canvas telling a stack, patterned-device and readout story in a single frame.

Rendering and composing a journal-styled figure from a spec
Rendering and composing a journal-styled figure from a spec

The seam where this stack meets real equipment

Scaffold a PyVISA driver, validate an SCPI sequence, ingest a manual for retrieval, generate a skill or script from an experiment description, and run a static safety check before anything is connected. The scaffold reports its line count, and the tool tells you to pass safety validation before running it.

I kept this surface deliberately to a scaffold-and-safety workflow rather than letting it become a claim of instrument autonomy. Taking it further is what instrument-control-skills and OSICBench are for.

Notes, plans, and drafts that never pretend to be finished

Notebook entries can be created and listed by date, sample, tag or type; measurement plans and design-of-experiment suggestions come from the same surface, written into the workspace as files rather than held in a session.

On the authoring side, manuscript sections, cover letters, revision letters, rebuttals, abstracts, grants, emails, slides and posters are drafted from verified results — every one marked as requiring human review, with citation existence, claim support and the absence of unsupported numbers listed as the checks before use.

A notebook entry written into the workspace
A notebook entry written into the workspace
An abstract drafted from verified results
An abstract drafted from verified results

A manifest that compiles into an inspectable execution plan

A manifest defines the agents around the package — a local context librarian, a search scout, a citation auditor, a paper reviewer, a synthesis editor, a physics validator, a result analyst, an experiment manager, a hypothesis generator and a communications writer — and the workflows they compose into, from survey and paper review through citation mapping, physics validation and deep research.

Compiling that manifest writes drift artefacts that are machine-independent by construction: no absolute paths, no install state, no timestamps, so a check fails only when the manifest has changed. A dry run contacts no provider; local execution runs the plan through MagLab's own subagent runner, keeping the verification layers, hooks and budget accounting.

Handing off to an external agent runtime is gated rather than faked: it requires that runtime to expose a workflow tool, and when it cannot run, the command says so and points at local execution. I never let it be simulated — the same rule the MOCK provenance type enforces one layer down.

An interactive agent session with MagLab's skills loaded
An interactive agent session with MagLab's skills loaded
A one-shot query routed through the harness
A one-shot query routed through the harness

A paper trail in the workspace instead of state inside a transcript

Saved harness payloads, reports and results land under a project-local directory alongside budget and provenance databases; notebook entries, rendered figures, run directories, local literature corpora and manuscript, review, slide and poster outputs each get their own visible folder.

Paths are configurable, but the separation is the thing I actually wanted: raw research files stay in the project, generated outputs are visible, provenance is inspectable — instead of state hiding inside a transcript that ends when the session does. The verification layer is not my mission statement; it is the rail that lets the rest of it be used in real scientific work.