Manuscript Offprint

arXiv:2611.05171

AgentAM: An AI Agent for Spatter- and Defect-Aware Process Optimization in Laser Powder Bed Fusion

Olabode T. Ajenifujah, Amir Barati Farimani

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Predictive models for laser powder bed fusion (LPBF) are rarely used on the shop floor because querying them requires programming and model-specific knowledge. We present AgentAM, a large language model (LLM) agent that gives process engineers natural-language access to CFD-trained surrogates of spatter and melt pool geometry for SS316L through the Model Context Protocol (MCP). Polynomial surrogates trained on 279 single-track simulations predict melt pool dimensions (R2≥0.95R^2 \geq 0.95) and spatter volume (R2=0.83R^2 = 0.83 on test data) at any power-velocity point in the trained range, and geometric criteria assign each point a geometry-derived defect regime (keyhole, lack of fusion, balling or stable) that matches the regime obtained from the simulated geometry in 93.4% of tracks under cross-validation. The agent selects and parameterizes tools for prediction, process-window scans and constrained optimization. Minimum-spatter optima often sat within 10 µm of the lack-of-fusion boundary; a margin-aware optimizer moved them away from all thresholds and raised the estimated probability of remaining classified Good from 0.94 to 1.00 under an assumed 2% process drift, and from 0.72 to 0.91 when jointly sampled cross-validated geometry residuals were added. About 40–50 well-spread simulations sufficed to reproduce the defect map. To evaluate the agent layer, we introduce a 145-prompt benchmark scored against direct tool calls, plus eight prompts (40 runs) on margin-aware requests. Over the 725 runs of the main benchmark the agent passed the intended inputs in 98.5% of parsing prompts, reported the scored spatter values and defect classes faithfully and met every stated constraint in the 65 feasible optimization runs, within a median 1.0% of the brute-force optimum. Without tools, the same model fabricated tool calls or model outputs in 80% of runs and gave unsupported predictions in 90% of requests even under a neutral system prompt, showing that model values must come from tools rather than from the LLM; a client-side answer guard blocked every fabricated tool call with no false positives among the 29 legitimate tool-free answers tested; its coverage of unsupported answers was limited under neutral prompts.

Keywords: Laser powder bed fusion, Spatter, Process window, Large language model agent, Model Context Protocol, Surrogate model

1. Introduction

Laser powder bed fusion (LPBF) builds metal parts layer by layer by melting thin beds of powder with a focused laser. It produces geometrically complex components whose properties can match those of conventionally manufactured material [1–3], and it is now used for high-value parts in the aerospace, biomedical and energy sectors [4]. Its wider adoption is limited by process-induced defects. Porosity, lack of fusion and surface roughness reduce density and fatigue life and complicate certification [5–9], and each new alloy, machine or part geometry requires a new search for parameters that avoid them [10].

Spatter is one of the less visible causes of these defects. Metal vapor and recoil pressure above the melt pool eject droplets and entrain powder particles. The ejected material lands on the unexposed powder bed, locally changes the layer thickness and contaminates later layers, where it seeds porosity, lack of fusion and rough surfaces [11, 12]. The amount of spatter depends strongly on the energy delivered to the melt pool [13], and it is harder still to anticipate in multi-laser machines, where the laser-matter interaction changes in the regions where melt tracks overlap [14]. Laser power PP and scan velocity VV therefore have to be chosen to keep spatter low while avoiding the defect regimes on either side of the stable window.

Process windows are usually established experimentally, increasingly with high-speed and synchrotron X-ray imaging [15, 16], or by multiphysics simulation. Volume-of-fluid computational fluid dynamics (CFD) and coupled CFD–discrete-element models resolve the melt pool, the vapor depression and individual spatter particles [12, 17, 18], but each simulated track takes hours of computation, which rules out interactive parameter selection. Data-driven surrogates trained on simulations or experiments close this gap [18, 19]. In our earlier work, polynomial regression trained on CFD single tracks predicted melt pool geometry with R2>0.95R^2 > 0.95 and spatter with useful accuracy, while remaining interpretable through explicit coefficients [20–22]. Melt pool geometry also maps onto defect regimes. Lack of fusion occurs when the pool is too shallow to bond the new layer to the material below [23, 24], keyhole porosity above a critical depth-to-width ratio, with reported thresholds between D/W=1.0D/W = 1.0 and 2.2 [25–27], and balling when an elongated pool breaks up by Rayleigh–Plateau instability [28–30]. Combined, these criteria give P−VP-V process maps [23, 31–34].

