How aiforhpc/astraai works
AstraAI is a Linux CLI and GitHub-PR assistant for HPC C++ and Fortran code. Its documented workflow takes a user request, adds retrieval- and AST-derived context for code assistance, then generates or explains a result; a PR watcher also supports requests in GitHub conversations. The repository additionally documents standalone inference and Hugging Face model fine-tuning. Source excerpts show parts of C++ retrieval, code advising and modification, but not the full dispatcher or the Fortran watcher flow, so those connections are not inferred.
Main entry points: astraai.py C++ CLI · rag.py RAG retrieval · pr_watcher.py PR watcher · codemodification.py Code modification
Components 16
Request entry points
- C++ CLI
AstraAI/AstraAI_cpp/astraai.py - PR watcher
AstraAI/AstraAI_fortran/pr_watcher.py
C++ assistance
- Intent routing
AstraAI/AstraAI_cpp/intent.py - Code advising
AstraAI/AstraAI_cpp/codeadvising.py - Code modification
AstraAI/AstraAI_cpp/codemodification.py - Code explaining
AstraAI/AstraAI_cpp/explaining.py
Code context
- C++ AST tools
AstraAI/AstraAI_cpp/ast_cpp.py - RAG retrieval
AstraAI/AstraAI_cpp/rag.py - RAG metadata extraction
RAG
Fortran assistance
- Fortran assistance
AstraAI/AstraAI_fortran - Embedding utility
AstraAI/AstraAI_fortran/embeddings.py
Models and tuning
- Standalone inference
Inference - Ollama LLM access
AstraAI/AstraAI_cpp/llm.py - Model fine-tuning
FineTuning/FineTuning.py
Other components
- CLI user
- GitHub PR
Connections 15
- CLI user → C++ CLI: submits request
README.md - C++ CLI → Intent routing: routes requests
AstraAI/AstraAI_cpp/astraai.py - Code advising → RAG retrieval: builds context
AstraAI/AstraAI_cpp/codeadvising.py - Code modification → RAG retrieval: builds context
AstraAI/AstraAI_cpp/codemodification.py - Code modification → C++ AST tools: queries structure
AstraAI/AstraAI_cpp/codemodification.py - RAG retrieval → Ollama LLM access: embeds query
AstraAI/AstraAI_cpp/rag.py - C++ CLI → C++ AST tools: adds AST context
AstraAI/AstraAI_cpp/astraai.py - C++ CLI → RAG retrieval: adds RAG context
README.md - C++ CLI → Fortran assistance: supports Fortran
README.md - GitHub PR → PR watcher: posts request
- PR watcher → GitHub PR: reads PRs
AstraAI/AstraAI_fortran/pr_watcher.py - PR watcher → Embedding utility: uses embeddings
AstraAI/AstraAI_fortran/pr_watcher.py - CLI user → Standalone inference: runs inference
README.md - CLI user → Model fine-tuning: fine-tunes model
README.md - RAG metadata extraction → RAG retrieval: provides chunks