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

arXiv cs.AI / 3/31/2026

📰 NewsDeveloper Stack & InfrastructureTools & Practical UsageModels & Research

Key Points

  • AstraAIはLinuxターミナル上で動作するCLI型のコーディング支援フレームワークで、HPC向けの複雑な科学計算コードに対して文脈に沿ったコード生成を行います。
  • LLMに対して高精度なプロンプトを構成し、RAGによる関連コード断片の検索とAST(抽象構文木)による構造解析で、関数・データ構造・コード組織を正確に与えます。
  • 生成コードは周辺コードとの構造整合性を保ちながら、スコープを限定したソースコード修正を目指す設計になっています。
  • モデル提供は、Hugging Faceのローカル実行モデルと、American Science Cloud経由で利用可能なAPI型フロンティアモデルの両対応で、HPC環境に合わせた導入柔軟性を提供します。
  • AMReX(DOE支援のエクサスケール向けHPCソフト基盤)を用いた代表的な生成タスクで有効性を示しています。

Abstract

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.