Even when such models exist, they are rarely used by the engineers who set process parameters. Querying them requires code, knowledge of each model’s inputs, units and valid range, and the effort of assembling single predictions into scans and searches. This gap between model development and model use is a general obstacle to artificial intelligence in materials design and manufacturing [35, 36]. Large language model (LLM) agents offer a different interface. An LLM agent interleaves reasoning with actions such as tool calls and uses the returned observations to decide its next step [37, 38]. Later work added self-reflection on failed attempts [39], deliberate search over alternative reasoning paths [40], conversations among several cooperating agents [41], libraries of reusable skills built up during open-ended exploration [42] and agents with memory and planning that simulate believable human behavior [43]. In science, agents that call domain tools have planned and executed chemical syntheses [44, 45], designed nanobodies that were then validated experimentally [46], proposed and tested therapeutic hypotheses [47], searched for new inorganic materials with physics-aware reasoning [48] and carried out parts of the research cycle with little human intervention [49–51]. Mobile robotic chemists have shown the physical side of the same idea, running closed-loop experiments for days without supervision [52, 53]. The Model Context Protocol (MCP), released as an open standard in 2024, standardizes how agents discover and call such tools over JSON-RPC [54–56]. It is supported by several LLM providers, so a tool server written once can be used with different models [57, 58].

Manufacturing has become an active setting for such agents. Surveys and perspectives distinguish single tool-using agents from more autonomous agentic systems [59–64], describe an agentic manufacturing system as a digital twin coupled to the physical plant [65], and set out roadmaps for agentic smart manufacturing built on multi-modal models and generative multi-agent systems [66–69]. Reported applications include multi-agent control of intelligent shop floors [70], advanced planning and scheduling [71], manufacturing operations management [72], natural-language access to a manufacturing execution system [73], self-aware production through a cognitive agent [74], human-centric predictive maintenance [75], process planning from CAD models and drawings [76], geometric modelling with a human in the loop [77] and mechanical design [78]. Retrieval-augmented LLMs answer questions from the additive manufacturing literature [79] and the nanotechnology literature [80], but they return published knowledge rather than calling predictive models. In additive manufacturing, agents connected through MCP to thermophysical calculations have produced lack-of-fusion process maps for alloys including SS316L [81], an agent has iteratively optimized selective laser sintering parameters for tensile and flexural properties [82], multi-agent systems have modified part geometry for printability in fused deposition modeling [83], detected anomalies in G-code before printing [84] and planned robotic deposition paths under kinematic constraints [85]. Li et al. combined defect classifiers called through MCP with literature retrieval to assess LPBF parameter sets [86]. In each of these settings the engineer states a goal in plain language and the agent translates it into calls to models, solvers or machines. None of them gives an LPBF engineer interactive access to spatter predictions together with melt pool geometry and defect regimes, or searches the process window for parameters that meet stated constraints with a margin from every regime threshold.

For engineering use, the open question is not whether an agent can call a tool but how reliably it does so. Interviews with more than 30 companies show that reliability, verification and auditability are central requirements for adopting agents in engineering and manufacturing, ahead of model capability [87], and surveys stress the risks of unreliable outputs and unclear accountability [61, 88]. Existing benchmarks for LLMs in manufacturing mostly test domain knowledge. FDM-Bench asks questions about fused deposition modeling and G-code [89], and a benchmark of more than 200,000 questions on engineering simulation results found that vision-language models answered near chance level [90]. A benchmark on manufacturing data queries found that an agentic approach was more accurate and more interpretable than direct prompting [91], and toolkits now trace where in an agent's trajectory a failure arose [92]. These studies do not separate the agent's handling of a validated model from the accuracy of the model itself. For a process-parameter assistant the risks are concrete. The agent may pass the wrong power or velocity to the model, report a number that the model did not return, recommend a point that violates a stated constraint, or answer a question outside the model's scope, such as one about a different alloy or beam diameter, with confident numbers. Demonstrations of successful queries do not show how often such failures occur. What is needed is an evaluation of the agent layer that is separate from the accuracy of the underlying surrogate, together with safeguards that do not rely on the LLM behaving correctly, and a measurement of how much they cover.

This work makes three contributions, summarized in Fig. 1. First, we present AgentAM, an MCP server that exposes CFD-trained spatter and melt pool surrogates and a geometric defect classifier for SS316L as prediction, scanning and constrained-optimization tools, with input clamping that keeps the surrogates inside their trained range and a margin-aware optimizer that keeps recommendations away from the regime thresholds. Second, we test the defect classification against the simulated geometry of 279 FLOW-3D single tracks, both in sample and under cross-validation, demonstrate process-window exploration and multi-constraint optimization through the agent, and estimate how many simulations a new defect map needs and how an agent should choose them. Third, we introduce a 145-prompt benchmark and scoring protocol that evaluates the agent layer on its own, covering parameter extraction, unit handling, tool selection, numerical faithfulness, constraint satisfaction and out-of-scope requests. We compare the agent with the same model run without tools, and we test a client-side answer guard that filters specified fabrication patterns when no tool has returned a usable result.

Figure

Figure 1: Overview of AgentAM. The agent turns an engineer's request into a call to a tool on a local MCP server, which evaluates the polynomial surrogates, assigns geometry-derived regimes and searches the process window; the agent then reports the returned values. The example is benchmark prompt C15-01 with the call the agent made. Map: predicted regimes over the trained range; hatching marks points that meet the margins of Section 3.5; ○, plain minimum-spatter optimum; *, margin-aware optimum. The bottom row summarizes the agent evaluation.

References (73)