Signature piece · photonics-lab-mcp
An AI agent runs a physics experiment
A local language model gets an optics bench through an MCP server, one question, and no procedure. The safety limits live in the server, where it cannot override them.
Scroll to walk the bench · drag to look around
One photon or two?
"The bench excites a photosensitiser with an 800 nm laser and records emission near 1270 nm. Determine experimentally whether this emission is excited by one-photon or two-photon absorption, and state your conclusion with its uncertainty."
The answer is a hidden server setting, so the same question has a different right answer in each run.
800 nm, pulsed, focused
Two-photon absorption needs two photons at once, so its rate grows with the square of the intensity. Short pulses and a tight focus make that likely only at the focal spot. The laser cannot emit until the agent arms it, and the server caps its power at 200 mW.
A glow you cannot see
The photosensitiser absorbs, and its long-lived triplet state hands the energy to dissolved oxygen. Excited oxygen emits a faint infrared line at 1270 nm, the signature of singlet oxygen.
512 InGaAs pixels, with real noise
Shot noise, read noise, dark current and a hard saturation limit at 65,535 counts. The agent sets the integration time and averages within limits the server enforces, and every action, including every refusal, goes into a lab notebook.
The whole cone lights up
To reach the same excited state with one photon you need twice the energy: 400 nm, violet. Excitation now grows with intensity, not its square, and the light crossing every plane of the sample is the same, so the converging and diverging cone glows from wall to wall.
Only the focus
At 800 nm two photons must arrive together, so excitation follows intensity squared. Away from the focus the beam spreads and the square collapses: excitation shrinks to a point. That confinement is what makes two-photon microscopy section in 3D and what two-photon photodynamic therapy is built on.
Six powers, chosen by the model
The agent picked 10, 30, 50, 80, 120 and 160 mW, switching emission off between settings. The readout shows the peak counts it actually recorded at each power. Signal grows as Pn; the slope of a log-log plot gives n.
The run
28 tool calls · 91 s
Every call the agent made, replayed
| Hidden truth | Agent's result | Powers | Tool calls | Time | Verdict |
|---|---|---|---|---|---|
| Two-photon | 2.004 ± 0.03 | 6, 10 to 160 mW | 28 | 91 s | Correct |
| One-photon (control) | 1.003 ± 0.002 | 5, 20 to 160 mW | 32 | 84 s | Correct |
What it got wrong
the photophysics
Right number, wrong story
The measurements and fits were sound. The closing explanations were not, in both runs. This is what actually happens, step by step.
Run 1, the agent: the 3.1 eV "is consistent with the energy gap to the singlet oxygen emission". The emission is 0.98 eV. Run 2, the agent: singlet oxygen is "excited via one-photon absorption from the triplet state". Oxygen absorbs nothing here: the sensitiser absorbs, and its triplet passes the energy over. The photon order describes the sensitiser's excitation.
Why the control run matters. At 800 nm the textbook guess is "two-photon". With a one-photon sample under the same question the agent measured 1.003. Reciting the expected answer would have failed; it had to run a measurement good enough for the server's fit to reach the right verdict. The verdict wording comes from the fit tool, and the agent repeated it.
Why the design is this way. A reliable operator and a careless interpreter. So the server owns the safety limits and the statistics, and a person owns the interpretation.
The server
10 tools · 22 tests
Safety lives in the server
- A power cap (200 mW by default), an arm-then-emit interlock, and read-only, configure and full permission levels.
- Any unexpected error puts the bench in its safe state before the tool returns.
- Peak fits report the area with its uncertainty and flag saturation; the power-law fit weights each point by its error and scales the slope's uncertainty by the reduced chi-squared.
- A real Thorlabs PM100 power-meter driver (SCPI over VISA), tested against a simulated instrument. It has not yet run on hardware.
Python · FastMCP · NumPy · SciPy · PyVISA · pyvisa-sim · pytest · llama.cpp · Qwen3.6-35B