From Rule-based to Agentic: LLM Agent based Real-time Control of Urban Drainage Systems for Flooding and Sewer Overflow Mitigation

Wenchong Tian, Shixun Li, Ruozhou Lin, Peng Ye, Zhiyu Zhang, Shi Tao, Yu-Qi Wang, Ling Shi, Mingfu Guan, Haoran Duan, Zhiguo YuanarXiv 2026

TL;DR

When heavy rain hits a city, keeping streets dry and sewage contained requires smart real-time control of underground pumps and gates—something modern algorithms struggle to do because cities rarely have enough underground sensors. Instead of installing millions of dollars' worth of new hardware, the authors built a dual-LLM agent system that reads public weather warnings on the web, combines them with human operator manuals, and pre-emptively drains sewer tanks before storms arrive. It slashes flooding and sewage overflows by up to 90% over standard rule-based systems, performing nearly as well as idealized, compute-heavy optimization models at a fraction of the cost and latency.

What Problem Does This Paper Address?

Beneath every city lies an urban drainage system (UDS)—a sprawling labyrinth of pipes, tanks, and pumps. In many older cities, rainwater and raw sewage share the same pipes (a combined sewer system). When a storm hits, the system can easily get overwhelmed, leading to urban flooding and combined sewer overflows (CSOs) into local waterways.

To prevent this, engineers use Real-Time Control (RTC) to dynamically switch pumps and gates on and off. Historically, RTC relied on simple "if-water-reaches-level-X, turn-on-pump" rules, which are purely reactive. Newer approaches like Model Predictive Control (MPC) and Deep Reinforcement Learning (DRL) are proactive and vastly superior, if you feed them complete, real-time data of the entire pipe network and throw massive compute at them.

Here is the catch: real-world sewers are sensor-sparse, dark, harsh environments, and blanketing an entire city in underground flow meters is financially unsustainable. Meanwhile, critical predictive data already exists for free—in the form of public meteorological text warnings, categorical storm ratings, and veteran operators' rules of thumb. Traditional mathematical controllers simply have no way to ingest a paragraph of text from the national weather service.

Methods

Enter AgenticAI-Control, a framework that acts like a round-the-clock human control room engineer. Instead of relying on dense underground sensor networks or brute-force mathematical optimization, it uses two coupled Large Language Model (LLM) agents operating on a 10-minute loop:

Fig. 1. (a) AgenticAI-Control: a multi-agent RTC framework for UDS via fusion of multi-source
  1. Multi-source Meteorological Monitor (Agent 1): Uses web crawlers and Python scripts to scrape unstructured text warnings from weather authorities alongside hourly rainfall estimates. It translates qualitative terms (like "Blue Rainstorm Warning") into quantitative intensity estimates using national standards, pinpoints affected areas, and bundles this with sparse local sensor readings (just 13 monitoring points) into a clean, standardized JSON file.
  2. Control Guide (Agent 2): Ingests that JSON alongside natural-language domain knowledge—pipe topology, design codes, and veteran operator manuals. It reasons through the data to decide whether to pre-emptively turn on pumps to empty storage tanks before the rain hits.

Crucially, the authors wrapped the agents in strict safety guardrails and caching. A two-stage decision gate checks if the storm is within a 1-hour window and validates current tank levels; if the LLM hallucinates an unsafe or mistimed action, the system falls back to traditional rule-based Benchmark Control (BC). A caching mechanism also prevents redundant LLM calls when weather warnings haven't changed, saving tokens and sparing physical pumps from erratic switching.

Datasets

To test the system, the authors used a calibrated Storm Water Management Model (SWMM)—the standard physics simulator for urban hydrology—representing a real combined sewer catchment with two pumping stations (7 pumps total) in eastern China.

They built an evaluation testbed of 10 real-world rainfall events from 2015–2016 by cross-referencing hourly rainfall records from the OpenMeteo platform against historical, unstructured text warnings issued by the China Meteorological Administration (CMA) and the China Weather Network. All code, prompt templates, and the SWMM benchmark have been open-sourced.

