Physics-aware multimodal large language models (MLLMs) can localize and characterize two-dimensional (2D) material flakes from optical microscopy images, producing rich candidate observations and scientific reasoning. However, downstream workflows also require reliable operations over these outputs, including counting, selection, measurement, and rendering.
We present OpenQlaw, a tool-using agentic artificial intelligence (AI) system that connects a general vision-language orchestrator with Physics-Aware Instruction Tuning (QuPAINT), a physics-aware domain expert. Through evaluation on fully reviewed optical microscopy images, we show that summary counts derived from longer free-form candidate enumerations can become inconsistent with the underlying returned observations. Controlled replay experiments further show that structuring the same observations alone does not resolve this behavior, while deterministic delegation returns the exact requested record count in all cohort trials.
To address this, we introduce State-Grounded OpenQlaw, which converts expert outputs into image-scoped observation records and performs deterministic scientific operations over explicitly identified records with refusal conditions when required information is unavailable. This preserves the expert's original analysis while making downstream operations exact over the selected record and independently evaluable from candidate-list discrepancies.
A general-purpose vision-language orchestrator interprets the researcher's request, delegates material characterization to the domain expert, and routes operations over previously returned observations to deterministic tools. Sessions run over WhatsApp and Discord.
QuPAINT is kept fixed as a pinned checkpoint. It returns localized candidate flakes as whole-image percentage boxes [x, y, w, h] together with physics-aware reasoning, and its original analysis is preserved without modification.
Each expert response becomes an AnalysisRecord bound to the source image and reply by SHA-256 hash, with a proposals scope of all valid boxes and a conclusion scope of boxes inside a well-formed final block.
Count, Select, Rank, Measure, and Render execute over an identified record, with explicit refusals for ungranted identities, unavailable layer labels, missing calibration, or identities from a different image.
We evaluate QuPAINT as a fixed expert on a cohort of 228 fully reviewed optical microscopy images (160 WSe2, 68 WS2), drawn from a laboratory database of 7,251 fully reviewed images and stratified by reviewed flake count. Candidate-list size tracks the reviewed image-level flake count closely, yet the count stated in the free-form response frequently disagrees with the enumeration in that same response. Putting a general-purpose orchestrator in front of the expert does not fix this, because the orchestrator must still count in context.
ρ = 0.91
Correlation between candidate-list size and the reviewed image-level flake count
13%
Of expert responses whose stated summary count agrees with its own enumeration
6 / 60
In-Context OpenQlaw pilot trials matching the expert enumeration (2/60 match the conclusion count)
On the 20-image pilot, the median absolute difference from the expert enumeration is 6 observations and 43% of returned counts are multiples of five — the orchestrator estimates rather than enumerates. In one trial QuPAINT returns 97 candidate observations and the orchestrator reports 100.
A matched replay isolates representation from delegation over identical archived QuPAINT observations. The orchestrator receives either the raw expert response, the same validated observations as a structured record, or the structured record plus access to the deterministic count operation. Record identifiers are opaque and record size is withheld, so the target count is never exposed directly. Each condition comprises 684 trials from 228 images across three repeated runs.
| Matched replay condition | Exact record count | 16–20 observations | 51–80 observations |
|---|---|---|---|
| Raw replay (free-form expert text) | 40% | 31% | 4% |
| Structured replay (validated record, counted in context) | 42% | 15% | 0% |
| State-Grounded OpenQlaw (deterministic delegation) | 684 / 684 | 100% | 100% |
The paired improvement of deterministic delegation over structured replay is +0.58 with a 95% bootstrap interval of [0.52, 0.64] over 10,000 seeded samples. Structured representation improves over raw replay by only +0.02, interval [−0.03, 0.08]. In-context counting degrades sharply beyond roughly 15 observations and longer records increasingly yield estimates: for 31–50 observations the median returned-to-record ratio is 1.04 (raw) and 0.92 (structured), falling to 0.95 and 0.85 at 51–80 observations. State-Grounded OpenQlaw remains exact across every record-size group and for both WSe2 and WS2.
OpenQlaw is built on NanoBot, a lightweight open-source agent framework inspired by OpenClaw. The orchestrator is Qwen3-VL-32B-Instruct at a fixed model revision, served with vLLM in bfloat16 with a 32K context window; QuPAINT is served independently through FastAPI and exposed over the Model Context Protocol (MCP), on a separate GPU. QuPAINT is registered as get_flake_data, draw_specific_flakes renders selected observations, and openqlaw_scientific_record provides deterministic access to the image-scoped records. Campaigns use frozen prompts and SHA-256 image manifests with write-once traces; no semantic retries are performed.
QuPAINT localizes candidate flakes with physics-aware reasoning, but the direct response is a long free-form enumeration of coordinates from which exact quantities must still be inferred.
OpenQlaw answers from the image-scoped record: counting and ranking run as deterministic operations, bounding-box area is converted to µm2 using the calibration bound to that image, and a box is drawn only for the object identifier the user explicitly asks to see.
The deployed system runs over WhatsApp and Discord, retaining the active image, the returned observations, and experimental metadata across turns. Once the researcher supplies a physical scale, the calibration stays bound to that image and is reused to convert bounding-box extents into micrometer measurements. Reported measurements refer to bounding-box area rather than segmented flake area, and the tool refuses when calibration for the requested image is unavailable.
This work is partly supported by MonArk NSF Quantum Foundry (DMR-1906383) and NSF Quantum Award (2444042). It acknowledges the Arkansas High-Performance Computing Center for providing GPUs.