AstraAI: LLMs, Retrieval, and AST-Guided Assistance for HPC Codebases

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Natarajan, Mahesh, Li, Xiaoye, Zhang, Weiqun
Format: Preprint
Publié: 2026
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866918414884274176
author Natarajan, Mahesh
Li, Xiaoye
Zhang, Weiqun
author_facet Natarajan, Mahesh
Li, Xiaoye
Zhang, Weiqun
contents We present AstraAI, a command-line interface (CLI) coding framework for high-performance computing (HPC) software development. AstraAI operates directly within a Linux terminal and integrates large language models (LLMs) with Retrieval-Augmented Generation (RAG) and Abstract Syntax Tree (AST)-based structural analysis to enable context-aware code generation for complex scientific codebases. The central idea is to construct a high-fidelity prompt that is passed to the LLM for inference. This prompt augments the user request with relevant code snippets retrieved from the underlying framework codebase via RAG and structural context extracted from AST analysis, providing the model with precise information about relevant functions, data structures, and overall code organization. The framework is designed to perform scoped modifications to source code while preserving structural consistency with the surrounding code. AstraAI supports both locally hosted models from Hugging Face and API-based frontier models accessible via the American Science Cloud, enabling flexible deployment across HPC environments. The system generates code that aligns with existing project structures and programming patterns. We demonstrate AstraAI on representative HPC code generation tasks within AMReX, a DOE-supported HPC software infrastructure for exascale applications.
format Preprint
id arxiv_https___arxiv_org_abs_2603_27423
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle AstraAI: LLMs, Retrieval, and AST-Guided Assistance for HPC Codebases
Natarajan, Mahesh
Li, Xiaoye
Zhang, Weiqun
Artificial Intelligence
Software Engineering
We present AstraAI, a command-line interface (CLI) coding framework for high-performance computing (HPC) software development. AstraAI operates directly within a Linux terminal and integrates large language models (LLMs) with Retrieval-Augmented Generation (RAG) and Abstract Syntax Tree (AST)-based structural analysis to enable context-aware code generation for complex scientific codebases. The central idea is to construct a high-fidelity prompt that is passed to the LLM for inference. This prompt augments the user request with relevant code snippets retrieved from the underlying framework codebase via RAG and structural context extracted from AST analysis, providing the model with precise information about relevant functions, data structures, and overall code organization. The framework is designed to perform scoped modifications to source code while preserving structural consistency with the surrounding code. AstraAI supports both locally hosted models from Hugging Face and API-based frontier models accessible via the American Science Cloud, enabling flexible deployment across HPC environments. The system generates code that aligns with existing project structures and programming patterns. We demonstrate AstraAI on representative HPC code generation tasks within AMReX, a DOE-supported HPC software infrastructure for exascale applications.
title AstraAI: LLMs, Retrieval, and AST-Guided Assistance for HPC Codebases
topic Artificial Intelligence
Software Engineering
url https://arxiv.org/abs/2603.27423