Skip to content

How LLM can benefit AiiDA #29

@khsrali

Description

@khsrali

Introduction

LLM tools has been around for a few years now, and they're getting better progressively.
We heard reports from several users, that how LLMs improved their experience with AiiDA, e.g. facilitating writing query builder.

This brought us to take the initiative and go a few steps further.
Below we explored two of such possibilities as proof of concept.

Proof of Concepts

1- verdi-llm
This repo has the full knowledge of AiiDA command line. It was designed as a learning toy for newbies for exploring verdi interface. It's particularly useful, because user only describes in natural language what they'd like to do, and verdi-llm will come with a command resolution, e.g.:

"Delete the working directories of all finished calculation jobs since the last month on cluster1 and cluster2 without asking for confirmation"
Suggests:
verdi calcjob cleanworkdir --past-days 30 --computers cluster1,cluster2 --exit-status 0 --force

In the backend, it uses a RAG database. Mapped and made from the up-to-date developments of verdi interface. This makes even the most outdated and free-to-use LLMs, to return very good results!

2- aiida-mcp
This repo, develops and utilizes an MCP servers for running a phonon workflow in AiiDA. Like verdi-llm is designed to help newbies to walk through several workflow examples that we have. User might simply ask:

"Help me to calculate phonon for silicon using AiiDA"
And it basically does everything:

  • Checks if the prerequisites are met, required packages are installed and codes are defined in AiiDA
  • If not, it installs them for the user and sets up the codes in AiiDA.
  • Asks for all the necessarily inputs, e.g. the structure file, if user doesn't have one it can suggest.
  • Writes an python script to run such calculation and submits to AiiDA, it reports back the PK.
  • Is able to follow up, find out where the outputs are, parse and answers to questions like: "What's the convergence energy"

Requires Discussion

Having this two proof of concepts, we need to think for a moment.
Going further in this direction requires a team decision.

The main doubt is, a lot of these sorta solutions are age(!) specific. Meaning inmatter of months the MCP protocol might change in a way that will require maintenance. Also "hard-coding" a workflow logic in MCPs might not be the best idea. It can also happen that LLMs which are catching up quickly will be able to do these things on their own at half-a-year time. Which then means our efforts might go wasted.

@giovannipizzi @GeigerJ2 @agoscinski

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions