Source-linked AI summary
AutoEnergyDesign: An LLM-Driven Agent for Automatic Energy System Design Optimization
Amedeo Buonanno, Salvatore Fabozzi, Maria Valenti
TL;DR
Building energy design couples technology choice, sizing, dispatch, and lifecycle cost, while candidate evaluation requires a year-long simulation. AutoEnergyDesign uses an LLM agent to propose and learn from simulated designs; in the case study, all three models reached the best design, outperforming the reported TPE and evolution-strategy results with fewer simulations.
Problem
Building energy design couples technology choice, capacity sizing, dispatch, and 25-year lifecycle cost, while each candidate requires a year-long simulation.
Source: §2 · p. 5Method
AutoEnergyDesign couples LLM reasoning and structured experimental feedback with explicit memories, techno-economic modeling, and git-based rollback.
Source: §2 · p. 6Results
3.526 MEUR NPC was 1.20% below the best of ten TPE seeds and 0.23% below the best of ten (1 + 1)-ES seeds, with at most 50 simulations per run.
Source: §9 · p. 40Takeaways & Limitations
In the case study, the agents reached competitive solution quality with fewer simulator evaluations and recorded traceable decisions.
Source: §9 · p. 39The results cover one case study, one climate and tariff structure, a single-objective NPC formulation, and one model family and coding agent.
Source: §9 · p. 39
Abstract
from arXiv · showhide
Designing building energy systems is a high-dimensional, mixed-integer search problem: when each design is evaluated by a year-long simulation, black-box optimizers typically need hundreds of evaluations. This paper presents AutoEnergyDesign, a framework in which a Large Language Model (LLM) agent reasons over previous simulation results, proposes configuration changes and learns in context from each outcome, while a git-based mechanism automatically reverts unsuccessful changes. The agent couples a reasoning model with an explicit memory organisation (procedural, semantic, episodic and reflective), a constrained action interface and an environment-grounded keep/revert signal. The simulator covers eight technologies (photovoltaics, micro-wind, combined heat and power, solar thermal, gas boilers, batteries, heat pumps and inverters) and computes the 25-year Net Present Cost (NPC), including capital and operating costs and salvage value. On a case study with measured building load profiles, the agent, run with Claude Haiku 5.5, Sonnet 5.5 and Opus 5.5 (ten runs of 50 simulations each), is compared with random search, Tree-structured Parzen Estimator (TPE) Bayesian optimization and a $(1+1)$ evolution strategy sharing the agent's acceptance rule (300 evaluations, ten seeds). With all three models the agent reaches an NPC of about 3.53 MEUR, 1.20% below the best TPE result and 0.23% below the best evolution-strategy result. It comes within 1% of this design after a median of 18 (Opus) to 27.5 (Haiku) simulations, whereas among the baselines only the evolution strategy does so, in half of its seeds and after a median of 192 evaluations. Opus reaches the best design in all ten runs, Sonnet in six (two runs never come within 1%), and Haiku comes within 1% in every run but reaches it exactly only once. Every decision is recorded in an auditable trace.
1 Nomenclature
The nomenclature defines the model’s variables and symbols, including technology activation, sizing, performance, dispatch, and economic quantities.
Technology variables
- Binary activation variables identify whether wind, CHP, solar-thermal, boiler, battery, or heat-pump technologies are selected.The table also names installed PV area, wind-turbine power, and solar-thermal area.Source: §1 · p. 3
Performance and resource variables
- Technology-performance and resource variables describe quantities such as battery capacity, inverter power, heat-pump output, irradiance, and wind speed.Other symbols cover PV, wind, CHP, and solar-thermal outputs and efficiencies.Source: §1 · p. 3
Dispatch and economic variables
- Dispatch and economic symbols cover energy flows, component costs, replacement and salvage value, and total discounted life-cycle cost (NPC).The formulation also defines the analysis horizon, discount rate, and present-value factors.Source: §1 · pp. 3–4
2 INTRODUCTION 5
These symbols define selected quantities used for grid consumption, economic salvage, and search bookkeeping.
Economic quantities
- Annual grid import and total electrical consumption are represented alongside the discounted salvage value of each technology.The salvage value is residual value at the end of year N.Source: §2 · p. 5
Search bookkeeping
- Search-budget symbols count simulator calls, experiments between reflective synthesis turns, and recent discarded designs.The glossary also distinguishes each proposed design from the best valid design after experiment k.Source: §2 · p. 5
Search and evaluation metrics
- The search glossary defines the best NPC found, the relative tolerance for counting near-optimal evaluations, and the evolution strategy’s mutation step.It also names the initial mutation-step value.Source: §2 · p. 5
2 Introduction
The paper frames building energy design as a costly, coupled optimization problem and positions an auditable LLM agent as a direct search approach. It reviews conventional and LLM-based work before identifying gaps in traceability, domain-knowledge integration, and practitioner accessibility.
2 Introduction
- AutoEnergyDesign targets costly, high-dimensional mixed-integer design, where technology choice, sizing, dispatch, and 25-year NPC are coupled.Each candidate requires a year-long simulation.Source: §2 · p. 5
3.1 Classical Approaches to Energy System Optimization
- Classical optimization spans exact MIP formulations, metaheuristics, and TPE, but practical use can involve expensive evaluations, tuning, weak traceability, or tailored feasibility handling.These methods can struggle with realistic nonlinear, multimodal, simulation-driven settings.Source: §3.1 · p. 7
3.2 Large Language Models in Building Energy Applications
- Building-energy LLM studies mainly address model generation or operational tasks, leaving design-phase technology selection and sizing comparatively unexplored.Prior work also reports LLMs driving exact solvers through structured interfaces for operational decision-making.Source: §3.2 · pp. 7–8
3.3 LLM-Driven Optimization Paradigms
- LLM optimizers range from iterative candidate proposal to solver delegation and code evolution, while engineering design under explicit techno-economic constraints remains uncommon.AutoEnergyDesign searches the constrained design space directly with persistent memory and git-based rollback.Source: §3.3 · pp. 8–10
3.4 Identified Gaps and Research Opportunities
- The identified gaps are limited traceability, weak integration of qualitative domain knowledge, and the expertise required to use advanced optimization tools.The paper specifically notes a need for workflows accessible to energy engineers without deep optimization expertise.Source: §3.4 · p. 10
3.5 Positioning of This Work
- The framework records experiment rationales and outcomes, separates procedural instructions from editable domain knowledge, and uses git-based rollback to preserve known-good configurations.The state-management layer is enforced by the environment rather than left to the model.Source: §3.5 · pp. 10–11
- The authors position the work as the first, to their knowledge, to apply an LLM optimizer to design-phase selection and sizing with eight technologies and a 25-year NPC horizon.The case study uses linear-programming dispatch as a controlled evaluation environment; it does not establish superiority to an exact solver.Source: §3.5 · p. 11
4 Methodology
The methodology describes AutoEnergyDesign’s LLM agent loop, validation and keep/revert process, and year-long simulation of energy-system designs. It covers the design and dispatch problem, technology models, lifecycle Net Present Cost assumptions and calculation, and secondary indicators.
4.1 Agent Architecture
- Following AutoResearch, the LLM operates inside Claude Code, editing a configuration file and using simulation results to choose subsequent experiments.The simulator, validator, acceptance rule, and logs are ordinary scripts and files.Source: §4.1 · p. 12
4.1.1 Overview of the Loop
- Each run includes 50 agent experiments after a default-design simulation; hooks validate proposals before execution and then commit kept designs or restore rejected ones.The loop reads state files, logs the previous outcome, refreshes a reflective note every four experiments, records a decision, edits the configuration, and runs the simulator. The pre-execution hook blocks invalid configurations without consuming an evaluation.Source: §4.1.1 · pp. 12–13
4.1.2 Files and Memory
- The agent’s memory separates reliable environment-written state from its own reasoning, using reflective notes for lessons and a decision log to record predictions before outcomes.The reflective note tracks worked and failed changes, behavioral patterns, and next experiments; the search history is a compact, lossy summary of designs.Source: §4.1.2 · pp. 13–14
4.1.3 Instructions and Domain Knowledge
- The instruction file limits edits and prescribes staged, small parameter changes, while domain knowledge provides simulator inputs but no technology rankings or design guidance.File-access rules are a convention checked afterward, whereas the pre-execution hook enforces the design space regardless of model behavior.Source: §4.1.3 · p. 15
4.1.4 Acceptance Rule and State Management
- A proposed design replaces the current best only when feasible and strictly cheaper; git commits and reverts preserve the best configuration and a reproducible record of every trial.The default configuration is infeasible, and the first feasible design is kept; trial outcomes and parameter vectors are recorded in results.tsv.Source: §4.1.4 · pp. 15–16
4.2.1 Problem Formulation
- The PyPSA-based simulator optimizes design and hourly dispatch to minimize lifecycle NPC while meeting demand, with unserved energy penalized and zero annual unserved energy required for feasibility.The design variables represent technology activation and sizing; dispatch includes operation, storage charging and discharging, and grid imports and exports.Source: §4.2 · p. 16, §4.2.1 · pp. 16–17
4.2.2 Technology Models
- The simulator models eight technologies, including generation, conversion, storage, and dedicated inverters; its reversible heat pump has fixed COP 3.5 and EER 3.0 and shares capacity between heating and cooling.Wind output uses a power curve at a fixed 10 m hub height, and simultaneous heat-pump heating and cooling are constrained by its rated power.Source: §4.2.2 · pp. 18, 19, 21
4.2.3 Net Present Cost Calculation
- NPC sums discounted lifecycle costs over 25 years using a 4% discount rate, with an annuity present-value factor of approximately 15.62 and discounted replacement costs for shorter-lived technologies.A component with a 20-year lifetime is replaced once during the 25-year horizon, while a component lasting at least the full horizon is not replaced.Source: §4.2.3 · p. 22
- NPC credits equipment residual value and excludes decommissioning costs, while assuming first-year variable operating costs repeat in real terms across the 25-year horizon.The assumptions exclude load growth, efficiency degradation, and tariff evolution.Source: §4.2.3 · pp. 22, 24
4.2.4 Optimal Dispatch Formulation
- The annual dispatch linear program minimizes variable operating cost under demand and equipment constraints, penalizing unserved energy to ensure a finite optimum for every design.It is solved over all hours of the year.Source: §4.2.4 · pp. 24–25
4.2.5 Reported Metrics and Optional Constraints
- Two secondary indicators are logged but not optimized; one is an annual carbon footprint that aggregates grid imports and additional terms.The supplied passage does not specify the additional terms.Source: §4.2.5 · p. 25
5 CASE STUDY 26
The case study reports emissions factors and electrical self-sufficiency, and defines feasibility through demand service and validation criteria. Its feasible-rate metric counts only configurations whose dispatch serves all demand.
- Grid electricity and natural gas use emission factors of 0.400 kgCO2/kWh and 0.202 kgCO2/kWh, respectively; electrical self-sufficiency is reported as 1 − Eimport.Electrical consumption includes heat-pump operation in both heating and cooling modes.Source: §5 · p. 26
- Trials are discarded for out-of-range or invalid designs, simulation or solver failure, non-zero unserved energy above ε = 10−3 kWh, or NPC no better than the current best.These outcomes are labeled out_of_range, crash, infeasible, and worse, respectively.Source: §5 · p. 26
- The feasible rate counts only configurations whose dispatch serves all demand; it excludes pre-execution validator rejections and, for agents, the automatic baseline evaluation.A feasible design has zero unserved energy under criterion 3.Source: §5 · p. 26
5 Case Study
The case study uses measured profiles for an office building in Naples, with weekday HVAC and domestic hot-water schedules. Its techno-economic assumptions define this evaluation scenario, while the framework is presented as transferable without structural modifications.
5 Case Study
- Measured office-building profiles represent Naples, with weekday HVAC active 07:00–18:00 and domestic hot water drawn 08:00–17:00.The schedule includes early-morning pre-conditioning.Source: §5 · p. 26
5.1 Scenario Assumptions
- Investment costs, component lifetimes, replacement timing, and fixed operating costs define this case-study scenario; the framework can transfer without structural modifications to other markets and assumptions.Source: §5.1 · p. 26
5 CASE STUDY 27
The case study uses flat energy tariffs and measured building-load and weather profiles, with thermal end uses estimated from an electrical load that is not separately metered.
5 CASE STUDY 27
- 0.30 EUR/kWh for electricity purchases, 0.12 EUR/kWh for gas, and 0.08 EUR/kWh for exports are treated as flat tariffs, removing battery arbitrage value.Under these assumptions, a battery can be justified only by self-consumption, through the 0.22 EUR/kWh purchase-export spread.Source: §5 · p. 27
5.2 Consumption and Weather Data
- The profiles use measured hourly electricity consumption and weather observations from 2024, totaling 8,784 hourly samples including 29 February.Weather inputs are hourly irradiance, air temperature, and wind speed from Open-Meteo reanalysis for the site coordinates.Source: §5.2 · pp. 27–28
- Because the measured electrical load does not separately meter heating, cooling, or domestic hot water, their hourly shares are estimated and capped to preserve a baseline of pure electrical use.Heating and cooling shapes use degree-hours with 20 °C and 22 °C base temperatures, respectively; their base temperatures do not overlap, while DHW can coincide with cooling.Source: §5.2 · p. 28
6 Experiments
The experiments compare the agent with three black-box search baselines under a shared simulation and feasibility protocol. They use a 50-experiment agent budget and 300 evaluations per baseline seed.
6.1 Experimental Setup
- The agent runs ten times per model with a 50-experiment budget, while each baseline receives 300 evaluations per seed over ten seeds under a common simulation environment and objective.All runs start from a heat-pump-only configuration; the default is simulated separately and excluded from the agent budget and statistics.Source: §6.1 · p. 30
- The study measures the first evaluation at which a run's best feasible NPC is within 1% of NPC⋆, reporting the reaching fraction and evaluation counts among reaching runs.NPC⋆ denotes the best design found in the study.Source: §6.1 · p. 30
6.2.1 Random Search
- Random search samples admissible configurations uniformly without using prior evaluations, and unlike the agent is not filtered by the pre-execution validator.Thus, infeasible designs without a thermal source are simulated and count toward its evaluations.Source: §6.2.1 · p. 31
6.2.2 Bayesian Optimization with TPE
- TPE separates past observations into relatively good and bad regions, then selects candidates by maximizing expected improvement under its density-based representation.The implementation uses Optuna's standard TPE sampler.Source: §6.2.2 · p. 31
6.2.3 Local Search with a (1 + 1) Evolution Strategy
- The (1 + 1) evolution strategy retains the agent's hill-climbing acceptance rule but replaces the language model's move choice with random perturbations of one to three active genes.Its quantized design vector contains seven activation flags and 18 continuous-variable grid indices; step size adapts using the 1/5 success rule.Source: §6.2.3 · pp. 31–32
7 Results
Across the case study, the agent reaches the best observed NPC with fewer evaluations than the baselines, while performance and search consistency vary by model. The results also compare resulting designs, test the domain-knowledge file, and examine reasoning traces.
7.1 Baselines
- The evolution strategy had the strongest baseline results: median NPC 3.557 MEUR, best seed 3.534 MEUR, and 73.3% feasible evaluations; random search and TPE never reached the 1% band.Random search’s median final NPC was 4.053 MEUR; the TPE median was 3.596 MEUR.Source: §7.1 · pp. 32–33, Table 8 · p. 33
7.2 Agent
- All three models found the best NPC of 3,525,522 EUR; the agent reached the 1% band in 28 of 30 runs, versus five of ten evolution-strategy seeds.Among runs reaching the band, the agent’s median was 18–27.5 evaluations, versus 192 for the evolution strategy.Source: §7.2 · pp. 33–34, Table 8 · p. 33
7.3 Resulting designs
- The best design combines a 700 kWth reversible heat pump, 2,000 m2 of PV, a 100 kWh battery, 260 m2 of solar thermal, and 10 kWel CHP, with no boiler or wind turbine.All ten Opus runs, six Sonnet runs, and one Haiku run found this configuration.Source: §7.3 · p. 34, Table 9 · p. 34
- The best design reaches active upper bounds for PV area and battery size; its PV inverter rating is degenerate above about 340 kW, and all conversion efficiencies are at their upper bounds.Under the flat tariff, the battery is valued through self-consumption; exported energy earns 0.08 EUR/kWh versus 0.30 EUR/kWh for purchased energy.Source: §7.3 · p. 35
7.4 Ablation: Removing the Domain-Knowledge File
- Without insights.md, Opus still found the best NPC and had a similar 1%-band median of 19.5 evaluations versus 18 with the file; Haiku’s final values were also the same.Haiku’s median was 27 evaluations without the file versus 27.5 with it.Source: §7.4 · p. 36
- The domain-knowledge file appears to reduce run-to-run variability, especially for Opus, while its effect on Haiku’s interquartile range is weaker and non-uniform.For Opus, the range stays about 120 kEUR until simulation 35 without the file, while it narrows earlier with the file and closes after about 30 simulations.Source: §7.4 · p. 37
7.5 Qualitative Analysis of the Reasoning Traces
- Across the reported experiments, rule compliance was generally high, though some experiments changed four or more parameters and one Opus run repeated a rejected configuration.The multi-parameter changes all accompanied switching on a technology; unchanged configurations were recognized and not recorded by the post-execution hook.Source: §7.5 · p. 37
- In two trapped Sonnet runs, the agent attributed a 2.3 kWh cooling shortfall to the cooling peak and concluded that a 750 kW heat pump was insufficient, without retesting after adding other heat sources.The shortfall instead arose from coincident cooling and hot-water demand; Opus retested the 700 kW heat pump once other sources were in place.Source: §7.5 · p. 37
8 DISCUSSION 38
The qualitative analysis describes reasoning errors in Haiku runs, including mistaken attribution of feasibility and convergence while better designs remained.
8 DISCUSSION 38
- Haiku sometimes discarded CHP after testing it only at default efficiencies and credited the battery with making a 700 kW heat pump feasible.Source: §8 · p. 38
- Haiku frequently declared convergence while a better design still existed.Source: §8 · p. 38
- The reported errors resemble the Sonnet runs that failed to retest a 700 kW heat pump after adding other heat sources.Source: §8 · p. 38
8 Discussion
In the case study, the agent reached the 1% band with fewer simulations than the baselines, while model choice affected search reliability and speed. Its decision records are reproducible, though their explanations are not always correct.
Search performance
- The agent reached the 1% band after a median of 18–27.5 simulations across runs that reached it, versus 192 evaluations for the (1 + 1)-ES in five of ten seeds; TPE and random search never reached it.The agent and evolution strategy shared the acceptance rule, but the agent used coordinated moves informed by simulator cost breakdowns and design knowledge.Source: §8 · p. 38
Model reliability
- Opus reached the best design in all ten runs, Sonnet in six, and Haiku in one; two Sonnet runs never entered the 1% band.Those Sonnet runs retained an early conclusion without retesting it; because the acceptance rule does not return to a worse design, correction depends on the agent choosing to test it.Source: §8 · p. 38
Traceability
- Every configuration, outcome, and decision is logged and reproducible, but the recorded explanations are not always correct.The notes include predictions written before outcomes are known.Source: §8 · p. 38
9 CONCLUSIONS 39
The agent reduces simulator calls and wall-clock time in this case study, but its monetary cost is not lower than the baselines. The reported evidence is limited in scope, and the paper identifies extensions for broader exploration and evaluation.
Computational cost
- The agent's smaller number of simulations reduces total cost only when one simulation is considerably more expensive than a language-model call.In this case study, the agent was not cheaper in monetary terms, though its 11–17 minute runs were shorter than a 35-minute baseline seed.Source: §9 · p. 39
Limitations
- The results cover one case study, climate, tariff structure, single-objective NPC formulation, model family, and coding agent.The experiments also cannot separate behavior learned during model training from reasoning on observed results.Source: §9 · p. 39
Future directions
- Proposed extensions include allowing temporary NPC worsening, multi-objective formulations, and evaluating other models and agent harnesses.Source: §9 · p. 39
9 Conclusions
AutoEnergyDesign combines LLM reasoning, structured memories, techno-economic modeling, and git-based state management for building energy design optimization. In the case study, all three models found the best design with at most 50 simulations per run, while the agent's decision traces make its search auditable.
Contributions
- The framework combines an LLM optimization architecture organized around explicit memories, detailed techno-economic modeling, git-based state management, and empirical comparison with baselines.Source: §9 · p. 39
Conclusion
- The results indicate competitive solution quality with substantially fewer simulator evaluations and traceability that is difficult to obtain from conventional black-box methods alone.Source: §9 · p. 39
Results
- NPC was about 3.526 MEUR, 1.20% below the best of ten TPE seeds and 0.23% below the best of ten (1 + 1)-ES seeds, with at most 50 simulations per run.Opus reached the best design in all ten runs; Sonnet in six, while two never came within 1%; Haiku reached it exactly once and came within 1% in every run.Source: §9 · p. 40