Zing Forum

Reading

AgentSPEX: Declarative Workflow Specification and Execution Language for LLM Agents

This article introduces AgentSPEX, a domain-specific language for specifying LLM agent workflows, supporting explicit control flow, modular structure, and visual editing to enhance the maintainability and interpretability of agents.

智能体工作流语言LLM编排框架声明式编程可视化编辑
Published 2026-04-15 07:16Recent activity 2026-04-16 10:52Estimated read 6 min
AgentSPEX: Declarative Workflow Specification and Execution Language for LLM Agents
1

Section 01

AgentSPEX: Introduction to the Declarative Workflow Specification and Execution Language for LLM Agents

This article introduces AgentSPEX, a domain-specific language designed specifically for LLM agents, aiming to solve the current challenges in agent orchestration. It supports explicit control flow, modular structure, and visual editing, which can enhance the maintainability and interpretability of agents and lower the development threshold.

2

Section 02

Background: Two Major Challenges in Current LLM Agent Orchestration

Background: Challenges in Agent Orchestration

Current large language model agent systems mainly rely on two architectural patterns:

Reactive Prompting

A single instruction guides the model to perform an open-ended sequence of reasoning and tool usage. The flaws of this model include:

  • Implicit control flow and intermediate states
  • Agent behavior is difficult to predict and control
  • Debugging and maintenance are challenging

Orchestration Frameworks (e.g., LangGraph, DSPy, CrewAI)

Provide stronger structure through explicit workflow definitions, but have key issues:

  • Workflow logic is tightly coupled with Python code
  • Agents are difficult to maintain and modify
  • Non-technical users find it hard to understand and use
3

Section 03

Core Features and Execution Environment of AgentSPEX

AgentSPEX: Declarative Agent Workflow Language

The research team proposed AgentSPEX (Agent SPecification and EXecution Language), a specification and execution language designed specifically for LLM agents.

Core Features

AgentSPEX supports the following key features:

  1. Typed Steps: Each step has clear input and output types
  2. Control Flow Structures: Natively supports branching and loops
  3. Parallel Execution: Can execute multiple steps in parallel
  4. Reusable Submodules: Supports modular design
  5. Explicit State Management: State changes are clearly visible

Execution Environment: Agent Harness

AgentSPEX workflows run in a dedicated Agent Harness, which provides:

  • Tool Access: Standardized tool call interface
  • Sandbox Virtual Environment: Secure execution environment
  • Checkpointing: Supports state saving and recovery
  • Validation Mechanism: Ensures workflow correctness
  • Logging: Complete execution tracking
4

Section 04

AgentSPEX Visual Editor: A Tool to Lower the Usage Threshold

Visual Editor

To lower the usage threshold, AgentSPEX is equipped with a visual editor that has:

  • Synchronized Graph View: Intuitively displays workflow structure
  • Code View: Directly edit the underlying specification
  • Bidirectional Synchronization: Real-time synchronization between graph and code
5

Section 05

Ready-to-Use Agents and Effectiveness Evaluation of AgentSPEX

Ready-to-Use Agents and Evaluation

The research team provides out-of-the-box agents:

  • Deep Research Agent: For complex information retrieval and comprehensive analysis
  • Scientific Research Agent: Supports academic literature research and experimental design

Evaluations on 7 benchmarks have verified the effectiveness of AgentSPEX. User studies show that compared to existing popular frameworks, AgentSPEX provides a more understandable and accessible workflow writing paradigm.

6

Section 06

Significance and Impact of AgentSPEX: An Important Evolution of Agent Architecture

Significance and Impact

AgentSPEX represents an important evolution of agent system architecture:

  • From Imperative to Declarative: Users describe "what to do" instead of "how to do it"
  • From Implicit to Explicit: Control flow and state management are clearly visible
  • From Coupled to Modular: Workflow components can be developed and reused independently

This approach is expected to lower the threshold for agent development, enabling more domain experts to build and customize their own agent workflows without needing to master programming details in depth.