Skip to content

Repository files navigation

LeakAgent: Multi-Agent Coordination for Water Distribution Networks

An Intelligent System for Leak Detection and Regional Identification via Multi-Modal LLM Coordination

Tianwei Mu

Guangzhou Institute of Industrial Intelligence

DOI Python 3.10 License: MIT


🔥 News

  • [2026-08] v1.1.0 reproducibility release: the repository now ships a complete experiments/ tree that reproduces every quantitative figure and table of the paper, together with the published result files.
  • [2026-02] LeakAgent code released: leak detection module, sensor placement and boundary optimization.

📋 Introduction

LeakAgent is a multi-agent system for water distribution network (WDN) management. A multimodal-LLM coordinator translates natural-language requests into executable workflows and orchestrates four specialized agents that share a single hydraulic pressure-sensitivity field:

  • 💧 HydroSim — hydraulic simulation and pressure-sensitivity analysis (WNTR / EPANET).
  • 🧩 PartitionSim — division of the network into hydraulically coherent DMAs (FCM clustering).
  • 📡 SensorPlacement — multi-objective sensor deployment (detectability, time-to-detection, coverage, failure resilience).
  • 🔍 LeakDetection — the LTGFM dual-branch graph model for joint global (leak / no-leak) and regional (which DMA) detection.
  • 📊 Interactive web interface — bilingual natural-language dialogue with embedded visualizations.

🏗️ Architecture

Overall Network Architecture The LeakDetection agent: (a) training workflow; (b) Adaptor layer; (c) LTGFM layers; (d) inference.

🚀 Quick Start

Prerequisites

  • OS: Windows 10/11, Linux, macOS
  • Python: 3.10 (versions of all pinned packages follow the paper; see requirements.txt)
  • Redis (for the web app's conversation memory)
  • Hardware: NVIDIA GPU (8 GB+ VRAM) recommended for training experiments

Installation & Run

  1. Clone the repository

    git clone https://github.com/mutianwei521/leakagent.git
    cd leakagent
  2. Configure environment

    cp .env.example .env      # then fill in your API keys

    No credentials are stored in the code; everything is read from .env / environment variables.

  3. Start the system

    pip install -r requirements.txt
    python app.py             # or ./start.sh (Linux/mac), start.bat (Windows)

📑 Reproducing the paper

All experiments behind the paper's figures and tables live under experiments/, one self-contained harness per result:

Paper result Harness
Fig. 2, Figs. S2–S5, Tables S4–S23 (detection vs leak magnitude) experiments/leak_magnitude/
Fig. 3, Figs. S6–S10, Table S24 (noise robustness) experiments/noise_robustness/
Fig. 5, Tables S44–S45 (feature & architecture ablations) experiments/ablation/
Fig. 6, Figs. S39–S42, Table S46 (baseline comparison) experiments/baselines/
Figs. S37–S38, Table S43 (MLLM coordinator comparison) experiments/mllm_coordinator/
Tables S40–S42 (error correction and recovery) experiments/error_correction/
Publication box-plot figures from Source Data experiments/figures/

The published per-repetition results are included as JSON, so every figure can be regenerated without re-running the experiments. See experiments/README.md for commands, runtimes and data notes (the City H network model is proprietary and not distributed).

📂 Repository structure

leakagent/
├── app.py                    # web application (Flask)
├── mm_wds_agent.py           # MLLM coordinator + agent tools
├── wds_*_main.py             # pipeline entry points (partition / sensor / leak / optimization)
├── LTFM-WaterNetwork/        # LTGFM model package (training / inference)
├── optimization_utils/       # MOEA sensor placement, hydraulic objectives
├── partition_utils/          # FCM partitioning
├── dataset/                  # public benchmark networks (EXA5, EXA7, KY3, KY5)
├── experiments/              # paper reproduction harnesses + published results
├── static/, templates/       # web UI
└── paper/                    # figures used in this README

📖 Citation

If you use LeakAgent, please cite the paper and the archived code:

@misc{leakagent_code,
  author = {Mu, Tianwei and others},
  title  = {LeakAgent: a multi-agent system for leak detection using
            multi-modal large language model coordination in water
            distribution network (code)},
  year   = {2026},
  doi    = {10.5281/zenodo.TBD},
  url    = {https://github.com/mutianwei521/leakagent}
}

📄 License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages