AI Agent for Reverse-Engineering Legacy Finite-Difference Code and Translating to Devito 文章

ArXiv CS.AI2026-05-27NEWSen作者: Yinghan Hou, Zongyou Yang

摘要

arXiv:2601.18381v2 Announce Type: replace Abstract: To facilitate the transformation of legacy finite difference implementations into the Devito environment, this study develops an integrated AI agent framework. Retrieval-Augmented Generation (RAG) and open-source Large Language Models are combined through multi-stage iterative workflows in the system's hybrid LangGraph architecture. The agent constructs an extensive Devito knowledge graph through document parsing, structure-aware segmentation, extraction of entity relationships, and Leiden-based community detection. GraphRAG optimisation enhances query performance across semantic communities that include seismic wave simulation, computational fluid dynamics, and performance tuning libraries. A reverse engineering component derives three-level query strategies for RAG retrieval through static analysis of Fortran source code.