Key Insights and Ideas

  • Free text beats expensive hardware: By delegating weather forecasting to specialized public agencies and using LLMs as semantic translators, cities can achieve proactive sewer control without expensive underground sensor renovations.
  • Architecture trumps LLM size: When tested across four different LLMs (DeepSeek-V4-Flash, GLM-4-Flash, Moonshot-v1-8k, and MiniMax-M3), a Friedman statistical test showed no significant difference in control performance ($p > 0.05$). Strict JSON schemas, modular workflows, and safety guardrails compress the gap between models, meaning small, cheap, or even local offline models are viable.
  • Proactive, human-like intuition: While rule-based control waits for tanks to fill up (too late) and MPC requires an unrealistic god's-eye view of every pipe, AgenticAI-Control hits a sweet spot—reading the news, firing up pumps early to create buffer space, and shutting them down safely.
Comparison of control actions in Event 1, illustrating how AgenticAI-Control activates pumps ahead of peak rainfall—much faster to compute than MPC, and more proactive than rule-based BC.

Key Results

  • Massive flood and overflow reductions: Across all 10 storms, AgenticAI-Control reduced combined flooding and sewer overflow volumes by 69.1% to 90.6% compared to the rule-based baseline.
  • Near-optimal performance at 25,000x the speed: An idealized MPC benchmark (gifted with perfect future rain forecasts, sensors in every pipe, and unlimited compute time) achieved 78.9%–95.3% reductions. AgenticAI-Control came remarkably close while using only 13 sensor locations and responding in <40 milliseconds per step, compared to >1,000 seconds of particle-swarm optimization per step for MPC.
  • Cost and prompt robustness: Every model used fewer than 7,000 tokens per call, with GLM-4-Flash and Moonshot-v1-8k using under 3,000 tokens and responding in <20 ms. When prompts were perturbed with synonyms to test hallucination sensitivity, Moonshot-v1-8k proved the most stable, with a Coefficient of Variation (CoV) of just 4.81%.

Limitations and Future Work

  • Simulation-only validation: The framework was validated in a physics simulator (SWMM) rather than deployed on live physical municipal pumps.
  • Prompt sensitivity: Synonymous wording tweaks in the prompts still caused noticeable performance fluctuations in some LLMs (up to an 11.04% CoV in GLM-4-Flash), underscoring the need for careful prompt engineering.
  • Restricted model pool: Due to regional network access restrictions, Western frontier models (like OpenAI's GPT and Anthropic's Claude) were not benchmarked.
  • Future directions: Because rigid agent workflows compensate so well for individual model limits, the authors highlight deploying offline, small-sized LLMs directly at local utility stations as a promising next step for secure, real-world infrastructure control.

Summary updated

Abstract

Real-time control (RTC) for urban drainage systems (UDS) remains hampered by sparse in-network sensing. While heterogeneous multi-modal meteorological early warnings often contain decision-critical information for UDS RTC, none of the existing approaches can exploit such externally-sourced information within the control workflow. Here we introduce AgenticAI-Control, an agentic artificial intelligence framework able to assimilate multi-source meteorological early warnings in RTC. Two coupled large language model agents are integrated to generate control strategies by retrieving meteorological early-warnings and fusing them with domain engineering expertise. Validated via simulation studies of a combined sewer catchment in eastern China across 10 real-world rainfall events, the AgenticAI-Control achieved 69.1-90.6% reduction in aggregated flood and overflow volumes compared to the rule-based baseline control. Rigorously standardized prompt engineering and modular workflow constraints substantially compress performance disparities among four distinct LLMs. Our work establishes AgenticAI as a viable tool to unify multi-source meteorological monitoring and practitioner domain knowledge, surmounting longstanding monitoring limitations of UDS RTC and delivering cost-efficient, robust intelligent control solutions for sensor-sparse sewer infrastructures.
BibTeX
@misc{tian2026from,
  author = {Wenchong Tian and Shixun Li and Ruozhou Lin and Peng Ye and Zhiyu Zhang and Shi Tao and Yu-Qi Wang and Ling Shi and Mingfu Guan and Haoran Duan and Zhiguo Yuan},
  title = {{From Rule-based to Agentic: LLM Agent based Real-time Control of Urban Drainage Systems for Flooding and Sewer Overflow Mitigation}},
  year = {2026},
  eprint = {2611.32046},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32046},
}
Figure