Skip to main content

Unified CLI for reproducible and auditable Agentic SWMM workflows.

Project description

Agentic SWMM Workflow (Alpha: Under Active Development and Testing)

Agentic SWMM logo with agentic robot, stormwater system, and SWMM wordmark

CI status latest release PyPI version Codecov coverage Docker reproducible environment MIT license Built by Zhonghao

Agentic SWMM for reproducible stormwater modeling
Codex, OpenClaw, or Hermes Agent + Skills + MCP + SWMM + verification-first workflow + Obsidian-compatible audit

A five-minute EPA SWMM workflow that is auditable, memory-informed, and agent-ready.

Agentic SWMM Workflow is an open-source, verification-first framework for reproducible stormwater modeling with EPA SWMM. It supports automated execution, QA checks, provenance tracking, calibration support, documentation, and modeling memory, while keeping human modelers in control.

The project is designed to work with agent runtimes such as Codex, OpenClaw, or Hermes. Users can describe a modeling goal in natural language, while SWMM execution remains deterministic, inspectable, and artifact-based.

This is not a simple chat-to-SWMM wrapper. The agent can help coordinate the workflow, but model files, SWMM runs, QA checks, plots, provenance records, audit notes, and modeling memory remain visible as reusable artifacts. Modeling memory can summarize repeated problems and propose skill refinements, but accepted changes still require human review and benchmark verification.

Authors: Zhonghao Zhang & Caterina Valeo
License: MIT

Video: Agentic SWMM workflow: introduction and workflow explanation

Paper: Agentic Modelling Pipeline: Reproducible Rapid Stormwater Modelling Management System with OpenClaw

Try it in one command(Alpha)

macOS and Linux:

curl -fsSL https://aiswmm.com/install.sh | bash

Windows PowerShell:

irm https://aiswmm.com/install.ps1 | iex

After installation, launch the runtime with aiswmm. Docker and Python package paths are documented in runtime install options. Release notes: v0.6.2-alpha (pre-release) · v0.6.1.

Pre-release users: pip install aiswmm==0.6.2a1 or pip install --pre aiswmm. Stable users on pip install aiswmm continue receiving v0.6.1.

Before running a one-line installer, inspect the repository install scripts if you need to review what will be executed. The installer can prompt for an OpenAI API key, or you can configure one later with environment variables; see API key configuration. Do not paste API keys into the aiswmm conversation.

