VASP Agent: An Agentic Framework for Autonomous First-principles Calculations

Zeyu Xia, Jinzhe Ma, Congjie Zheng, Zhongyao Wang, Shufei Zhang, Yuqiang Li, Hang Su, P. Hu, Changshui Zhang, Xingao Gong, Wanli Ouyang, Lei Bai, Dongzhan Zhou, Mao SuarXiv 2025

TL;DR

VASP Agent is an autonomous, coding-agent-centered framework designed to reliably execute complex, multi-step first-principles materials science calculations. By integrating a dynamic skill library, live workspace inspection, and physics-based guardrails, it achieves a 100% task completion rate and successfully diagnoses and recovers from runtime errors that typically crash rigid automated pipelines.

What Problem Does This Paper Address?

First-principles calculations—such as Density Functional Theory (DFT) simulations using the Vienna Ab initio Simulation Package (VASP)—are foundational to computational materials science. However, automating these workflows is notoriously difficult.

Standard Large Language Models (LLMs) suffer from hallucinations and lack grounding in strict physical constraints. On the other hand, traditional automated workflow scripts are brittle; they easily break when a calculation fails to converge, a cluster queue times out, or a specific material requires highly specialized parameter adjustments (like adding a $U$ correction for transition metal oxides).

To achieve true autonomy, a scientific agent cannot just output plausible text or make a single tool call. It must act like a human expert: dynamically assembling consistent input files, monitoring long-running cluster jobs, inspecting intermediate outputs, and intelligently recovering from runtime failures.

Methods

The authors introduce VASP Agent, shifting away from rigid, pre-programmed pipelines toward a stateful, iterative execution loop: inspect -> plan -> code -> run -> verify -> recover.

Overview of the VASP Agent framework showing its architecture, parameter selection guardrails, and skill hub accumulation.

Key architectural components include:

  • Coding-Agent-Centered Control: Powered by DeepSeek-V3.2, the agent writes and executes code directly within a live workspace, allowing it to dynamically inspect files and adapt to runtime evidence.
  • Model Context Protocol (MCP): Connects the agent to external tools, web search, and materials databases.
  • Evidence-Grounded Guardrails: Before launching production runs, the agent validates parameters (like plane-wave cutoffs ENCUT and K-point sampling KSPACING) against literature, prior runs, or quick "probe calculations" to balance accuracy and computational cost.
  • Materials Skill Hub: A modular library of 20 reusable, repository-level skill packages (e.g., handling magnetic setups, error recovery, or specific workflow protocols) that can be automatically updated from successful runs or manually authored by experts.

Datasets

VASP Agent was evaluated across four distinct task families representing common materials science challenges:

  1. Structural Relaxation: 40 geometry-optimization tasks containing complex point defects, sourced from the Materials Project database.
  2. Bandgap Calculation: 24 semiconductor tasks spanning narrow to ultra-wide bandgaps, sourced from the Springer Materials database, utilizing a multi-step PBE-to-HSE hybrid functional protocol.
  3. Equilibrium Lattice Constant: 27 elemental crystals (BCC, FCC, diamond) using the expert-calculated Sol27LC dataset as a ground-truth benchmark.
  4. CO/Pt(111) Adsorption: A surface chemistry benchmark evaluating site preferences (fcc vs. ontop) and multi-configuration adsorption energies.

Key Insights and Ideas

  • Smart Deviations over Blind Replication: When VASP Agent's results deviated from standard pymatgen defaults, it wasn't an error—it was a feature. The agent made superior, material-specific modeling choices, such as automatically applying DFT+U for titanium oxides or van der Waals corrections for layered tellurides, proving it can surpass generic automated baselines.
  • Failures as Intermediate States: Traditional pipelines treat electronic non-convergence or malformed inputs as fatal. VASP Agent parses OUTCAR and OSZICAR files mid-run to diagnose the issue, applying conservative parameter revisions (e.g., adjusting smearing or restarting from a stable checkpoint) to guide the calculation to a verified endpoint.
Common workflow failure patterns and the corresponding recovery mechanisms used by VASP Agent.
  • Evaluating the Decision Trace: The authors advocate that scientific AI agents should not be judged solely on final scalar errors, but on the quality and auditability of their executable decision traces.

Key Results

  • 100% Task Completion: VASP Agent successfully completed all cases across all four evaluation datasets. In contrast, fixed LLM-driven workflow baselines (using GPT-5.2, Gemini-3.1-Pro, or Qwen3.5) frequently terminated early due to input mismatches or unrecovered runtime errors.
  • Superior Lattice Constant Accuracy: On the Sol27LC benchmark, VASP Agent achieved a mean relative deviation of 0.374% and a median deviation of 0.258% against human-expert values, significantly outperforming the state-of-the-art DREAMS framework (0.526% mean / 0.542% median).
  • Consistent Surface Chemistry: For the CO/Pt(111) task, the agent correctly identified the fcc upright orientation as the most stable configuration, with adsorption energy differences falling precisely within accepted literature ranges.

Limitations and Future Work

While VASP Agent demonstrates remarkable autonomy, expanding the Materials Skill Hub still partially relies on manual authoring by domain experts to seed complex rules. The authors note that fully automating skill discovery—where the agent independently distills new troubleshooting protocols entirely from its own execution traces—remains an open and promising direction for true end-to-end autonomous scientific discovery.

Summary updated

BibTeX
@misc{xia2025vasp,
  author = {Zeyu Xia and Jinzhe Ma and Congjie Zheng and Zhongyao Wang and Shufei Zhang and Yuqiang Li and Hang Su and P. Hu and Changshui Zhang and Xingao Gong and Wanli Ouyang and Lei Bai and Dongzhan Zhou and Mao Su},
  title = {{VASP Agent: An Agentic Framework for Autonomous First-principles Calculations}},
  year = {2025},
  eprint = {2512.19458},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.19458},
}
Figure