Skip to main content
U.S. Department of Energy
Office of Scientific and Technical Information

RAG for FLAG: AI Assistance for a Physics Code

Technical Report ·
DOI:https://doi.org/10.2172/2588973· OSTI ID:2588973

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.

Research Organization:
Los Alamos National Laboratory (LANL), Los Alamos, NM (United States)
Sponsoring Organization:
USDOE National Nuclear Security Administration (NNSA); USDOE Laboratory Directed Research and Development (LDRD) Program
DOE Contract Number:
89233218CNA000001
OSTI ID:
2588973
Report Number(s):
LA-UR--25-29356
Country of Publication:
United States
Language:
English

Similar Records

Towards a RAG-based summarization for the Electron Ion Collider
Journal Article · Mon Jul 01 00:00:00 EDT 2024 · Journal of Instrumentation · OSTI ID:2578842

Empowering Geothermal Research: The Geothermal Data Repository's New AI Research Assistant
Conference · Sun Jan 26 23:00:00 EST 2025 · OSTI ID:2524000

Lessons Learned from AskGDR: Usage and Impact Analysis of the Geothermal Data Repository's AI Research Assistant: Preprint
Conference · Thu Sep 25 20:00:00 EDT 2025 · OSTI ID:3011807

Related Subjects