本目录是 AutoWWTP-ASM 的开源整理版本,以及面向 Codex 和 Claude Code 的项目化封装。
AutoWWTP-ASM 面向污水处理厂 ASM 建模任务:根据任务文本和输入数据,自动识别工艺背景,生成 ASM 建模计划,抽取可运行配置,执行敏感性分析与参数校准,并生成报告、图件和追踪结果。
code/:各类源码项目和对比版本data/:开放数据或整理后的数据文件task/:开放任务说明example output/:示例输出结果failure test example/:失败案例结果摘要,仅保留未通过过程检查的 JSON 文件LICENSE:MIT 开源协议readme-cn.md:中文说明readme-en.md:英文说明
langgraph-en:主项目,完整 LangGraph 多智能体工作流skill:封装为 Codex skill 的版本autowwtp-asm-codex:按 Codex 项目结构组织的版本,包含AGENTS.md和.codex/agents/*.tomlautowwtp-asm-claude:按 Claude Code 项目结构组织的版本,包含CLAUDE.md和.claude/agents/*.md
主项目路径:
F:\wyq\lunwen\lunwen24_AutoWWTP-asm\code\code\open\allopen\code\langgraph-en
核心结构:
main.py:命令行入口coordinator_agent.py:多智能体调度器agents/knowledge_agent.py:生成工艺与数据上下文agents/plan_agent.py:生成 ASM 建模计划agents/modeling_agent.py:从计划中抽取可运行配置agents/reflection_agent.py:检查和修复配置script/asmlibrary.py:ASM 模型、敏感性分析和校准核心script/asmmodel.py:模型执行模板script/config_finalize.py:配置补全和参数整理script/report_template.py:报告生成模板references/WWTPProcessGuide.md:污水处理与变量说明参考input/:输入数据表task/:任务文本
langgraph-en 的默认流程如下:
- 读取任务文本和输入数据。
knowledge_agent生成WWTPProcessContext.md。plan_agent生成asm_plan.md。modeling_agent生成asm_config_before.json。config_finalize.py补全参数并生成asm_config_after.json和asm_config.json。reflection_agent检查模型范围、目标变量、边界条件和参数配置。asmmodel.py调用asmlibrary.py执行敏感性分析和参数校准。- 生成报告、图件、运行追踪和最终结果摘要。
建议使用 Python 3.10 或更高版本。
常用依赖包括:
pip install langgraph langchain-core langchain-openai langchain-anthropic langchain-google-genai pandas numpy scipy matplotlib openpyxl markdown-pdf pymoo其中:
langgraph用于多智能体流程调度langchain-*用于连接不同 LLM 服务pandas/openpyxl用于读取 Excel 数据numpy/scipy/matplotlib用于数值求解、校准和绘图markdown-pdf用于导出 PDF 报告pymoo用于 Pareto/NSGA-II 多目标校准
运行前建议通过环境变量配置模型服务,不要把真实密钥写入代码。
PowerShell 示例:
$env:AUTOWWTP_LLM_API_KEY="your-api-key"
$env:AUTOWWTP_LLM_BASE_URL="https://api.example.com/v1"
$env:AUTOWWTP_LLM_MODEL="your-model-name"
$env:AUTOWWTP_LLM_MESSAGE_CLASS="openai"可用的 AUTOWWTP_LLM_MESSAGE_CLASS 通常包括:
openaianthropicgemini
进入主项目目录:
cd F:\wyq\lunwen\lunwen24_AutoWWTP-asm\code\code\open\allopen\code\langgraph-enpython main.py --task-file task/task1.mdpython main.py --task "Modeling using autowwtp-asm. Data are located at input/data1.xlsx. Build an ASM model ..."python main.py --once启动后粘贴任务说明,输入空行结束。
python main.py进入交互后,在消息中包含触发词 autowwtp-asm,后面接具体建模任务。
python main.py --task-file task/task1.md --hitl-plan该模式会在生成 asm_plan.md 后暂停,允许人工检查或修改计划,再继续执行。
每次运行会在主项目下生成新的任务目录:
output/task-YYYYMMDD-HHMMSS-ffffff/
典型输出包括:
midoutput/WWTPProcessContext.mdmidoutput/asm_plan.mdmidoutput/asm_config_before.jsonmidoutput/asm_config_after.jsonmidoutput/asm_config.jsonmidoutput/sensitivity.jsonmidoutput/calibration.jsonfigs/asm_report.mdasm_report.pdffinal_result.jsonexecution_trace.jsonprocess_checks.json
任务文件位于:
code/langgraph-en/task/
输入数据位于:
code/langgraph-en/input/
任务文本中应明确写出:
- 数据文件路径,例如
input/data1.xlsx - 模拟对象,例如厌氧池、缺氧池、好氧池或完整工艺段
- 目标污染物或状态变量
- 是否考虑边界条件,例如回流、曝气、加药、外碳源等
- 校准目标和期望输出
本代码包采用 MIT License。正式许可文本见:
LICENSE
第一作者王煜琪 / Yu-Qi Wang的一些心里话: 这是我的第一篇 Agent 研究论文,也可能是 EST 上第一篇针对长流程 Agent 的研究论文。如果您读过这篇文章并来到这里,相信您也是一位努力工作的研究者。 这项研究于 2025 年完成,2026 年投稿,并于 2026 年 9 月接收。在此过程中,我经历了 GPT 从 3 到 6 的跨代升级,研究框架、方法和所使用的 LLM 也反复调整。相信您已经在论文中了解了本研究的许多优点。AI 发展得太快,很难判断几年后这些方法是否仍然足够创新。因此,我更希望在这里讨论一些研究局限:
- 本研究通过相对固定的预设模型库限制 LLM 的输入和输出。这种方法在大幅降低幻觉的同时,也降低了模型的自主性。随着 LLM 能力提升以及 Agent 框架约束方式的发展,未来是否可以让模型直接生成代码?例如最新的 Claude Fable 5.1、GPT-6,以及 DeepSeek Harness 背后的 Cordis 框架。
- Benchmark 部分是否可以加入更多污水处理场景,并设计相应的任务?
- 场景专用指标很难寻找,而 LLM-as-a-judge 的可复现性相对较差。这类工作仍然非常需要人工参与。 由于我申请到了新的项目,无法继续推进当前项目。这条研究路径上仍然有许多可以落地的想法,欢迎大家与我联系:17877784587@163.com。也希望大家能够提出宝贵建议。 最后,感谢我在 EST 投稿期间的主编和三位审稿人所提供的宝贵意见。我不知道你们是否会再次回来看这项研究,但你们的建议确实给了我很大帮助。LLM Agent 在环境领域仍然是一个新兴方向,感谢这些严格而友善的编辑和审稿人。
This directory contains the open-code bundle for AutoWWTP-ASM, and project-style packages for Codex and Claude Code.
AutoWWTP-ASM is designed for ASM modeling tasks in wastewater treatment plants. Given a task description and input data, it identifies the process context, generates an ASM modeling plan, extracts executable model configuration, runs sensitivity analysis and parameter calibration, and produces reports, figures, traces, and final results.
code/: source projects and comparison variantsdata/: open data or reorganized data filestask/: open task descriptionsexample output/: example output resultsfailure test example/: failed-case result summaries; only JSON files that did not pass process checks are retainedLICENSE: MIT licensereadme-cn.md: Chinese documentationreadme-en.md: English documentation
langgraph-en: main project with the full LangGraph multi-agent workflowskill: AutoWWTP-ASM packaged as a Codex skillautowwtp-asm-codex: Codex project structure withAGENTS.mdand.codex/agents/*.tomlautowwtp-asm-claude: Claude Code project structure withCLAUDE.mdand.claude/agents/*.md
Main project path:
F:\wyq\lunwen\lunwen24_AutoWWTP-asm\code\code\open\allopen\code\langgraph-en
Core files and folders:
main.py: command-line entry pointcoordinator_agent.py: multi-agent coordinatoragents/knowledge_agent.py: generates the process and data contextagents/plan_agent.py: generates the ASM modeling planagents/modeling_agent.py: extracts executable configuration from the planagents/reflection_agent.py: checks and repairs the configurationscript/asmlibrary.py: core ASM modeling, sensitivity analysis, and calibration libraryscript/asmmodel.py: model execution templatescript/config_finalize.py: configuration completion and parameter consolidationscript/report_template.py: report-generation templatereferences/WWTPProcessGuide.md: reference for wastewater process and variable interpretationinput/: input spreadsheetstask/: task descriptions
The default langgraph-en workflow is:
- Read the task description and input data.
knowledge_agentgeneratesWWTPProcessContext.md.plan_agentgeneratesasm_plan.md.modeling_agentgeneratesasm_config_before.json.config_finalize.pycompletes parameters and generatesasm_config_after.jsonandasm_config.json.reflection_agentchecks model scope, target variables, boundary conditions, and parameter settings.asmmodel.pycallsasmlibrary.pyto run sensitivity analysis and parameter calibration.- Generate reports, figures, execution traces, and the final result summary.
Python 3.10 or later is recommended.
Common dependencies:
pip install langgraph langchain-core langchain-openai langchain-anthropic langchain-google-genai pandas numpy scipy matplotlib openpyxl markdown-pdf pymooDependency roles:
langgraph: multi-agent workflow orchestrationlangchain-*: connection to different LLM providerspandas/openpyxl: Excel data loadingnumpy/scipy/matplotlib: numerical solving, calibration, and plottingmarkdown-pdf: PDF report exportpymoo: Pareto/NSGA-II multi-objective calibration
Configure the model service through environment variables before running. Do not write real API keys into source code.
PowerShell example:
$env:AUTOWWTP_LLM_API_KEY="your-api-key"
$env:AUTOWWTP_LLM_BASE_URL="https://api.example.com/v1"
$env:AUTOWWTP_LLM_MODEL="your-model-name"
$env:AUTOWWTP_LLM_MESSAGE_CLASS="openai"
$env:AUTOWWTP_LLM_TEMPERATURE="1.0"Typical values for AUTOWWTP_LLM_MESSAGE_CLASS include:
openaianthropicgemini
Enter the main project directory:
cd F:\wyq\lunwen\lunwen24_AutoWWTP-asm\code\code\open\allopen\code\langgraph-enpython main.py --task-file task/task1.mdpython main.py --task "Modeling using autowwtp-asm. Data are located at input/data1.xlsx. Build an ASM model ..."python main.py --onceAfter startup, paste the task description and finish with an empty line.
python main.pyIn the interactive session, include the trigger word autowwtp-asm followed by the modeling task.
python main.py --task-file task/task1.md --hitl-planThis mode pauses after asm_plan.md is generated, allowing manual inspection or editing before execution continues.
Each run creates a new task directory under the main project:
output/task-YYYYMMDD-HHMMSS-ffffff/
Typical outputs include:
midoutput/WWTPProcessContext.mdmidoutput/asm_plan.mdmidoutput/asm_config_before.jsonmidoutput/asm_config_after.jsonmidoutput/asm_config.jsonmidoutput/sensitivity.jsonmidoutput/calibration.jsonfigs/asm_report.mdasm_report.pdffinal_result.jsonexecution_trace.jsonprocess_checks.json
Task files are located in:
code/langgraph-en/task/
Input data are located in:
code/langgraph-en/input/
The task description should clearly specify:
- data file path, such as
input/data1.xlsx - modeled object, such as anaerobic tank, anoxic tank, aerobic tank, or the full process section
- target pollutants or state variables
- whether boundary conditions are considered, such as return flow, aeration, dosing, or external carbon source
- calibration targets and expected outputs
This code bundle is released under the MIT License. See the formal license text in:
LICENSE
Some personal thoughts from the first author, Yu-Qi Wang: This is my first research paper on Agents, and it may also be the first study on long-horizon Agents published in EST. If you have read the paper and arrived here, I believe you are also a hardworking researcher. This study was completed in 2025, submitted in 2026, and accepted in September 2026. During this process, I experienced the generational evolution of GPT from version 3 to version 6, while the research framework, methods, and LLMs used in the study were revised repeatedly. I believe you have already read about many of the strengths of this work in the paper. However, AI is developing so rapidly that it is difficult to know whether these methods will remain sufficiently innovative several years from now. Therefore, I would like to discuss some limitations here:
- This study constrains the inputs and outputs of the LLM through a relatively fixed, predefined model library. Although this approach greatly reduces hallucinations, it also limits the model’s autonomy. As LLM capabilities continue to improve and Agent frameworks evolve, could models generate code directly in the future? Examples include the latest Claude Fable 5.1 and GPT-6, as well as the Cordis framework behind DeepSeek Harness.
- Could the benchmark include more wastewater treatment scenarios and corresponding tasks?
- Scenario-specific metrics are difficult to identify, and the reproducibility of LLM-as-a-judge remains relatively limited. This type of research still requires substantial human involvement. Because I have been awarded a new project, I am unable to continue developing this project. There are still many practical ideas that could be pursued along this research path, and I welcome everyone to contact me at 17877784587@163.com. I also hope that you will share your suggestions. Finally, I would like to thank my handling editor and the three reviewers for their valuable suggestions during the EST submission process. I do not know whether you will return to look at this work, but your suggestions truly helped me. LLM Agents remain an emerging research direction in the environmental field. I am grateful to these rigorous and kind editors and reviewers.
