DOE OSTI · 2588973
RAG for FLAG: AI Assistance for a Physics Code
Abstract
Artificial intelligence (AI) has quickly become an important tool in scientific research, where significant efforts are underway to develop tools that will expedite the research process. One area of particular impact is scientific software, which can be particularly complex, and therefore time consuming to learn and use effectively. AI assistants are increasingly helping to streamline the process by performing tasks such as interactively answering user questions or suggesting solutions. Los Alamos National Laboratory (LANL) develops several advanced scientific codes, such as FLAG, which can be used to run multiphysics simulations. With this study, our goal was to develop an AI assistant for FLAG that could help make the process of understanding the software and running physics simulations more efficient. To develop an AI assistant for FLAG, we used a method called retrieval-augmented generation (RAG), which is a technique that uses information from relevant data sources to enhance the accuracy of large language models (LLMs). We used the FLAG user manual and other FLAG documentation as the knowledge base for the RAG system. When a user provides a query, RAG retrieves relevant sections from the knowledge base in response, then uses those excerpts to generate grounded and contextually rich answers. We found that our AI assistant was able to provide context aware answers and source references to user queries. To evaluate performance, we developed a set of 40 benchmark questions and compared the accuracy of the responses to those of two standard LLMs without retrieval. Our AI assistant significantly outperformed the standard LLMs at answering FLAG-related questions, with an 82.5% accuracy rate, compared to 47.5% for both of the standard LLMs. This has the potential to make the process of learning and using FLAG much easier, especially for new users. Ultimately, it supports LANL’s broader mission by empowering scientists and engineers to focus more on discovery and analysis rather than on navigating complex software systems.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Velarde, Rayannon [Los Alamos National Laboratory (LANL), Los Alamos, NM (United States)], Rael, Rosalyn Cherie [Los Alamos National Laboratory (LANL), Los Alamos, NM (United States)] (ORCID:0000000301724716), Casleton, Emily Michele [Los Alamos National Laboratory (LANL), Los Alamos, NM (United States)] (ORCID:0000000329095704). 2025-09-18. RAG for FLAG: AI Assistance for a Physics Code. https://doi.org/10.2172/2588973
Cite the original work for its findings. Save a collection to share your selection of sources.