Abstract
Molecular dynamics simulations are an essential tool in understanding protein structure, dynamics, and function at the atomic level. However, preparing high quality input files for MD simulations can be a time consuming and error prone process. In this work, we introduce an automated pipeline that leverages Large Language Models (LLMs), specifically Gemini 2.0 Flash, in conjunction with python scripting and Selenium based web automation to streamline the generation of MD input files. The pipeline exploits CHARMM GUI's comprehensive web-based interface for preparing simulation-ready inputs for NAMD. By integrating Gemini's code generation and iterative refinement capabilities, simulation scripts are automatically written, executed, and revised to navigate CHARMM GUI, extract appropriate parameters, and produce the required NAMD input files. Post processing is performed using additional software to further refine the simulation outputs, thereby enabling a complete and largely hands free workflow. Our results demonstrate that this approach reduces setup time, minimizes manual errors, and offers a scalable solution for handling multiple protein systems in parallel. This automated framework paves the way for broader application of LLMs in computational structural biology, offering a robust and adaptable platform for future developments in simulation automation.
Introduction
Molecular Dynamics (MD) simulations provide critical insights into the atomic-level behavior of biological macromolecules. Despite their utility, the setup process remains a significant bottleneck. Researchers must navigate a complex series of manual tasks, including structural repair of PDB files, parameter selection in web-based builders like CHARMM-GUI, and the generation of configuration scripts. This manual intervention is not only time-consuming but also prone to human error, hindering high-throughput computational studies.
NAMD-Agent addresses these challenges by introducing an autonomous AI framework that bridges the gap between natural language requests and fully executed simulations. By acting as an "agentic" layer, the system automates the setup, execution, and analysis phases, significantly reducing the manual effort traditionally required of researchers.
Methodology
The NAMD-Agent architecture is built upon a multi-layered "Reasoning and Acting" (ReAct) framework, utilizing Gemini-2.0-Flash as its central reasoning engine.
As illustrated in the workflow above, the system operates in a circular pipeline involving user job requests, CHARMM-GUI navigation, input file generation, NAMD simulation execution, and trajectory post-processing. Key components include:
- Web Automation: Using Selenium, the agent interacts headlessly with the CHARMM-GUI interface, mimicking human navigation to build molecular systems.
- Code-Aware RAG: To prevent hallucinations and ensure syntactic accuracy, the agent utilizes Retrieval-Augmented Generation (RAG) via LlamaIndex, pulling verified code templates from a curated repository.
- Tool Integration: The agent leverages specialized tools such as PDBFixer for structural repair, NAMD3 for physics calculations, and MDTraj/OpenMM for post-simulation analysis.
The agent's internal logic follows a ReAct loop, as shown in the figure above. It generates a "Thought," executes an "Action" (e.g., download_pdb or run_and_save_yml), and observes the result before proceeding to the next step. This iterative process allows the agent to troubleshoot and refine its plan dynamically based on real-time feedback from the tools.
Evaluation and Results
The framework was evaluated across seven distinct protein systems, including simple solution environments (Ubiquitin, Trp-cage) and complex membrane bilayers (Glycophorin A, Crambin).
Performance Metrics
- Efficiency: NAMD-Agent demonstrated a 2x to 4x speedup compared to experienced human researchers, reducing human hands-on time by up to 75%. For instance, the setup for Ubiquitin (1UBQ) was reduced from 27 minutes to just 7 minutes.
- Accuracy: The system achieved a 71.4% success rate (5 out of 7 systems). Successful runs yielded physical data, such as RMSD and Radius of Gyration, that aligned perfectly with established literature.
- Autonomy: The pipeline successfully transitioned from a raw PDB ID to a finalized trajectory video with negligible human intervention.
Discussion and Future Work
While NAMD-Agent represents a significant step forward, several limitations remain. The reliance on Selenium makes the system sensitive to changes in the CHARMM-GUI web layout. Additionally, failures in two complex membrane systems highlight the need for more robust error detection regarding atypical stability issues.
Future developments will focus on expanding support to other simulation engines like GROMACS and AMBER. Furthermore, the researchers aim to implement "adaptive simulation steering," enabling the agent to analyze trajectories in real-time and adjust parameters to explore rare biological events more efficiently.
Summary updated