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. To deliver precise contextual information for language model guidance, the multi-stage retrieval pipeline performs parallel searching, concept expansion, community-scale retrieval, and semantic similarity analysis. Code synthesis is governed by Pydantic-based constraints to guarantee structured outputs and reliability. A comprehensive validation framework integrates conventional static analysis with the G-Eval approach, covering execution correctness, structural soundness, mathematical consistency, and API compliance. The overall agent workflow is implemented on the LangGraph framework and adopts concurrent processing to support quality-based iterative refinement and state-aware dynamic routing. The principal contribution lies in the incorporation of feedback mechanisms motivated by reinforcement learning, enabling a transition from static code translation toward dynamic and adaptive analytical behavior.


翻译:为促进遗留有限差分实现向Devito环境的转化,本研究构建了一个集成式AI智能体框架。该系统的混合型LangGraph架构通过多阶段迭代工作流,整合了检索增强生成技术(Retrieval-Augmented Generation, RAG)与开源大语言模型。智能体通过文档解析、结构感知分割、实体关系抽取及基于Leiden算法的社区检测,构建了涵盖地震波模拟、计算流体动力学及性能调优库等语义社区的Devito知识图谱。GraphRAG优化机制提升了跨语义社区的查询性能。逆向工程组件通过对Fortran源代码的静态分析,推导出RAG检索的三级查询策略。多阶段检索管道通过并行搜索、概念扩展、社区级检索及语义相似性分析,为语言模型引导提供精准的上下文信息。基于Pydantic的约束体系保障了代码合成的结构化输出与可靠性。综合验证框架整合了传统静态分析与G-Eval方法,覆盖执行正确性、结构稳健性、数学一致性与API合规性四个维度。整个智能体工作流基于LangGraph框架实现,采用并发处理机制支持质量驱动的迭代优化与状态感知动态路由。本研究的核心贡献在于引入强化学习驱动的反馈机制,使静态代码翻译向动态自适应分析行为转变。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
多智能体协作机制
专知会员服务
23+阅读 · 4月25日
AI 智能体系统:体系架构、应用场景及评估范式
智能体工程(Agent Engineering)
专知会员服务
36+阅读 · 2025年12月31日
《基于Transformer的智能体的战术决策解释》
专知会员服务
47+阅读 · 2025年12月28日
面向人工智能的计算机体系结构
计算机研究与发展
14+阅读 · 2019年6月6日
群体智能:新一代人工智能的重要方向
走向智能论坛
12+阅读 · 2017年8月16日
【强化学习】强化学习+深度学习=人工智能
产业智能官
55+阅读 · 2017年8月11日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2013年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
国家自然科学基金
50+阅读 · 2009年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
Arxiv
0+阅读 · 5月18日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
4+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
6+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
3+阅读 · 6月17日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2013年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
国家自然科学基金
50+阅读 · 2009年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员