AgentSPEX: An Agent SPecification and EXecution Language

Pengcheng Wang, Jerry Huang, Jiarui Yao, Rui Pan, Peizhi Niu +5 more
4/14/2026
cs.CL

No official code found. Best implementation: ScaleML/AgentSPEX (94 stars, Apache-2.0, last commit 2026-04-28).

Abstract

Language-model agent systems commonly rely on reactive prompting, in which a single instruction guides the model through an open-ended sequence of reasoning and tool-use steps, leaving control flow and intermediate state implicit and making agent behavior potentially difficult to control. Orchestration frameworks such as LangGraph, DSPy, and CrewAI impose greater structure through explicit workflow definitions, but tightly couple workflow logic with Python, making agents difficult to maintain and modify. In this paper, we introduce AgentSPEX, an Agent SPecification and EXecution Language for specifying LLM-agent workflows with explicit control flow and modular structure, along with a customizable agent harness. AgentSPEX supports typed steps, branching and loops, parallel execution, reusable submodules, and explicit state management, and these workflows execute within an agent harness that provides tool access, a sandboxed virtual environment, and support for checkpointing, verification, and logging. Furthermore, we provide a visual editor with synchronized graph and workflow views for authoring and inspection. We include ready-to-use agents for deep research and scientific research, and we evaluate AgentSPEX on 7 benchmarks. Finally, we show through a user study that AgentSPEX provides a more interpretable and accessible workflow-authoring paradigm than a popular existing agent framework.

View on arXivView PDF

Code Implementations(1)

ScaleML/AgentSPEXCommunity71%
Apache-2.0

This is the official implementation for AgentSPEX: An Agent SPecification and EXecution Language

944CSS, HTML5 months agoApache-2.0

Similar Papers

Cite this paper

@article{wang2026agentspex,
  title  = {AgentSPEX: An Agent SPecification and EXecution Language},
  author = {Pengcheng Wang and Jerry Huang and Jiarui Yao and Rui Pan and Peizhi Niu and Yaowenqi Liu and Ruida Wang and Renhao Lu and Yuwei Guo and Tong Zhang},
  year   = {2026},
  eprint = {2604.13346},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.13346v1}
}

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/2604.13346.svg)](https://codeofpaper.com/paper/2604.13346)

Discussion