Source-linked AI summary
MechAgents: Large language model multi-agent collaborations can solve mechanics problems, generate new data, and integrate knowledge
Bo Ni, Markus J. Buehler
TL;DR
Numerical mechanics simulations require deep technical expertise, while learned surrogate methods offer less flexibility for incorporating new data or physical insights. MechAgents organizes interacting LLM agents into role-based teams to solve elasticity problems using numerical methods, and the authors report improved performance from clear roles and mutual corrections.
Problem
Mechanics simulations require deep technical expertise, while learned surrogate models can be inflexible for incorporating new data or physical insights.
Source: §1 · pp. 1–2Method
MechAgents organizes dynamically interacting LLM agents with specialized roles and mutual correction to apply elasticity and FEM knowledge to elasticity problems.
Source: §1 · p. 2, §2 · p. 2, §2.2 · p. 5Results
Agents with clear focuses performed better and benefited from mutual corrections, with critics identifying abnormal simulation results even when no coding error was reported.
Source: §3 · p. 10Takeaways & Limitations
The case studies demonstrate the potential of organized AI agents integrated with physics-based modeling for automating engineering and scientific problem solving.
Source: §3 · p. 10The two-agent team's self-correction was insufficient for a harder task, where it made errors in geometry, the weak form, material properties, and traction formulation.
Source: Group chat 2: On the effect of mutual… · p. 6
Abstract
from arXiv · showhide
Solving mechanics problems using numerical methods requires comprehensive intelligent capability of retrieving relevant knowledge and theory, constructing and executing codes, analyzing the results, a task that has thus far mainly been reserved for humans. While emerging AI methods can provide effective approaches to solve end-to-end problems, for instance via the use of deep surrogate models or various data analytics strategies, they often lack physical intuition since knowledge is baked into the parametric complement through training, offering less flexibility when it comes to incorporating mathematical or physical insights. By leveraging diverse capabilities of multiple dynamically interacting large language models (LLMs), we can overcome the limitations of conventional approaches and develop a new class of physics-inspired generative machine learning platform, here referred to as MechAgents. A set of AI agents can solve mechanics tasks, here demonstrated for elasticity problems, via autonomous collaborations. A two-agent team can effectively write, execute and self-correct code, in order to apply finite element methods to solve classical elasticity problems in various flavors (different boundary conditions, domain geometries, meshes, small/finite deformation and linear/hyper-elastic constitutive laws, and others). For more complex tasks, we construct a larger group of agents with enhanced division of labor among planning, formulating, coding, executing and criticizing the process and results. The agents mutually correct each other to improve the overall team-work performance in understanding, formulating and validating the solution. Our framework shows the potential of synergizing the intelligence of language models, the reliability of physics-based modeling, and the dynamic collaborations among diverse agents, opening novel avenues for automation of solving engineering problems.
1. Introduction · 2. Results and Discussion
MechAgents combines LLM agents with numerical simulation tools to solve elasticity problems with little human intervention. The paper describes self-correcting two-agent teams and larger teams that divide work and mutually correct one another to tackle more challenging problems.
1. Introduction
- Conventional FEM work demands expertise in elasticity theory, FEM, programming, debugging, and post-processing, while trained ML models offer less flexibility to incorporate new data or physical insights.Active-learning and Bayesian alternatives are typically programmed a priori.Source: §1 · pp. 1–2
- The paper investigates whether LLM-powered agents can combine natural-language and coding capabilities with numerical tools to identify problems, develop and debug code, analyze plots, and interact with human users.The proposed multi-agent direction uses division of labor and known mathematical or numerical models, such as FEM, to support mechanics research and generate data.Source: §1 · p. 2
- The two-agent team solves well-stated elasticity problems across boundary conditions, geometries, meshes, deformation regimes, constitutive laws, and post-processing, while a larger divided-labor team handles problems the two-agent team fails to solve.The paper frames these collaborations as a route toward automating engineering problem solving beyond the human-only paradigm.Source: §1 · p. 2
2. Results and Discussion
- Experiments use GPT-4 via the OpenAI API, with agents initialized by profiles, organized into differently structured teams, and sometimes given access to simulation-code execution.Agents may communicate with one another or with a human using language.Source: §2 · p. 2
- The experiments assign teams classical elasticity problems solved by FEM in Python using FEniCS, comparing a basic two-agent team with a multi-agent group on problem solving and error correction.The study focuses on the benefits of self-correction and mutual correction through agent collaboration.Source: §2 · pp. 2–3
2.1 A two-agent team with self-correction
- In the two-agent team, a user-proxy agent relays tasks, executes generated code, and returns outcomes, while the assistant plans, writes and debugs code, evaluates results, and ends the conversation when satisfied.The assistant is tested through increasingly demanding elasticity requests in a continuous conversation, with specific human instructions supplied only when it fails to recognize its own error.Source: §2.1 · p. 3
Conversation 1: Linear elasticity problems
A two-agent team used execution feedback to self-correct a FEniCS script and solve a linear elasticity problem without human intervention. It handled several task modifications, but a successful run did not prevent an undetected conceptual error.
Conversation 1: Linear elasticity problems
- After an initial script omitted Lamé constants, execution feedback enabled two-agent debugging to produce and run a correct solution without human intervention.The team identified that the constants could be calculated from Young’s modulus and Poisson’s ratio, and corrected the script after two debugging rounds.Source: Conversation 1: Linear elasticity… · pp. 3–4
- The team adapted scripts for shear loading, mesh refinement, and a circular hole, generally self-correcting execution errors and solving Rounds 1–3 correctly.The later tasks also included extracting the shear stress component.Source: Conversation 1: Linear elasticity… · p. 4
- A successful run did not guarantee correct task fulfillment: the team extracted von Mises rather than σxy in Round 4, then corrected the error after human feedback in Round 5.The paper notes that specialized agents could provide external criticism or evaluation as an alternative to human intervention.Source: Conversation 1: Linear elasticity… · p. 4
Conversation 2: From linear elasticity to hyperelasticity
The two-agent team self-corrects to solve linear and hyperelastic uniaxial tension problems without mid-process human input. The paper then introduces a larger role-based group to address the limits of self-correction and divide the work of solving mechanics problems.
Conversation 2: From linear elasticity to hyperelasticity
- The two-agent team self-corrects to solve linear small-deformation and compressible Neo-Hookean finite-deformation tension problems without human instructions during the process.The generated displacement results differ between the two cases.Source: Conversation 2: From linear elasticity… · p. 4
- Across the experiments, the two-agent team solves classical elasticity problems spanning boundary conditions, geometries, FEM meshes, deformation regimes, and constitutive laws with little human guidance.Source: Conversation 2: From linear elasticity… · p. 4
2.2 A multi-agent team using division of labor
- Because self-correction may miss conceptual errors and one assistant bears varied tasks, the authors explore assigning distinct responsibilities across more than two agents.Source: §2.2 · p. 4
- The group chat includes administrator, planner, scientist, engineer, executor, critic, and manager roles, with profiles assigning task delegation, FEM formulation, coding, execution, and evaluation.The manager coordinates autonomous, interactive, dynamic group chatting.Source: §2.2 · p. 5
- To test the larger group, the administrator alone assigns tasks and the researchers provide no additional human input during the group chat.Source: §2.2 · p. 5
Group chat 1: Linear elasticity problems · Group chat 2: On the effect of mutual correction
The multi-agent group solved the reference elasticity assignments and completed a more demanding plate-with-hole task that defeated the two-agent team. Its advantage came from divided roles and dynamic mutual correction, particularly when agents caught modeling errors and implausible results.
Group chat 1: Linear elasticity problems
- The multi-agent workflow divided planning, coding, execution, scientific review, and critique while allowing agents to intervene dynamically in one another’s work.The planner often proposed agent-specific steps, the engineer iterated on FEniCS code, and the critic could revise plans or comment on code before or after execution.Source: Group chat 1: Linear elasticity problems · p. 5
- The multi-agent group solved the reference assignments without human guidance and extracted the requested shear-stress component correctly on its first attempt.This surpassed the two-agent team, which made that extraction mistake without recognizing it.Source: Group chat 1: Linear elasticity problems · p. 5
Group chat 2: On the effect of mutual correction
- The harder task omitted explicit elasticity theory, named copper instead of specifying its properties, and required traction post-processing, challenging formulation, material retrieval, and analysis.It specified a 1 m-by-1 m plate with a 0.2 m circular hole, fixed left edge, 0.02 m rightward displacement on the right edge, and free top and bottom edges.Source: Group chat 2: On the effect of mutual… · p. 6
- The two-agent team’s script omitted the hole, used an incorrect weak form, lacked material properties, and calculated traction incorrectly, yet accepted its zero-force result.The task therefore exposed insufficient self-correction when execution produced no error or complaint.Source: Group chat 2: On the effect of mutual… · p. 6
- Critic feedback helped the multi-agent team formulate the governing equation and weak form, retrieve copper properties, add the missing hole, and correct the right-edge traction definition.The critic also recognized that an initial zero-force result was abnormal, prompting the engineer to identify the incorrectly marked right edge and revise the code.Source: Group chat 2: On the effect of mutual… · pp. 6–7
- Approximately 2052608504.74 Newtons was the final right-edge force reported for the correctly modeled plate-with-hole task, unlike the two-agent team’s erroneous zero-force result.The multi-agent script handled the circular hole and boundary conditions and saved the displacement field as requested.Source: Group chat 2: On the effect of mutual… · pp. 6, 8
- Because both organizations used GPT-4, the paper attributes their differing performance likely to role structure and interactions, with mutual correction outperforming self-correction at detecting hidden errors and abnormal results.The authors identify fine-tuned or specialized agents as a possible future improvement.Source: Group chat 2: On the effect of mutual… · p. 8
3. Conclusions
MechAgents shows how LLM agents can use numerical modeling tools to solve mechanics problems through autonomous collaboration. Its two-agent and larger role-divided teams self-correct or mutually correct their work, while the framework points toward broader scientific tool integration and human–AI collaboration.
3. Conclusions
- The study explores general-purpose LLM agents using numerical modeling tools autonomously, extending trained-model use toward retrieving or generating physics-based data on demand.This approach could support broader scientific problem solving and accumulation of domain knowledge from newly generated data and insights.Source: §3 · pp. 8–9
- The framework could incorporate simulation, experimental, human, and specialist AI capabilities, while physical checks and feedback could help assess outputs and improve problem solving.The authors note that GPT-4 constructed complex FEM scripts, but more complicated code may require fine-tuning or retrieval-augmented methods; generated data and production mechanisms could also be shared through APIs and stored in model memory.Source: §3 · p. 9
- A two-agent team continuously self-corrected FEM work and autonomously solved classical elasticity problems across varied conditions, geometries, meshes, deformations, and constitutive laws.The agents devise strategies for numerical computation rather than acting as direct proxies for problem solutions.Source: §3 · p. 9
- For more challenging tasks, a dynamically organized, role-divided agent group used mutual corrections to solve problems that the two-agent team could not handle correctly.Specialized roles included planning, formulation, coding and debugging, simulation execution, and performance criticism; critics could flag abnormal results even without reported coding errors.Source: §3 · p. 10
- Case studies suggest agent organization and interaction can amplify agent capabilities and integrate AI with physics-based modeling, with future work optimizing roles and chat topology.The authors identify self-correction and mutual correction as signs of synergies unavailable to single agents, and envision automation extending to other modeling methods.Source: §3 · p. 10
- Future applications include generating domain-rich datasets, discovering structures or materials with superior mechanical properties, and teaching mechanics through human–AI interaction.The authors highlight coupling computational methods to high-throughput experimental platforms as a promising direction.Source: §3 · p. 10
4. Materials and Methods · Agent design and setup
The study builds AutoGen-based agents powered by GPT-4 to collaborate on elasticity simulations, using the model’s code-writing ability rather than function calling. It specifies distinct agent roles and uses FEniCS as the FEM simulation environment.
Agent design and setup
- Agents are organized with GPT-4 and the AutoGen framework to support collaborative mechanics problem solving.AutoGen provides the orchestration backbone for agent interactions.Source: Agent design and setup · p. 10
- AutoGen supports customizable conversable agents that can combine LLMs, code development and execution, human input, and tools.Its function-calling tools can perform operations such as executing Python code, web searches, DFT problem solving, and image generation.Source: Agent design and setup · p. 10
- The agents use the LLM’s innate ability to write code rather than AutoGen function calling.Source: Agent design and setup · p. 10
- The agents are powered through OpenAI API ports by gpt-4-0613, with an 8,192-token context window and training data through September 2021.Using open-source LLMs is possible in principle with AutoGen but was not explored.Source: Agent design and setup · p. 10
- The two-agent team pairs an AssistantAgent assistant with a UserProxyAgent human-user proxy; the larger group assigns admin and executor proxy roles and planner, scientist, engineer, and critic assistant roles.A GroupChatManager manages the multi-agent group, and each agent receives its role profile as a system message at creation.Source: Agent design and setup · p. 10
- FEniCS is the simulation environment used to solve elasticity problems with the finite element method.The repository contains other setup details.Source: Agent design and setup · p. 11
Software versions and hardware
The MechAgents implementation was developed in Google Colab using Python 3.10, pyautogen-0.1.1476, and FEniCS installed via FEM-on-Colab.
Software versions and hardware
- The team developed its multi-agent models in Google Colab.Source: Software versions and hardware · p. 11
- The software stack used Python 3.10, pyautogen-0.1.1476, and FEniCS installed via the FEM-on-Colab package.Source: Software versions and hardware · p. 11
Data and code availability
The authors report that data and code are available on GitHub or from the corresponding author upon reasonable request.
Data and code availability
- Data and code are available on GitHub or will be provided by the corresponding author upon reasonable request.The repository is https://github.com/lamm-mit/MechAgents.Source: Data and code availability · p. 11
Author contributions
- MJB and BN conceived the study; BN developed and tested the multi-agent models, analyzed results, and drafted the paper, while MJB supported analysis and revised and finalized it with BN.Source: Data and code availability · p. 11
S1. Two-agent conversation on solving elasticity problem using finite element method … S1.3 Conversation 3: A more challenging task
The supplied passage identifies Table S8 in the subsection on a more challenging task but does not provide the table’s contents or findings.
S1.3 Conversation 3: A more challenging task
- The cited passage identifies the referenced item as Table S8, but provides no accompanying title, results, or other table contents in the supplied text.Source: Table S8
Figures and Tables
The figures and tables depict MechAgents’ two-agent and division-of-labor workflows, along with elasticity scripts and results that show self-correction and group collaboration across problem variants.
Figures and Tables
- The framework contrasts a two-agent workflow for planning, knowledge retrieval, coding, execution, and debugging with a larger group that divides labor and mutually corrects through autonomous group chat.Group roles include planning, problem formulation, code writing and debugging, tool execution, and result criticism under a chat manager.Source: Figure 1 · p. 17, Table 4 · p. 25
- A typical two-agent conversation shows the assistant correcting itself based on proxy-agent outcomes, alongside displacement predictions across Rounds 1–3 and stress predictions in Rounds 4–5.The proxy agent returns simulation outcomes to the assistant agent during the conversation.Source: Figure 2 · p. 18
- Conversation 2 illustrates displacement results for small-deformation linear elasticity and finite-deformation Neo-Hookean hyperelasticity, while Table 3 presents self-corrected scripts for both material types.Table 2 summarizes Conversation 2’s linear- and hyper-elasticity tasks in the same format as Table 1.Source: Figure 3 · p. 19, Table 2 · p. 23, Table 3 · p. 24
- The group-chat manager dynamically selects speakers, enabling mutual correction, and the group generated linear-elasticity result files without human intervention.The figure associates the result files with assignments listed in Table 1, Rows 2–4, Column 2.Source: Figure 4 · p. 20, Figures and Tables · p. 25
- For uniaxial tension, the two-agent team produced an incorrect script and result, while the multi-agent group revised its script and produced a correct displacement field.The figure attributes the group’s revisions to multiple rounds of group chat and mutual correction.Source: Figure 5 · p. 21
- In Conversation 1, the two-agent team handled the first three linear-elasticity rounds through self-correction, failed at Round 4, then corrected its mistake at Round 5 after a new-assignment hint.The tasks varied boundary conditions, FEM meshes, domain geometries, and stress-component postprocessing; no human input was provided mid-round.Source: Table 1 · p. 22
Related papers
This paper cites
Cited by
- Learning from fracture: Teaching language models to design through physical experience2026
- LLM-Assisted Generation of Transparent, Open-Source Multiphysics Models of Electrochemical Devices2026
- LLM Agents Perform Controlled Experiments Using Simulation Models2026
- Large Language Models and their Awareness of Mechanics and Spatial Geometry2026
- AI scientists produce results without reasoning scientifically2026