AutoEnergyDesign: An LLM-Driven Agent for Automatic Energy System Design Optimization
Organizations: Department of Energy Technologies and Renewable Sources, ENEA - 80055 - Portici (NA), Italy
Abstract
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 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.
Figures & tables
| Symbol | Description | Unit |
|---|---|---|
| Design decision vector (technology activation and sizing) | – | |
| Sequence of operational decision vectors over the horizon | – | |
| Time index (hour) | h | |
| Total number of simulation time steps | h | |
| Exogenous electricity demand at time | kW | |
| Exogenous heat demand (space heating + DHW) at time | kW th |
| File | Memory | Written by | Reads | Content |
|---|---|---|---|---|
| CLAUDE.md | procedural | authors | yes | Procedure and rules (Section 4.1.3 ) |
| insights.md | semantic | authors | yes | Energy prices; per technology: efficiency, CAPEX, OPEX, lifetime; replacement and salvage rules |
| config.py | – | agent | yes | Current design, with admissible range and step of each variable in comments |
| .exp_counter , .last_status | episodic | hook | yes | Experiment counter; verdict of the last experiment |
| search_history.md | episodic | hook | yes | All kept designs ranked by NPC and the most recent discarded ones, with reason and difference from the best |
| decisions.md | episodic | agent | yes | One entry per experiment: change, rationale, expected effect, alternatives considered, observed outcome |
| Technology | Variables |
|---|---|
| PV solar | |
| Wind turbine | |
| CHP | |
| Solar thermal | |
| Boiler | |
| Battery |
| Technology | Variable | Min | Max | Step | Levels |
| PV | (m 2 ) | 5.0 | 2000.0 | 5.0 | 400 |
| Wind | (kW) | 1.5 | 25.5 | 1.5 | 17 |
| CHP | (kW) | 5.0 | 100.0 | 5.0 | 20 |
| CHP | (–) | 0.24 | 0.32 | 0.01 | 9 |
| CHP | (–) | 0.50 | 0.58 | 0.01 | 9 |
| Solar thermal | (m 2 ) | 5.0 | 500.0 | 5.0 | 100 |
| Technology | Unit | CAPEX (EUR/unit) | Lifetime (yr) | Replacements |
|---|---|---|---|---|
| PV | m 2 | 121.3 | 40 | 0 |
| Micro Wind | kW | 4,040 | 20 | 1 |
| CHP | kW | 1,010.2 | 25 | 0 |
| Solar Thermal | m 2 | 443 | 30 | 0 |
| Boiler | kW | 158.2 | 25 | 0 |
| Battery | kWh | 180 | 20 | 1 |
| Technology | Unit | OPEX (EUR/unit/yr) |
|---|---|---|
| PV | m 2 | 0.44 |
| Micro Wind | kW | 101 |
| CHP | kW | 10.37 |
| Solar Thermal | m 2 | 2.36 |
| Boiler | (flat) | 692.7 |
| Battery | kWh | 3.60 |
| Variable | Mean | Peak | Minimum | Total (MWh) |
|---|---|---|---|---|
| GHI (W/m 2 ) | 189 | 937 | 0 | – |
| Wind speed (m/s) | 2.2 | 10.4 | 0 | – |
| Air temperature (°C) | 17.6 | 36.9 | 0.6 | – |
| Elec. demand (kW) | 80.0 | 255.4 | 34.8 | 703.1 |
| Heat demand (kW ) | 52.3 | 630.6 | 0 | 459.0 |
| Cool demand (kW ) | 31.5 | 663.6 | 0 | 276.8 |
| Method | Runs | Best | Median | Feasible rate | Evals to 1% of best | Runs at best |
|---|---|---|---|---|---|---|
| Random search | 10 | 3,756,201 | 4,052,571 | 19.8% | 0/10 | 0/10 |
| TPE (Optuna) | 10 | 3,568,489 | 3,596,245 | 70.1% | 0/10 | 0/10 |
| -ES local search | 10 | 3,533,721 | 3,557,264 | 73.3% | 5/10 192 (246) | 0/10 |
| Agent (Claude Haiku 5.5) a | 10 | 3,525,522 | 3,525,947 | 87.6% | 10/10 27.5 (45) | 1/10 |
| Agent (Claude Sonnet 5.5) | 10 | 3,525,522 | 3,525,522 | 89.8% | 8/10 20.5 (30) | 6/10 |
| Agent (Claude Opus 5.5) | 10 | 3,525,522 | 3,525,522 | 89.0% | 10/10 18 (31) | 10/10 |
| Method | NPC [EUR] | PV | Wind | CHP | Solar thermal | Boiler | Battery | Heat pump |
| Baselines | ||||||||
| (1+1)-ES | 3 533 720.84 | 2000 m 2 Inv. 341 kW ( =0.98) | – | – | 265 m 2 | – | 100 kWh / 22.5 kW ( =0.99) Inv. 35 kW ( =0.96) | 700 kW th |
| Random | 3 756 201.26 | 1690 m 2 Inv. 245 kW ( =0.98) | – | – | 345 m 2 | – | 90 kWh / 47.5 kW ( =0.84) Inv. 50 kW ( =0.98) | 700 kW th |
| TPE | 3 568 488.67 | 2000 m 2 Inv. 293 kW ( =0.98) | – | – | 125 m 2 | – | 90 kWh / 30 kW ( =0.98) Inv. 11 kW ( =0.98) | 700 kW th |
| Agents | ||||||||
| Haiku | 3 525 522.24 | 2000 m 2 Inv. 400 kW ( =0.98) | – | 10 kW el =0.32, =0.58 | 260 m 2 | – | 100 kWh / 50 kW ( =0.99) Inv. 50 kW ( =0.98) | 700 kW th |
| Configuration | Runs | Best | Median | Feasible rate | Evals to 1% of best | Runs at best |
|---|---|---|---|---|---|---|
| Opus 5.5 | ||||||
| With insights.md | 10 | 3,525,522 | 3,525,522 | 89.0% | 10/10 18 (31) | 10/10 |
| Without insights.md | 10 | 3,525,522 | 3,525,522 | 90.0% | 8/10 19.5 (46) | 8/10 |
| Haiku 5.5 | ||||||
| With insights.md | 10 | 3,525,522 | 3,525,947 | 87.6% | 10/10 27.5 (45) | 1/10 |
| Without insights.md | 10 | 3,525,522 | 3,525,947 | 89.0% | 9/10 27 (50) | 2/10 |
Large Language Model-Guided Optimization
Large Language Model-Guided Optimization uses language models to propose, steer, and refine solutions to hard search and design problems.
See all 608 papers