v0.6.2-alpha highlights (pre-release)

  • Warm intro fires once per session, not on every greeting (#108). Pre-fix: hi/hello/你好 repeated 4× would emit the canned warm-intro 4×; post-fix: only the first open-shaped prompt triggers it.
  • First plot_run no longer hangs ~90s on matplotlib/swmmtoolbox cold start (#109/#110). The swmm-plot MCP server preheats those imports at boot.
  • Plot X-axis is readable across any simulated duration (#112). AutoDateLocator + ConciseDateFormatter replace the 316-label black-blur seen on year-long runs.
  • swmm-end-to-end and 5 sibling pure-orchestration skills now appear in aiswmm skill list (#113). Previously dropped silently from the skill registry.
  • Compound intent like "run X demo and plot the figure" routes correctly (#111). Two-layer fix: keyword-fallback priority repair AND a new LLM-disambiguation deep module that fires only when plot co-occurs with another action verb.
  • aiswmm doctor warns on stale editable installs + mcp.json checkout drift; new aiswmm setup --refresh-mcp to re-align (#113/#114). Removes the two-checkout footgun that silently shipped stale code.
  • Zero hardcoded watershed names in routing/inference code (#118). Case-ID inference, continuation classification, and memory summarization now derive case identity from case_registry.list_cases(). Migration to a new watershed no longer requires code changes — add cases/<your-watershed>/case_meta.yaml and the runtime picks it up. An AST-based regression guard prevents future leaks.

v0.6.1 highlights

  • aiswmm now keeps a clearer runtime identity in the interactive terminal, including the aiswmm> prefix and executor banner.
  • Interactive outputs use cleaner date-and-case run folders while preserving audited stage folders inside each run.
  • The Tecnopolo prepared .inp demo can be run, audited, inspected for plot options, and continued into rainfall/node/output-variable plots from the same active run.
  • Plot follow-ups such as Total_inflow J2 MACAO_94_23 now continue from the previous run instead of asking again for model inputs.
  • MCP schema discovery is cached and timeout-protected so slow MCP servers do not block the main CLI run/audit/plot path.
  • Planner-generated recursive searches such as **.inp are normalized safely, fixing a demo-listing crash path.

Why this project exists

Stormwater modelling is rarely one command. A typical SWMM project can involve GIS preprocessing, rainfall formatting, parameter assignment, network assembly, INP construction, model execution, QA checks, plots, calibration, uncertainty analysis, and reporting.

Agentic SWMM provides a middle path: natural-language orchestration with deterministic SWMM execution, explicit provenance, project memory, and verification-first modelling.

The goal is not to replace SWMM or the modeller, but to make SWMM-based modelling easier to rerun, inspect, remember, and trust.

What makes it different

  • Quick onboarding: start from one-line macOS/Linux or Windows installers, with Docker and Python package paths documented separately.
  • Agent-guided, SWMM-grounded: agents can coordinate tasks, while model execution stays deterministic, inspectable, and CLI-runnable.
  • Modular skill layer: GIS, climate, building, running, plotting, calibration, uncertainty, audit, and orchestration are separated into reusable modules with MCP interfaces where available.
  • Verification-first provenance: build, run, audit, and comparison stages emit traceable artifacts before outputs are treated as evidence.
  • Supervised skill evolution: audited runs can surface recurring workflow patterns and propose updates to existing skills or new skills, while staying coupled to the current skill-driven framework.

Workflow

Agentic SWMM modeling memory and controlled skill evolution loop

The workflow has three connected layers: execution, modeling memory, and controlled skill evolution. Natural-language requests can trigger reproducible SWMM actions; audited artifacts update human-readable and machine-readable memory; repeated patterns can produce skill-refinement proposals that still require human review and benchmark verification.

What a run can produce

  • generated or supplied SWMM input files such as model.inp
  • SWMM report and binary outputs such as .rpt and .out
  • manifests, command traces, QA summaries, and parsed peak-flow metrics
  • rainfall-runoff figures, calibration summaries, and fuzzy uncertainty summaries
  • audit records: experiment_provenance.json, comparison.json, and experiment_note.md
  • Obsidian-ready modelling notes and modelling-memory summaries

Validation snapshot

The repository includes runnable benchmarks and research previews with different evidence boundaries. The README keeps only the index; figures, commands, and boundary notes live in Validation evidence.

Path What it shows Evidence boundary
Information-loss-guided subcatchment partition QGIS-to-Agentic SWMM preprocessing using entropy and fuzzy-similarity concepts from Zhang & Valeo's Journal of Hydrology paper GIS preprocessing concept, not a calibrated SWMM performance claim
Raw GeoPackage-to-INP benchmark Public TUFLOW GeoPackage layers converted into SWMM-ready artifacts, QA, and audit Structured raw GIS path, not arbitrary CAD/GIS recognition
Prepared-input SWMM benchmark External 40-subcatchment Tecnopolo model execution, plotting, and direct swmm5 comparison Prepared INP validation path
Prior Monte Carlo uncertainty smoke Tecnopolo HORTON parameter perturbation and hydrograph envelope preview Prior uncertainty smoke, not calibration
Optional INP-derived raw adapter benchmark Raw-like inputs extracted from a public SWMM fixture and rebuilt through the modular path Adapter handoff check, not greenfield watershed generation

Examples: TUFLOW and Tecnopolo.

Audit and research memory

The audit layer consolidates artifacts, QA checks, and metric provenance into an Obsidian-compatible experiment note. This example catches a recorded peak-flow value that does not match the value re-parsed from the SWMM report source section.

Experiment audit comparison showing a peak-flow provenance mismatch

The downstream modelling-memory layer can summarize audited run histories into recurring failure patterns, assumptions, missing evidence, QA issues, lessons learned, and controlled proposals for updating existing skills or creating new skills. Because skills drive the workflow, these proposals stay coupled to the current Agentic SWMM framework and still require human review and benchmark verification before acceptance.

More details: Experiment audit framework and Modeling memory and skill evolution.

Codex / OpenClaw / Hermes ready

Codex can serve as the primary local development runtime for this repository: it can inspect the checkout, run scripts, edit skills, generate audit records, update the local Obsidian vault, and review evidence before claims are accepted.

OpenClaw and Hermes remain compatible orchestration targets, especially for MCP-centered agent runs outside the Codex development environment.

For agent-orchestrated runs, preload the Agentic AI memory package and then use the top-level end-to-end skill:

agent/memory/
skills/swmm-end-to-end/SKILL.md

The top-level skill defines when to use the full modular path, when to use the prepared-input path, which QA gates must pass, and when to stop instead of inventing missing inputs.

For common prepared-input execution, audit, plotting, and memory summarization, the skill should prefer the unified agentic-swmm CLI. MCP tools remain available for the modular stages and for agent runtimes that need fine-grained tool calls.

More details: Codex runtime path, OpenClaw execution path, Skill installation, and MCP runtime integration.

Documentation map

Where collaborators can help

Contributions are welcome in additional SWMM case studies, stronger calibration and validation workflows, DEM / land-use / soil / drainage-asset workflows, new MCP tools, QA testing, tutorials, and interoperability with GIS, ML, and hydrologic toolchains.

Contact:

Citation

GitHub citation metadata is provided in CITATION.cff.

APA repository

Zhang, Z., & Valeo, C. (2026). agentic-swmm-workflow [Computer software]. GitHub. https://github.com/Zhonghao1995/agentic-swmm-workflow

APA manuscript / preprint

Zhang, Z., & Valeo, C. (2026). Agentic Modelling Pipeline: Reproducible Rapid Stormwater Modelling Management System with OpenClaw. https://doi.org/10.31223/X5F47G

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiswmm-0.6.2a1.tar.gz (910.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiswmm-0.6.2a1-py3-none-any.whl (794.4 kB view details)

Uploaded Python 3

File details

Details for the file aiswmm-0.6.2a1.tar.gz.

File metadata

  • Download URL: aiswmm-0.6.2a1.tar.gz
  • Upload date:
  • Size: 910.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aiswmm-0.6.2a1.tar.gz
Algorithm Hash digest
SHA256 3d1feed814dc8e28fd380272bd96483f84b786e0063765e21cf832b51d31aafb
MD5 ddae4c145d68860c512c4ae58693dbdc
BLAKE2b-256 c85e02a5c33f784c2dfece639aae92245d5f93bdec7e0e030e1fac66d9f8d85d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiswmm-0.6.2a1.tar.gz:

Publisher: publish-pypi.yml on Zhonghao1995/agentic-swmm-workflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiswmm-0.6.2a1-py3-none-any.whl.

File metadata

  • Download URL: aiswmm-0.6.2a1-py3-none-any.whl
  • Upload date:
  • Size: 794.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aiswmm-0.6.2a1-py3-none-any.whl
Algorithm Hash digest
SHA256 cad552ce98a2ba9ca40b9a0905eaa2130b2d132cdb124d7b0f9129fdd3b7f23a
MD5 d6ed2b8200cd4dd958a3a839e73a2528
BLAKE2b-256 2a83f9147216240f31347fa98a86f1a6c96116583bb1d0f984d5cf46b3575455

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiswmm-0.6.2a1-py3-none-any.whl:

Publisher: publish-pypi.yml on Zhonghao1995/agentic-swmm-workflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page