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

Olabode T. Ajenifujah, Amir Barati FarimaniarXiv 2026 · arXiv

TL;DR

AgentAM is an AI agent that gives process engineers natural-language access to complex 3D printing simulations, allowing them to optimize laser powder bed fusion (LPBF) parameters without writing a single line of code. By using the Model Context Protocol (MCP) to connect a Large Language Model (LLM) to high-fidelity surrogate models, it identifies "robust" operating points that minimize defects like spatter while maintaining a safe distance from failure boundaries.

What Problem Does This Paper Address?

In Laser Powder Bed Fusion (LPBF), finding the "sweet spot" for laser power ($P$) and scan velocity ($V$) is a constant struggle. Set the energy too high, and you get "keyhole" porosity; too low, and you get "lack of fusion." Even in the stable zone, "spatter"—molten droplets ejected from the melt pool—can ruin part quality.

While researchers have developed accurate Computational Fluid Dynamics (CFD) models to predict these issues, these models are rarely used on the factory floor. They are computationally expensive (taking hours per simulation) and require specialized programming knowledge to query. There is a massive "usability gap" between advanced simulation science and the engineers who actually set the machine parameters.

Methods

The authors developed AgentAM, an agentic system built on the following pillars:

  1. CFD-Trained Surrogates: Instead of running slow simulations in real-time, they trained fast polynomial surrogate models on 279 CFD simulations of SS316L stainless steel. These surrogates predict melt pool geometry and spatter volume with high accuracy ($R^2 \geq 0.95$ for geometry).
  2. Model Context Protocol (MCP): This is the "glue." MCP is an open standard that allows the LLM (Claude Opus 4.5) to discover and call specific engineering tools (like the surrogates or optimizers) via JSON-RPC.
  3. Margin-Aware Optimization: Standard optimizers often pick points right on the edge of a defect zone to minimize spatter. AgentAM includes a "robust" optimizer that enforces a safety margin from defect boundaries (e.g., staying at least 15 $\mu$m above the lack-of-fusion depth).
  4. Reliability Benchmarking: The authors introduced a 145-prompt benchmark to evaluate the "agent layer" itself—testing how well it extracts parameters, handles units, and follows constraints, separate from the underlying model's accuracy.
Overview of the AgentAM architecture and workflow.

Datasets

  • Training Data: 279 single-track FLOW-3D simulations of SS316L, covering a range of power (160–430 W) and velocity (100–1500 mm/s).
  • Evaluation Benchmark: A newly introduced 145-prompt benchmark (totaling 725 runs) designed to stress-test the agent's ability to interpret engineering requests, perform unit conversions, and respect physical constraints.

Key Insights and Ideas

  • The "Edge of the Cliff" Problem: Traditional optimization for minimum spatter often pushes process parameters dangerously close to the "lack of fusion" boundary. In a real factory with 2% process drift, these "optimal" points often fail.
  • Robustness over Raw Optima: By introducing a margin-aware tool, the agent can sacrifice a small amount of spatter performance to significantly gain in reliability.
  • LLMs as Interpreters, Not Calculators: The study confirms that LLMs should never be asked to estimate engineering values directly. Without tools, the model fabricated data 80% of the time. However, as an orchestrator for validated tools, the LLM is highly effective.
  • Efficiency in Mapping: The authors found that only 40–50 well-spread simulations are needed to build a reliable defect map for a new material, making this approach scalable.
The predicted defect regimes across the Power-Velocity space.

Key Results

  • Defect Classification: The geometric classifier matched simulated results in 93.4% of cases under cross-validation.
  • Agent Reliability: In the 725-run benchmark, the agent passed intended inputs correctly in 98.5% of prompts and met 100% of stated constraints in feasible optimization runs.
  • Improved Robustness: The margin-aware optimizer raised the probability of a "Good" print from 0.72 to 0.91 when accounting for both process drift and surrogate model error.
  • Faithfulness: The agent reported numerical values from the tools with near-perfect fidelity, showing that the "agent layer" does not necessarily introduce "telephone game" errors if prompted correctly.
Comparison of plain vs. margin-aware optimization, showing how the latter moves points away from risky boundaries.

Limitations and Future Work

  • Scope: Currently limited to two parameters ($P, V$) and one material (SS316L). Real-world LPBF involves hatch spacing, beam size, and layer thickness.
  • Single-Track Focus: The models are based on single-track simulations and don't yet account for multi-track thermal accumulation or multi-layer effects.
  • Physical Validation: While the agent matches the simulations perfectly, the next step is validating these "robust" points against actual physical builds on a machine.
  • Closed-Loop Integration: The authors suggest future work could link the agent directly to in-situ monitoring sensors for real-time, natural-language-guided parameter adjustment.

Summary updated

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 ($R^2 \geq 0.95$) and spatter volume ($R^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.
BibTeX
@misc{ajenifujah2026agentam,
  author = {Olabode T. Ajenifujah and Amir Barati Farimani},
  title = {{AgentAM: An AI Agent for Spatter- and Defect-Aware Process Optimization in Laser Powder Bed Fusion}},
  year = {2026},
  eprint = {2611.05171},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.05171},
}
Figure