Source-linked AI summary
CP-Agent: A Harness-Engineered Agent for Crystal Plasticity Simulation Workflows
Samuel Onimpa Alfred, Abhishek Kumar, Veera Sundararaghavan
TL;DR
Manual expert coordination of heterogeneous crystal-plasticity tools and calibration motivates automation of complete workflows. CP-Agent uses a ReAct agent and reusable harness to sequence tools from their descriptions, with numerical search delegated to optimizers. Across the reported cases, it calibrated material parameters, reproduced benchmark behavior, and recovered a diffuse initial texture.
Problem
Crystal-plasticity calibration and multi-step workflows require iterative expert judgment and coordination across heterogeneous tools, limiting systematic parameter studies.
Source: §1 · p. 2Method
CP-Agent wraps a ReAct LLM in a reusable harness that encodes tool prerequisites and defaults in schemas, while established optimizers perform numerical search.
Source: §1 · p. 4, §5 · p. 31Results
Across the case studies, CP-Agent achieved RMSE below 5 MPa within 26 of 60 simulations for 316L calibration, reproduced copper stress-strain and texture benchmarks, and recovered a diffuse copper initial texture.
Source: §3.4.4 · p. 25, §5 · p. 31Takeaways & Limitations
The authors conclude that tool descriptions can carry domain knowledge for generalizable CP workflow automation, with visible ReAct traces providing an auditable record of decisions.
Source: §5 · p. 31The inverse-texture search used fifteen evaluations and one 400-grain realization, so its recovered spread and axis are best reported qualitatively.
Source: §3.4.5 · p. 25
Abstract
from arXiv · showhide
Crystal plasticity (CP) simulations predict the mechanical behavior of polycrystalline metals, yet their routine use is hindered by the manual effort of configuring heterogeneous tools, orchestrating multi-step data pipelines, and calibrating constitutive parameters against experiments. These bottlenecks impede productivity in systematic parameter studies, motivating interest in automated workflows. This study presents CP-Agent, a harness-engineered LLM-based agent that autonomously executes complete CP modeling workflows from natural-language tasks. Operating under the ReAct paradigm, the agent reasons about tool selection and sequencing while delegating numerical search to established optimizers. The harness comprises a minimal system prompt, typed tool definitions, a dispatcher, and a safety-bounded iteration loop, encoding domain knowledge through tool schemas rather than hard-coded logic. CP-Agent is demonstrated on four case studies: calibrating four slip parameters of additively manufactured stainless steel 316L against tensile data; validating the workflow against published copper benchmarks, reproducing stress-strain and texture evolution; recovering the initial crystallographic texture of copper, where the agent correctly identifies a diffuse initial texture; and reproducing the multi-pass rolling texture evolution of a Mg-Zn-Ca alloy, where the agent chains five deformation passes and recovers the experimentally observed weakened, split basal texture. In all cases, the agent inferred the correct execution sequence from the task statement, robustly across repeated runs, and delivered physically interpretable results. This work establishes harness engineering as a systematic approach to automating CP modeling workflows while maintaining physical interpretability and auditability through visible reasoning traces.
1. Introduction
Crystal plasticity predicts grain-scale and macroscopic behavior, but its multi-tool workflows and experimental parameter calibration require substantial expert coordination. The introduction motivates CP-Agent as a harness-engineered agent for end-to-end, auditable workflows that infer tool sequences from task goals and tool descriptions.
1. Introduction
- CP modeling links grain-level slip behavior to macroscopic response and predicts microstructural evolution, including texture, anisotropy, and localized deformation.Its explicit grain-resolved stress and orientation states distinguish it from data-driven surrogate models.Source: §1 · p. 2
- Manual calibration requires iterative finite-element simulations guided by expert judgment, while coordinating heterogeneous workflow tools restricts specialist access and systematic-study throughput.The workflow can include microstructure generation, input conversion, simulation, orientation extraction, and crystallographic post-processing.Source: §1 · pp. 2–3
- Prior agent work spans scientific data extraction and engineering simulations, while CP-agent studies have not established complete polycrystalline workflows across task types.The cited CP study addresses single-crystal workflows but lacks end-to-end polycrystalline mesh instantiation and texture post-processing.Source: §1 · pp. 3–4
- The unmet need is end-to-end execution across calibration, validation, inverse recovery, and chained deformation with physical admissibility and auditable decisions.Numerically low objectives can still reflect nonphysical parameters, divergent increments, or overfitting, while final answers alone obscure intermediate reasoning.Source: §1 · p. 4
- The design makes visible reasoning traces auditable and places domain knowledge in tool schemas rather than prescribing a sequence in the system prompt.The authors frame harness engineering as the main reliability design problem, with the underlying LLM replaceable without disrupting the scaffolding.Source: §1 · pp. 4–5
- CP-Agent uses a ReAct agent and a reusable harness whose tool descriptions encode prerequisites and defaults, allowing the agent to infer workflow order without hard-coded orchestration.The same system prompt, dispatcher, and loop are reused across case studies, with tools and user queries changing; constraints and validation gates enforce admissibility.Source: §1 · p. 5
2. Harness-engineered LLM-based Agent Framework
CP-Agent wraps an LLM in a reusable harness that uses typed tool descriptions to support autonomous sequencing of complete crystal-plasticity workflows. The framework separates task intent from fixed behavioral rules and relies on domain tools for simulation and texture analysis.
2.1. Harness Architecture
- The harness combines a fixed system prompt, typed tool definitions, a dispatcher, and a safety-bounded loop around GPT-4o, which reasons and interprets results while tools execute workflows.The framework is designed for multi-step CP pipelines and can replace specific simulation tools without changing the harness core.Source: §2 · p. 5, §2.1 · p. 6, §2.4 · p. 11
- A single agent retains full conversation history for sequential workflows, avoiding multi-agent coordination overhead and supporting decisions based on intermediate tool results.The design assigns action sequencing and result interpretation to the LLM, while numerical search is delegated to established optimizers.Source: §2.1 · pp. 6–7
2.1.1. Harness inputs: system prompt and user query
- The invariant system prompt sets operational rules, while the runtime user query supplies task intent and can override tool defaults through natural-language specifications.The agent maps the query to tool calls by reasoning from their descriptions.Source: §2.1.1 · p. 7
2.1.2. Agent loop
- At each ReAct iteration, the agent emits visible reasoning and a tool call or terminates with a natural-language interpretation, under a fixed iteration limit.The limit prevents unbounded execution after repeated failures and bounds computational cost per run.Source: §2.1.2 · p. 7
2.2. Tool Definitions: The Harness Knowledge Layer
- Tool schemas encode each operation’s inputs, outputs, prerequisites, and defaults, enabling the agent to infer call order without an explicitly supplied sequence.The tool set is application-dependent; adapting a workflow requires updating tools and descriptions rather than the harness core.Source: §2.2 · pp. 7–8
2.3. System Prompt Design
- Goal-driven prompting states the objective and tool list but leaves execution order to the agent’s reasoning over tool prerequisites.This keeps domain knowledge near the operations it governs instead of embedding a specific workflow in system instructions.Source: §2.3 · p. 11
2.4. Simulation Infrastructure
- The simulation infrastructure wraps existing codes for microstructure generation, finite-element simulation, and crystallographic post-processing; microstructures store grain IDs and Rodrigues orientation vectors.The solver consumes a discretized microstructure and constitutive and loading parameters, then outputs grain orientations, stresses, and accumulated slip.Source: §2.4 · p. 11, §2.4.1 · p. 11, §2.4.2 · p. 11
2.4.3. Post-deformation Texture Analysis
- Post-processing aggregates deformed orientations by grain and uses matched pre- and post-deformation pole-figure color scales so intensity changes remain physically interpretable.A shared scale makes higher post-deformation peak intensity indicate texture strengthening rather than color-axis rescaling.Source: §2.4.3 · p. 12
3. Case Studies
The case studies use a shared agent and tool dispatcher, with workflow-specific harness configurations. In the SS316L calibration, the agent delegated the bounded parameter search to Bayesian optimization, meeting the RMSE target while the MAPE target remained unmet.
3. Case Studies
- The four case studies cover parameter calibration, forward validation, inverse texture recovery, and five chained Mg-Zn-Ca deformation passes, using the same LLM and dispatcher with configuration changes.The case-study section frames these workflows as differing in objectives, unknowns, and simulation requirements.Source: §3 · p. 12, Table 3 · p. 13
3.1. Computational setup
- All case studies use GPT-4o through function calling, with a 0.1 sampling temperature and responses capped at 1024 tokens per turn.Microstructures are generated with ELAS3D-Xtal, simulations use PRISMS-Plasticity, and Python performs post-processing.Source: §3.1 · p. 12
3.2.1. Task specification
- The calibration task specifies four slip parameters, Bayesian optimization, and stopping at RMSE below 5 MPa, MAPE below 2%, or 60 simulations.Agreement is measured after interpolating simulated and experimental curves onto common strain points, using RMSE in MPa and MAPE.Source: §3.2.1 · p. 13
3.2.2. Harness configuration
- The harness supplies self-contained optimizer tools that propose candidates, run simulations, compute errors, log evaluations, and enforce stopping criteria; the agent selects the strategy rather than doing the numerical search.Stopping criteria are enforced by the simulation wrapper, which halts the search when a criterion is met.Source: §3.2.2 · p. 14
3.2.3. Results
- The agent generated a microstructure, converted it for PRISMS-Plasticity, selected Bayesian optimization, and handed the search to the optimizer for execution.The optimizer returned the best parameter set and error metrics as a structured observation for the agent to interpret.Source: §3.2.3 · p. 14, §3.2.4 · p. 16
- 4.95 MPa RMSE was reached at evaluation 26, below the 5 MPa threshold, while the 2.85% MAPE remained above its 2% target.The search stayed within the 60-simulation budget and the calibrated parameters were within their prescribed bounds.Source: §3.2.3 · p. 15, Figure 3 · p. 15, Table 5 · p. 15
3.2.4. Discussion
- The short tensile-data window reaches only the elastic–plastic knee, leaving saturation stress and initial hardening modulus loosely constrained and partly compensating.The discussion identifies calibration data extending into the flow plateau, or multiple loading paths, as relevant when those parameters are of interest.Source: §3.2.4 · p. 16
3.3. Case Study 2: Texture Evolution
The agent inferred and executed a fixed-parameter forward validation of OFHC copper, reproducing the reference stress–strain response and post-compression texture. The comparison also shows that residual texture-image differences reflect sampling and reconstruction choices, not a failure of the forward model.
3.3.1. Task specification
- From the task and tool schemas, the agent inferred the workflow from microstructure generation through simulation and orientation extraction to texture and stress–strain comparisons.The task specified a random-texture polycrystal compressed to about true strain 1.0, with fixed literature parameters and no tuning.Source: §3.3.2 · p. 17, §3.3 · p. 17, §3.3.1 · p. 17
3.3.2. Results
- MAPE 1.8%: a single forward run with fixed parameters matched the reference copper stress–strain curve, reaching 384 MPa versus 383 MPa at true strain 1.0.The RMSE was approximately 4.8 MPa.Source: §3.3.2 · p. 17, Figure 5 · p. 18, §3.3.3 · p. 20
- Before deformation, the three pole figures were nearly uniform at about 1 MRD, while compression produced the characteristic deformation texture.Figure 6 compares post-deformation pole figures on a common 0–3.5 MRD scale, with the compression axis at each projection’s center.Source: §3.3.2 · p. 18, Figure 6 · p. 19
- The simulated and reference textures share the ⟨110⟩ compression fiber, with central {100} and {111} minima; central {110} intensity was 3.47 MRD versus about 3.5 MRD.83% of grains lie within 15° of the ⟨110⟩∥Z fiber; Table 6 summarizes quantitative pole-figure features.Source: Figure 6 · p. 19, §3.3.2 · pp. 19–20, Table 6 · p. 20
3.3.3. Discussion
- Increasing Taylor substeps from 100 to 1000 left flow stress and fiber fraction unchanged; residual texture differences instead reflect sampling variability and pole-figure reconstruction.The forward benchmark also sets the supported interpretation level for the subsequent inverse study: initial texture recovery should not be treated as an orientation-by-orientation match.Source: §3.3.3 · p. 20
3.4. Case Study 3: Inverse Recovery of the Initial Texture
Case Study 3 searches for an initial copper texture that reproduces a known deformation texture, using a validated forward model and a 15-simulation search. The search supports a diffuse initial texture; its weak [110] preference under the digitized target is a measurement-footing proxy, not evidence of a physical [110] initial texture.
3.4.1. Problem Formulation
- The task searches the initial microstructure against copper’s target deformation pole figures after compression to true strain approximately 1.0.The design allows random texture or fibers along [100], [110], and [111], with spread σ; other model inputs and the 400-grain configuration are fixed.Source: §3.4 · pp. 20–21, §3.4.1 · p. 21
- The objective compares peak and compression-axis central intensities in the {111}, {100}, and {110} pole figures, weighting the discriminating {110} figure twice.The features are computed from deformed orientations using an 8-degree smoothing kernel and compared with digitized target intensities.Source: §3.4.1 · p. 21
3.4.2. Task Specification
- For the expensive forward model, the agent selected Bayesian optimization; four initial evaluations were followed by eleven expected-improvement proposals.The optimizer, rather than the agent, proposed the textures and ran the evaluations.Source: §3.4.2 · p. 22, §3.4.3 · p. 22, Figure 7 · p. 22
3.4.3. Results
- The recovered [110] fiber at 27 degrees had loss 0.262, versus 0.568 for random; sharp and [100] starts were decisively rejected.The converged full-Taylor-substep rerun returned the same 0.262 loss; the 15-evaluation ranking should not be over-interpreted.Source: §3.4.3 · pp. 22–23, Table 8 · p. 23
- Against the reference deformation texture, the recovered texture produces a central {110} intensity of 3.11 MRD versus the 3.3 target.The recovered initial texture is a diffuse [110] fiber with 27-degree spread; after compression, its central {111} and {100} minima match the reference pattern.Source: §3.4.3 · p. 23, Figure 8 · p. 24
3.4.4. Discussion
- The inverse search supports a diffuse initial texture consistent with the random ground truth; its weak [110] preference under the digitized target compensates for a measurement-footing gap.When the target is reconstructed using the scorer’s own kernel, random becomes the global optimum and the [110] preference disappears.Source: §3.4.4 · pp. 24–25
3.4.5. Limitations
- The 15-evaluation search and single 400-grain realization leave the separation between diffuse [110] and random partly attributable to numerical noise.A target reconstructed on the simulation’s own footing, ensemble averaging, and a larger evaluation budget are identified as ways to tighten the optimum.Source: §3.4.5 · p. 25, §3.4.4 · p. 25
3.5. Case Study 4: Multi-Pass Deformation Texture Evolution in a Magnesium Alloy
CS4 tests whether CP-Agent can run a stateful, five-pass ZX31 rolling workflow and reproduce its texture against simulation and experiment. It recovers the weak, rolling-direction-split basal texture while preserving the distinction between deformation-only simulations and the physically rolled material.
3.5.1. Task specification
- The task chains five 20%-true-strain plane-strain compression passes at 350 °C, using each pass’s deformed orientations as the next pass’s initial texture.The HCP ZX31 alloy uses fixed, calibrated slip and extension-twinning parameters and a rate-dependent constitutive model; no parameters are tuned in this forward reproduction.Source: §3.5 · pp. 25–26, §3.5.1 · p. 26
3.5.2. Harness configuration
- The harness exposes a stateful pass runner and read-only tools for pass-one stress comparison, texture evolution, and final-texture comparison.The runner carries deformed orientations forward; the workflow requires texture analyses only after all five passes.Source: §3.5.2 · p. 26
3.5.3. Results
- The agent inferred and ran the five passes in order, checked stress after pass one, and completed texture analyses after pass five.The pass-to-pass orientation hand-off is performed deterministically inside the run_pass tool; the agent reasons about sequencing.Source: §3.5.2 · p. 26, §3.5.3 · p. 27
- The five-pass simulation reproduces the reference’s weak, rolling-direction-split basal texture, with (0001) peak intensities of 2.10 versus 1.94 MRD after one pass and 5.66 versus 5.46 MRD after five passes.Texture strengthens monotonically but remains weak after five passes; Table 10 reports peak intensity by pass number.Source: §3.5.3 · p. 27, Table 10 · p. 28, Figure 9 · p. 28
- After five passes, experiment and simulations share a weak, RD-split basal texture, while experimental peak intensity is 4.6 MRD versus 5.66 MRD for the deformation-only simulation.The authors attribute the lower experimental intensity to dynamic recrystallisation during hot rolling, which consumes deformed orientations and weakens texture.Source: §3.5.3 · pp. 28–29, Figure 9 · p. 28
3.5.4. Discussion
- CS4 extends the harness to HCP plasticity and experimental EBSD texture validation, beyond earlier single-shot FCC workflows and simulation-only texture benchmarks.The agent and loop remain unchanged; only the alloy-specific deck and tools are swapped in.Source: §3.5 · p. 26, §3.5.4 · p. 29
3.6. Harness Reliability and Robustness
The authors assess repeated-run reliability, test whether sequencing depends on particular tool cues, and inject a solver fault to examine recovery.
3.6.1. Reliability
- Across CS1–CS3, the agent recovered the correct sequence and terminated cleanly in 20 of 20 runs per case study.Run-to-run variation in calibration metrics reflected optimizer stochasticity, while independent-step ordering variation did not violate data dependencies.Source: §3.6.1 · p. 29
3.6.2. Sequencing Ablation
- The agent produced valid tool orders in 20 of 20 runs in each of four ablation conditions, including opaque tool names with prerequisites removed.The authors report that ordering remained robust when either or both cues were removed.Source: §3.6.2 · p. 29
3.6.3. Error Recovery
- In 5 of 5 fault-injection runs, the agent inferred a missing conversion step from the solver diagnostic, invoked the conversion tool, and completed the workflow.It overrode a default “do not convert” instruction after the solver evidence contradicted it.Source: §3.6.3 · pp. 29–30
4. Discussion
The discussion argues that a reusable harness can generalize across CP tasks by placing domain knowledge in tool descriptions and delegating numerical search to validated optimizers. It also qualifies inverse-texture recovery and outlines extensions to the framework.
4. Discussion
- The same harness architecture executed four CP workflows without changes to the system prompt, with only tools and user queries changed.The authors contrast this problem-agnostic approach with workflows that hard-code steps in prompts or rely on domain-specific finetuning.Source: §4 · p. 30
4.1. Harness Design and Generalization
- Tool descriptions and the task statement carry domain knowledge for autonomous sequencing, so adapting the framework requires updating the tool layer rather than rewriting the prompt or loop.The discussion says the Case Study 2 ordering ablation found this behavior robust to tool-layer phrasing.Source: §4.1 · p. 30
4.2. Role of the Agent versus the Optimizer
- Validated optimizers execute numerical searches while the agent selects strategies, sequences tools, diagnoses failures, and interprets results.The authors argue that keeping the LLM out of the search loop avoids stochastic variability and risk of non-physical proposals.Source: §4.2 · p. 30
4.3. Interpretation of the Inverse Texture Result
- Inverse recovery identified a diffuse initial texture but favored a diffuse [110] fiber over the known random ground truth.The authors attribute the residual bias to forward-model shortfalls associated with sampling variability and pole-figure reconstruction, and advise interpreting recovery only at the level the model supports.Source: §4.3 · p. 30
4.4. Future Directions
- Proposed extensions include multiscale coupling, uncertainty quantification, experimental-data acquisition, multi-agent parallel subtasks, and a reusable tool-description knowledge base.The authors propose retaining a single agent for sequential decision-making in a multi-agent extension.Source: §4.4 · pp. 30–31
5. Conclusion
The conclusion presents CP-Agent as a reusable harness for autonomous CP workflows, combining a minimal ReAct-style prompt with typed tools, a dispatcher, and a bounded iteration loop. Across four case studies, it reports successful calibration, validation, inverse recovery, and multi-pass texture reproduction, while emphasizing interpretability and auditability.
5. Conclusion
- The same harness architecture executed four workflows without changes to the system prompt or orchestration logic.Only the tool set and user query changed.Source: §5 · p. 31
- The authors conclude that tool descriptions carry domain knowledge for sequencing, validated optimizers perform numerical search, and visible ReAct traces provide an auditable record of decisions.They present this division of labor and trace visibility as supporting reliability and trust in autonomous scientific workflows.Source: §5 · p. 31
- The four cases covered 316L slip-parameter calibration, copper forward validation and inverse texture recovery, and five-pass ZX31 texture evolution.The reported outcomes include RMSE below 5 MPa within 26 of 60 simulations for calibration, and reproduction of the reference and experimentally observed weakened, split basal texture for ZX31.Source: §5 · p. 31
- The framework is presented as a foundation for broader harnessed agents in multiscale modeling that could reduce manual CP workflow effort while maintaining interpretability and auditability.Proposed future extensions include multiscale coupling, uncertainty quantification, and automated experimental design.Source: §5 · p. 31
Reasoning Trace: Case Study 1
The agent generated and converted an SS316L microstructure, then used Bayesian optimization to calibrate four slip parameters against tensile data. It reached an RMSE below 5 MPa and returned parameters with a physical interpretation.
Workflow
- The agent’s planned sequence was microstructure generation, HDF5-to-PRISMS conversion, and Bayesian optimization of slip parameters.The optimization call used 10 initial samples and seed 42.Source: Reasoning Trace: Case Study 1 · p. 32
- Microstructure generation completed successfully with 7,653 grains and no pores, and conversion produced a 32x32x32 grid for PRISMS-Plasticity.The generation log reports all voxels assigned; the subsequent conversion wrote grain IDs and orientations.Source: Reasoning Trace: Case Study 1 · p. 32
- The full parameter .mat save failed because the file appeared corrupt, although the HDF5 structure was saved and the workflow continued.The log attributes the save failure to writing the large file on a WSL path.Source: Reasoning Trace: Case Study 1 · p. 32
Calibration result
- RMSE=4.9548 MPa met the task’s RMSE<5 MPa stopping criterion after Bayesian optimization, with MAPE=2.846%.The task allowed up to 60 simulations; the validation run reported the same RMSE.Source: Reasoning Trace: Case Study 1 · pp. 31, 34
- The optimizer returned s0=120.6103 MPa, h0=2398.6739 MPa, ss=541.6495 MPa, and n=2.9357.The authors interpret these parameters as indicating moderate yield stress, strong strain hardening, and a distinct elastic-to-plastic transition.Source: Reasoning Trace: Case Study 1 · p. 34
Code and Data Availability
The authors identify the public repository and sources for the materials used in the study.
Availability
- The repository provides the harness, case queries, microstructure and post-processing scripts, and calibration and target data for the four case studies.The repository is available at https://github.com/samoalfred/harness-cp-agents.Source: Code and Data Availability · p. 35
- The study accessed its underlying GPT-4o model through the OpenAI API.The passage also identifies Materials Commons as the source for data from and.Source: Code and Data Availability · p. 35
- Data from and were accessed through Materials Commons.The passage gives the Materials Commons public dataset overview page as the access point.Source: Code and Data Availability · p. 35
CRediT authorship contribution statement
The contribution statement assigns writing, software, methodology, investigation, and project responsibilities across three authors.
Author contributions
- Samuel Alfred is credited with original drafting, review and editing, software, methodology, investigation, and data curation.He is also credited with writing the original draft.Source: CRediT authorship contribution statement · p. 35
- Abhishek Kumar is credited with review and editing and software.Source: CRediT authorship contribution statement · p. 35
- Veera Sundararaghavan is credited with review and editing, original drafting, supervision, project administration, funding acquisition, and conceptualization.Source: CRediT authorship contribution statement · p. 35
Declaration of generative AI and AI-assisted technologies in the manuscript preparation process
The authors report using ChatGPT and Claude for language and grammar refinement, while retaining responsibility for the scientific content and conclusions.
Use of generative AI
- The authors used ChatGPT and Claude to assist with language and grammar refinement during manuscript preparation.They reviewed and edited the content after using these tools.Source: Declaration of generative AI and… · p. 35
- The authors state that they take full responsibility for the manuscript after reviewing and editing the AI-assisted text.Source: Declaration of generative AI and… · p. 35
- The authors attribute the scientific content, technical interpretations, and conclusions solely to themselves.Source: Declaration of generative AI and… · p. 35