AgentAM: An LLM Agent Layer for Spatter-Aware LPBF Process Windows
The bottleneck for LPBF surrogates is the interface, not the fit; an LLM agent over MCP can close it, but only if the agent layer is benchmarked apart from the model and fenced in by guards that do not trust the model to behave.
On this page
A process engineer has 279 single-track simulations in hand, yet the question on the table is whether anyone on the shop floor can actually use them. Most people assume the answer is yes, because the surrogates report R-squared above 0.95 on melt pool geometry, so the hard part looks finished. It is not. The person who sets laser power and scan velocity at six in the morning will not write Python to query a model, and a chatbot that answers confidently without ever calling that model is worse than no tool at all [1].
The model is not the problem; nobody wants to write the wrapper
Laser powder bed fusion (LPBF) melts thin beds of metal powder with a focused laser, layer by layer, and it already makes high-value aerospace, biomedical and energy parts. The trouble is spatter: metal vapor and recoil pressure above the melt pool eject droplets and entrained powder onto the unexposed bed, locally changing layer thickness and seeding porosity, lack of fusion and rough surfaces in later layers. Spatter depends strongly on the energy delivered to the pool, and laser power P and scan velocity V are exactly the two numbers the engineer must choose.
Process windows are usually mapped experimentally, increasingly with high-speed or synchrotron X-ray imaging, or by multiphysics simulation. Volume-of-fluid CFD resolves the melt pool, the vapor depression and individual spatter particles, but a single track costs hours of computation, which rules out interactive parameter selection. Surrogates close that gap: polynomial regression fitted to simulation data returns in milliseconds. Earlier work on this pipeline reported melt pool geometry above R-squared 0.95 with usable spatter accuracy [1].
The bottleneck sits at the interface. Querying a surrogate requires code, knowledge of each model's inputs, units and valid range, and the manual work of assembling single predictions into scans and searches. A large language model (LLM) agent offers a different surface: it decomposes one plain-language request into a sequence of tool calls and uses the returned JSON to decide the next step. The Model Context Protocol (MCP), released as an open standard in 2024, standardizes discovery and invocation over JSON-RPC, so a tool server written once can serve different models.
What 279 single tracks buy you, and the four geometric labels
The training data are spatter volume and melt pool geometry from 279 SS316L single-track FLOW-3D simulations, each spanning 600 microseconds, over P from 160 to 430 W and V from 100 to 1500 mm/s on a 10 micrometre Cartesian mesh. Melt pool depth, width, length, cross-sectional area and volume use fourth-order polynomials in P and V fitted by ridge regression with strength 10. Spatter uses a fourth-order polynomial on V/P, V-cubed, V-to-the-fourth and P-cubed, with P and V scaled by 400 W and 1400 mm/s. Melt pool models stay above R-squared 0.95 on train and test; the spatter model reaches R-squared 0.83 on test data.
| Label | Criterion | Why this order |
|---|---|---|
| keyhole | D/W > 1.25 | Tested first, so deep narrow pools are claimed early |
| lack of fusion | D/t < 1 with layer thickness t = 137 micrometres | Tested second: a pool that cannot reach the substrate fails regardless of shape |
| balling | 2.35 < L/W < 3.7 | Tested third: length-to-width enters the Plateau-Rayleigh band |
| Good | everything remaining | Covers stable conduction and transition mode melting |
Under cross-validation the criteria reproduce the regime read off the simulated geometry in 93.4 percent of tracks. Note the wording carefully: these are geometry-derived defect regimes, meaning what a pool of the predicted shape is expected to produce, not a defect that was observed or measured. Every prediction also carries linear energy density J equal to P over V, so an engineer can sanity-check the answer in familiar units.
Three guards that do not trust the model to behave
An MCP server runs on the user's own machine and exposes the surrogate pipeline as prediction, process-window scan and constrained-optimization tools. The chat client hosts Claude Opus 4.5 at temperature 1.0, capped at 2000 output tokens per response and eight tool-use steps per user turn. All surrogate inference stays local; only parameter values and surrogate outputs cross the provider API.
- Input clamping: P is clamped to 160 to 430 W and V to 100 to 1500 mm/s before inference, so the polynomials never extrapolate, and the response flags any clamping so the agent can report the values actually used.
- Material allowlist: the server accepts SS316L only and returns an explicit error otherwise, so predictions cannot be relabelled under another alloy.
- Fail loud: if a model cannot be loaded or evaluated, the server returns an error rather than a value, so a model-layer failure cannot become a plausible-looking number.
Questions outside the surrogate's scope, such as other alloys or bulk material properties, may be answered from general knowledge but must be labelled as such and never carry model numbers. That rule reads as housekeeping until you see which benchmark prompts it is aimed at.
Why the lowest-spatter point is the dangerous one
Ask an optimizer for minimum spatter and it returns points sitting on a regime boundary, because spatter falls with energy input until the pool becomes too shallow to fuse. The paper reports that minimum-spatter optima often lie within 10 micrometres of the lack-of-fusion boundary. A small process shift then moves the part out of Good and into lack of fusion.
The tool mcp_find_robust therefore minimizes spatter subject to margins, searching a 46 by 46 grid. A Good point carries four margins: depth margin D minus 137 micrometres, keyhole margin 1.25 minus D/W, the distance of L/W outside the balling band, and the distance of P and V from the trained-range edge as a fraction of its width. Defaults are 15 micrometres, 0.10, 0.15 and 5 percent. The 0.10 keyhole default is deliberate: misclassified keyhole and Good tracks sat only 0.04 to 0.08 from the threshold. The tool returns the lowest-spatter point meeting every margin, the margins themselves, the nearest threshold, the plain optimum, and the spatter cost of buying margin. If nothing qualifies, it says so.
Robustness is checked with 1000 Monte Carlo samples carrying a 2 percent relative error at one sigma on P and on V, then again with jointly sampled cross-validated geometry residuals folded in. The numbers are the story: under 2 percent drift alone, margin awareness raised the estimated probability of staying classified Good from 0.94 to 1.00; once geometry residuals were added, from 0.72 to 0.91.
A 145-prompt benchmark that scores the agent, not the surrogate
Every accuracy figure above belongs to the model, not the agent. The agent can still pass the wrong power, report a number the surrogate never returned, recommend a point that violates a stated constraint, or answer a question about a different alloy with confident digits. One successful demo says nothing about failure rates, so the authors built a benchmark that isolates the agent layer: 145 prompts covering parameter extraction, unit handling, tool selection, numerical faithfulness and out-of-scope requests, plus eight margin-aware prompts run 40 times.
| Metric | Result |
|---|---|
| Main benchmark prompts / runs | 145 / 725 |
| Parsing prompts with intended inputs passed | 98.5 percent |
| Feasible optimization runs meeting every stated constraint | all 65, median 1.0 percent from the brute-force optimum |
| Runs fabricating tool calls or model outputs without tools | 80 percent |
| Requests with unsupported predictions without tools | 90 percent |
| Client-side answer guard on fabricated calls | blocked all; zero false positives among 29 legitimate tool-free answers |
The last two rows matter most. Strip the tools away and the same model invented tool calls or model outputs in 80 percent of runs and produced unsupported predictions in 90 percent of requests, even under a neutral system prompt. Model values must therefore come from tools, not from the LLM. The client-side answer guard blocked every fabricated tool call with no false positives across 29 legitimate tool-free answers, though its coverage of unsupported answers was limited under neutral prompts.
When this setup does not apply
The method fails when the alloy, layer thickness or track geometry moves outside what was simulated. The thresholds are borrowed: D/W above 1.25 comes from a severely keyholed Inconel 718 single-track definition, while the ratio at which keyhole porosity actually sets in for SS316L is not established here, and reported thresholds elsewhere span 1.0 to 2.2. The scope is one alloy, one 137 micrometre layer, single tracks and no overlap; multi-laser or overlapping-track settings are out of scope, and clamping means out-of-range requests are pulled back to the boundary rather than answered.
It also does not apply when you need a calibrated machine-error model, because the 2 percent normal drift is an assumption rather than a measured distribution, so the 0.94 to 1.00 and 0.72 to 0.91 figures would need recomputation on different hardware. The agent evaluation covers one model, Claude Opus 4.5, under one system prompt, and the answer guard targets specified fabrication patterns rather than proving general correctness.
One result cuts both ways: roughly 40 to 50 well-spread simulations sufficed to reproduce the defect map. If you are buying simulation budget, negotiate the acquisition strategy, not the track count.
