The problem
Water distribution networks need many model runs for planning and management, but traditional modelling demands complex workflows and specialized expertise. EPANET is the most widely adopted tool for network hydraulics and water-quality simulation, yet its operational complexity restricts accessibility and slows timely decision-making.
The idea
EPANET-Agentic replaces conventional EPANET interfaces and ad-hoc scripts with a natural-language control layer. An engineer types a task in plain English; an LLM orchestrator plans it, delegates to specialised agents that run the EPANET/WNTR code, and interprets the results. The system targets practitioners — system operators, field technicians, and practising engineers doing routine analyses. A human-in-the-loop step approves every agent invocation.
- Autonomous, natural-language-driven control of WDN simulations.
- A multi-agent system: one orchestrator plus three specialised agents.
- Accurate control and full task completion across diverse hydraulic tasks.
- Scalable, interpretable, automation-ready WDN management.
At a glance
- Engine / library
- EPANET via the WNTR Python library
- Pattern
- Orchestrator + 3 nested tool-agents
- LLMs used
- DeepSeek-V3, DeepSeek-R1, Qwen-VL-Max
- Oversight
- Human approval per invocation
- Benchmarks
- L-Town, C-Town, Net3
- Tasks tested
- 39 (across 4 categories)
- Headline result
- 100% success & tool accuracy, 0 interventions
Orchestrator-centred, tool-driven nested design
Each sub-agent is exposed as a callable tool with a unique name and a typed input schema. At run time the Orchestrator picks the next agent and invokes it with a function call supplying only that agent's required parameters; the callee runs its encapsulated logic and returns structured output. The typed contracts make the workflow flexible yet reproducible and auditable.
Why "nested tools" beats hardwiring
Decomposing tasks into typed tool calls cuts reliance on long conversational context, reducing context overflow and hallucination. New tools or agents can be added without retraining the models.
Human-in-the-loop
Every tool or sub-agent invocation requires explicit user approval, so no physically invalid hydraulic computation proceeds unchecked. In the benchmarks, zero interventions beyond routine approval were needed.
No fabricated numbers
A strict system message forbids the LLM from inventing numerical results. All hydraulic values must come from WNTR Python functions, enforcing EPANET's physical constraints.
Agent Lab — run the architecture on the real Net3
mode: detecting…The actual Net3 benchmark from the paper (WNTR's Net3.inp: 92 junctions, 117 pipes) is embedded below, with a registered tool layer. Inside Claude, the agents are live LLM calls following the paper's four-role design; elsewhere the Lab replays traces computed from the same tools. Either way, every number comes from the tools — never the model — exactly as the paper requires.
🕘 Past runs (0) — newest first · clear history
The ⚠ chip runs an intentionally unstable synthetic SWMM5 result so the continuity gate can refuse it — a deterministic code check, not LLM judgment. That is the Surcharge Detective pattern from the Parallel Work tab, live.
Benchmark networks (Table 2)
Three EPANET networks of increasing size were used. 39 tasks total: 11 Characteristics, 11 Dynamics, 8 Operation, 9 Scenario.
| Network | Reservoirs | Junctions | Tanks | Pipes | Pumps | Valves | Duration (h) | Step (min) |
|---|---|---|---|---|---|---|---|---|
| L-Town | 2 | 782 | 1 | 905 | 1 | 3 | 168 | 5 |
| C-Town | 1 | 388 | 7 | 429 | 11 | 4 | 24 | 5 |
| Net3 | 2 | 92 | 3 | 117 | 2 | 0 | 24 | 60 |
Notable findings
- The multimodal DataAnalyzer detected a pressure-uniformity gain after a diameter change by reading two near-identical plots — the pressure coefficient of variation fell from 0.18093 to 0.18073, a difference hard for humans to spot.
- Code attempts stayed below 2 per task; System Characteristics needed as few as 0.9 (C-Town), since the initial .inp check often sufficed. System Dynamics peaked at 1.7.
- A Semantic Stress Test (no punctuation, missing sentence, reordered wording) held 100% success and tool accuracy; only code-attempt counts wobbled (1.4 for the missing-sentence variant).
Where it can hallucinate
Failures appeared only when domain terms were missing from an agent's prompt:
- Without a definition of SETPOINT, TaskExecutor wrongly used the CONCEN method.
- Lacking knowledge of wntr.graphics.plot_network, CodeRunner fell back to matplotlib and produced blank images despite error-free execution.
The fix the authors emphasise: precise system prompts and tool descriptions, plus retrieval-augmented context in future versions.
SWMM5-Agentic — the adaptation paper
The EPANET-Agentic architecture re-cast for EPA SWMM5 urban-drainage / wastewater modelling, written as a markdown paper. The authors themselves name sewer networks and urban drainage as a future direction.
Agentic SWMM: the first peer-reviewed agentic workflow built on the SWMM5 engine.
Exeter published the pressurized-pipe half of this story in January. Zhang and Valeo at the University of Victoria published the runoff half on June 9: a SWMM-specialized runtime called aiswmm that wraps EPA SWMM 5.2.4 in Agent Skills and MCP servers, then proves the whole chain with SHA-256 hashes. 60 paired CLI/MCP runs, byte-identical output files, R² and NSE exactly 1.0. The LLM plans. Deterministic Python computes. The hash is the referee.
Skills, not code-writing agents
Exeter's CodeRunner writes WNTR Python at run time. Victoria refuses that risk: the runtime executes pre-written, schema-validated Skill scripts and never code the LLM improvised a moment ago. The audit demo below shows exactly what an ad-hoc script costs.
Verification-first contract
Every run writes manifest.json and experiment_provenance.json: SHA-256 of every INP, RPT, and OUT, both continuity errors, eight SWMM screening rules, Git commit, and a human-decision slot. Provenance is mandatory, not a logging option.
Same conclusion as the Agent Lab
Their gates are deterministic code checks, not LLM judgment. The continuity refusal you can trigger in the Agent Lab ⚡ is the same philosophy; Victoria extends it all the way down to byte identity.
Six layers, one audit rail
Figure 1 of the paper, made walkable. Click a layer to see what lives there.
- ✔ SWMM GUI ↔ Agentic SWMM equivalence
- ✔ SWMM CLI ↔ SWMM MCP byte identity
- ✔ GIS / DEM preprocessing consistency
- ✔ Auditable provenances on every run
Three levels of proof
Tod Creek watershed outlet (node O1), 25 May 1984 Chicago design storm, 5-minute timestep.
The two sweeps vary Chicago-storm shape r ∈ [0.30, 0.50] and imperviousness ×[0.9, 1.1]. Because equivalence holds at the byte level, the conclusion does not depend on the exact parameter values. The core modules were also validated on three external benchmarks: the Tecnopolo January-1994 case, the TUFLOW–SWMM Module 03 coupled benchmark, and a Generate_SWMM_inp adapter case.
The audit chain, live
A deterministic code check, not LLM judgment. The baseline below is the paper's r = 0.40 run; the hash prefixes are the actual values from Figures 6 and 7. Re-run it three ways and watch what the provenance files catch.
OUT SHA-256 90d2e4bb… · Qpeak 3.366 m³/s @ node O1 · manifest.json written
The six MCP tools exercised in the paper
| Tool | Server | Does |
|---|---|---|
| qgis_package_final_layers | swmm-gis-mcp | DEM → subcatchments, flow paths, slope, outfall |
| swmm_run | swmm-runner-mcp | Runs swmm5, writes RPT/OUT/log + manifest |
| swmm_peak | swmm-runner-mcp | Peak from the Node Inflow Summary |
| swmm_continuity | swmm-runner-mcp | Runoff + routing mass-balance tables |
| swmm_compare | swmm-runner-mcp | Headline continuity across two RPTs |
| plot_rain_runoff_si | swmm-plot-mcp | Publication-grade rain/runoff PNG to spec |
Representative Skills (4 of 14)
Three roads to gated, natural-language hydraulics
Two of these columns are now peer-reviewed. The third is the ICM-Agent system from the Parallel Work ★ tab, built in the field over the same period.
| EPANET-Agentic (Exeter, Jan 2026) | Agentic SWMM (UVic, Jun 2026) | ICM-Agent (Dickinson, 2024–26) | |
|---|---|---|---|
| Domain | Pressurized distribution networks (Net3 and larger) | Rural stormwater runoff: Tod Creek, 17 km², 27 m DEM | Urban free-surface drainage: InfoWorks ICM + SWMM5 dynamic wave |
| Who computes | LLM agents write and run WNTR Python at run time | Pre-written Skill scripts; the runtime never executes LLM-improvised code | 440+ curated Ruby scripts against the ICM Exchange API |
| Human gate | Approval before every agent invocation | Five-layer rule system: parameters may auto-fill; file paths and hydrological judgment always defer | Transaction-gated workgroup commit |
| Proof | Benchmark accuracy plus a "no fabricated numbers" system rule | SHA-256 byte identity, 60/60 pairs; mandatory provenance on every run | Deterministic continuity gate refuses unstable dynamic-wave runs |
The convergence is the story. Three groups, working separately on three engines, all landed on the same shape: the LLM orchestrates, deterministic code computes, and a gate the LLM cannot talk its way past decides what enters the record.
Read the paper
All 19 pages of the open-access Technical Note (CC BY), rendered page by page.
© Zhang & Valeo, AI for Engineering 1(1):5 (2026), doi 10.3390/aieng1010005. Open access under the Creative Commons Attribution (CC BY) licence — reproduced here under those terms.
How to cite Agentic SWMM
Zhang, Z., & Valeo, C. (2026). Agentic SWMM: Auditable and reproducible stormwater modelling workflow with Agent Skills and Model Context Protocol.
AI for Engineering, 1(1), 5. Received 18 Mar 2026; accepted 3 Jun 2026; published 9 Jun 2026.
DOI: 10.3390/aieng1010005
@article{Zhang2026AgenticSWMM,
author = {Zhang, Zhonghao and Valeo, Caterina},
title = {Agentic SWMM: Auditable and Reproducible Stormwater
Modelling Workflow with Agent Skills and Model Context Protocol},
journal = {AI for Engineering},
volume = {1},
number = {1},
pages = {5},
year = {2026},
doi = {10.3390/aieng1010005},
url = {https://doi.org/10.3390/aieng1010005}
}
Zhang, Z., & Valeo, C. (2026). Agentic SWMM: Auditable and reproducible stormwater modelling workflow with Agent Skills and Model Context Protocol. AI for Engineering, 1(1), 5. https://doi.org/10.3390/aieng1010005
The field just published, in Water Research, the architecture I'd been building by hand for eighteen months.
EPANET-Agentic (Jan 2026) formalizes an orchestrator that turns natural language into hydraulic sub-tasks, writes and runs the simulation code, interprets the output, and keeps a human in the loop. That is the same shape as the ICM-Agent three-tier system I built independently for InfoWorks ICM and SWMM5 over the same period — natural language → Ruby API → workgroup commit. Two roads to one destination: theirs through peer review on pressurized-pipe networks, mine through 440+ Ruby scripts and a transaction-gated commit layer on unsteady free-surface drainage. This tab puts them side by side and marks the one place where my domain breaks their assumptions.
EPANET-Agentic
Wang, Fu & Savic · Water Research 293 (2026)
Interprets query, plans, delegates
Validates .inp, applies controls, sets scenarios
Writes & runs WNTR Python, saves results
Multimodal read of plots & tables
ICM-Agent (three-tier)
R. Dickinson · built 2025–26, independent of the paper
Natural language → structured task (now an Anthropic BaseTool loop inside ICM's Ruby 3.4)
hw_node / hw_conduit / hw_pump patterns; 440+ scripts in 14 AWI RED Combined libraries as the tool library
7 physics rules (adverse slope, diameter bounds, freeboard…) gate every commit
transaction_begin/commit per tool call, scenario-first, full audit trail
Component-for-component, the two systems are the same architecture
| Function | EPANET-Agentic (theirs) | ICM-Agent (mine) |
|---|---|---|
| Intent / planning | Orchestrator (DeepSeek-V3) | Tier 1 intent layer / BaseTool runner |
| Tool library | Registered WNTR tools | 440+ Ruby scripts → 14 libraries |
| Code execution | CodeRunner (DeepSeek-R1) runs Python | Tier 2 Ruby via IExchange.exe |
| Validation gate | implicit — .inp check + manual review | Surcharge Detective: 7 explicit physics rules |
| Numerical integrity | LLM forbidden to emit numbers; WNTR only | Engine-of-record only; Ruby never fabricates results |
| Human-in-the-loop | Approval per invocation | "go" gate before commit; scenario sandbox |
| Persistence / safety | Save .txt/.png; pickle modified network | Per-call DB transactions + audit trail |
| Solver regime | Steady / EPS pressurized pipe | Unsteady free-surface + surcharge (St. Venant) |
The last two rows are where the systems diverge — and the last row is the whole argument below.
Dynamic-wave instability has no analogue in a pressurized-pipe benchmark
EPANET-Agentic was validated on L-Town, C-Town, and Net3 — pressurized distribution networks solved with a steady/EPS hydraulic engine. In that world a run either converges or returns a clean error. The agent's "no fabricated numbers, trust the engine" rule is sufficient because the engine's output is, by construction, physically admissible.
SWMM5 and ICM's free-surface St. Venant solvers do not offer that guarantee. A dynamic-wave run can return numbers that look complete, execute without error, and still be physically meaningless — because the routing went unstable, the time step was too coarse for the Courant condition, or continuity quietly blew past tolerance. A "trust the engine" agent built for EPANET will confidently report garbage in SWMM5. The CodeRunner-equivalent succeeds, the DataAnalyzer-equivalent dutifully interprets the plot, and nobody notices the volume-continuity error is 12%.
The analyzer must refuse to report when flow/volume continuity exceeds tolerance — a QA signal EPANET-Agentic has no reason to implement.
The code-runner needs to detect oscillation and back off — reduce routing step, switch to variable step, tighten head convergence — before escalating.
My 7-rule physics gate already encodes exactly this instinct: validate the physics, don't trust the run. It's the missing layer for a stormwater-grade agent.
This isn't a criticism of their work — it's correct for their domain. It's the boundary of the result. Extending agentic control from EPANET to SWMM5/ICM is not a port; it requires an explicit physics-validation tier that the pressurized-pipe case never forced anyone to build. I built that tier first, by hand, because drainage modelling gave me no choice.
Convergent, not derivative
Two independent teams reaching the same architecture is the strongest possible validation that the architecture is right. The paper is the citable proof of concept in the easier domain; the ICM-Agent work is the existence proof in the harder one. Cited together, they make a claim neither makes alone: agentic hydraulic modelling is real, and the unsolved frontier is the unsteady free-surface case — which needs the physics-validation tier shown above.
Read the paper
The full open-access article (CC BY), rendered page by page. Use the controls to navigate or view all pages.
© Wang, Fu & Savic, Water Research 293 (2026) 125433. Open access under the Creative Commons Attribution (CC BY) licence — reproduced here under those terms.
Citation switcher — both papers, five formats
How to cite the original paper
This explorer is an educational companion. All credit for the EPANET-Agentic method belongs to its authors. The paper is open access under CC BY.
Wang, J., Fu, G., & Savic, D. (2026). EPANET-Agentic: A multi-agent system for natural language-controlled simulations of water distribution networks.
Water Research, 293, 125433. Received 8 Oct 2025; accepted 20 Jan 2026; available online 20 Jan 2026.
DOI: 10.1016/j.watres.2026.125433
Code & data: github.com/wangjian169/EPANET-Agentic
@article{Wang2026EPANETAgentic,
author = {Wang, Jian and Fu, Guangtao and Savic, Dragan},
title = {EPANET-Agentic: A multi-agent system for natural
language-controlled simulations of water distribution networks},
journal = {Water Research},
volume = {293},
pages = {125433},
year = {2026},
doi = {10.1016/j.watres.2026.125433},
url = {https://doi.org/10.1016/j.watres.2026.125433}
}
Wang, J., Fu, G., & Savic, D. (2026). EPANET-Agentic: A multi-agent system for natural language-controlled simulations of water distribution networks. Water Research, 293, 125433. https://doi.org/10.1016/j.watres.2026.125433