MermaidFlow: Redefining Agentic Workflow Generation via Safety-Constrained Evolutionary Programming

Chengqi Zheng, Jianda Chen, Yueming Lyu, Wen Zheng Terence Ng, Haopeng Zhang +3 more
5/29/2025
cs.LGcs.MA

No official code found. Best implementation: chengqiArchy/MermaidFlow (62 stars, last commit 2025-12-12).

Abstract

Despite the promise of autonomous agentic reasoning, existing workflow generation methods frequently produce fragile, unexecutable plans due to unconstrained LLM-driven construction. We introduce MermaidFlow, a framework that redefines the agentic search space through safety-constrained graph evolution. At its core, MermaidFlow represent workflows as a verifiable intermediate representation using Mermaid, a structured and human-interpretable graph language. We formulate domain-aware evolutionary operators, i.e., crossover, mutation, insertion, and deletion, to preserve semantic correctness while promoting structural diversity, enabling efficient exploration of a high-quality, statically verifiable workflow space. Without modifying task settings or evaluation protocols, MermaidFlow achieves consistent improvements in success rates and faster convergence to executable plans on the agent reasoning benchmark. The experimental results demonstrate that safety-constrained graph evolution offers a scalable, modular foundation for robust and interpretable agentic reasoning systems.

View on arXivView PDF

Code Implementations(1)

623Python, MermaidMay 28, 202510 months ago

Similar Papers

Cite this paper

@article{zheng2025mermaidflow,
  title  = {MermaidFlow: Redefining Agentic Workflow Generation via Safety-Constrained Evolutionary Programming},
  author = {Chengqi Zheng and Jianda Chen and Yueming Lyu and Wen Zheng Terence Ng and Haopeng Zhang and Yew-Soon Ong and Ivor Tsang and Haiyan Yin},
  year   = {2025},
  eprint = {2505.22967},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.22967v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.22967.svg)](https://codeofpaper.com/paper/2505.22967)

Discussion