A Paper-to-Code Agentic Framework for Energy Communities for Data-Driven Decision Support using LLMs as Scientific Translators rather than Generative Approximators
Abstract
The complexity of Energy Communities (ECs) and the growing body of scientific literature on energy sharing (ES), value sharing (VS) and local electricity market (LEM) mechanisms create a significant gap between theoretical model development in the scientific papers and practical implementation. To address it, our paper proposes a Paper-to-Code agentic framework for ECs that translates peer-reviewed scientific literature into executable models for data-driven decision support. Paper-to-Code integrates LLMs, vector-based knowledge retrieval and expert supervision to formalize ES/VS/LEM described in publications into validated specifications, pseudocode and modular code implementations. These models are applied to the EC datasets through an agent-based simulation environment, where community-specific objectives such as cost minimization, self-consumption maximization and grid dependence reduction are evaluated. By coupling automated knowledge extraction with expert-in-the-loop validation and operational simulation, Paper-to-Code ensures traceability and reproducibility. The framework enables ECs to benchmark alternative operational and market strategies under identical data conditions, bridging the gap between research and digital solutions for EC decision-making. Across 200 scientific papers, 3 EC test cases, 100 profiling conversations and 30 expert-evaluated simulations, the framework achieved: near-perfect grounding (≈0.97–1.00), high algorithm preservation (≥0.96), ≥95% profiling and recommendation consistency, expert validation (≈9/10 usefulness).
Fields of Study & Subjects
Smart Grid Energy Management
Integrated Energy Systems Optimization
Microgrid Control and Optimization
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 23 January 2026