首页 › ai-agents › Agent声明式DSL六强割据与统一之路

概述

2026年上半年,Agent生态悄然爆发了一场没有硝烟的标准战争:如何用声明式语言定义一个AI智能体。Microsoft推出AgentSchema与Conductor双轮驱动,Oracle发布Open Agent Spec试图跨框架统一,Snap提出Kubernetes式的Agent Format,agents.yaml构建可移植运行时语义,duckflux追求极致最小化确定性DSL,Archon用YAML DAG锁死编码Agent的确定性。六大阵营各有哲学分歧——代码优先还是配置优先、平台绑定还是运行时无关、最小化还是全功能。这不是简单的YAML偏好之争,而是Agent能否像容器一样实现"一次定义、到处运行"的基础设施级命题。

六大声明式Agent DSL全景对比

维度 Microsoft AgentSchema/Conductor Oracle Open Agent Spec Snap Agent Format agents.yaml duckflux Archon
发起方 Microsoft Oracle Snap Inc. 社区开源 OpenVibes (个人) coleam00 (个人)
核心文件 .yaml (AgentSchema) + workflow.yaml (Conductor) .agent.yaml .agf.yaml agents.yaml flow.yaml workflow.yaml
定位 企业级Agent定义 + 工作流执行 跨框架Agent可移植规范 Kubernetes式Agent声明标准 可移植Agent运行时语义 最小确定性DSL 编码Agent确定性编排
Star数 AgentSchema 1.2k / Conductor 3.8k 2.1k 1.8k 890 560 4.2k
语言绑定 Python/.NET/JSON Schema Python SDK (多语言计划) 适配器模型(任意框架) YAML Schema 运行时无关 TypeScript/Python
确定性保证 Conductor零Token编排 声明式意图分离 声明式期望状态 运行时Profile约束 强确定性设计 DAG+条件分支强制
适用场景 Azure生态企业级Agent 跨平台Agent迁移 Agent市场/商店定义 多运行时部署 轻量自动化流水线 AI编码Agent流程控制
协议集成 MCP/A2A原生支持 MCP/Function Calling MCP/ACP MCP MCP Claude Code/Codex
成熟度 生产级(MAF 1.0) 技术预览 社区标准v0.3 v0.2 v0.1 生产可用
License MIT Apache 2.0 Apache 2.0 MIT MIT MIT

深度分析

一、Microsoft双引擎:AgentSchema + Conductor的企业级野望

Microsoft在Agent声明式定义领域投下了双倍赌注。AgentSchema是"客户端面对的规范"(client-facing spec),以code-first YAML格式定义Agent的身份、能力、工具和指令。它的设计哲学来自Kubernetes的声明式API——你描述Agent的期望状态(desired state),框架负责协调到该状态。

Conductor则解决了一个更具体的问题:多Agent工作流中的确定性编排。2026年5月14日以MIT协议开源发布,Conductor的核心创新是零Token编排——编排逻辑完全由YAML DAG定义,不需要LLM参与路由决策。这意味着编排层不消耗任何Token预算,全部推理预算留给业务Agent。

# Conductor workflow.yaml 示例
name: code-review-pipeline
steps:
  - id: lint
    type: prompt
    agent: claude-sonnet
    prompt: "Review this code for linting issues: {{input.code}}"

  - id: security-scan
    type: prompt
    agent: claude-sonnet
    prompt: "Identify security vulnerabilities in: {{input.code}}"

  - id: summarize
    type: prompt
    agent: claude-opus
    depends_on: [lint, security-scan]
    prompt: |
      Combine these reviews into actionable feedback:
      Lint: {{steps.lint.output}}
      Security: {{steps.security-scan.output}}

Conductor支持五种原语:prompt(LLM调用)、bash(Shell执行)、loop(迭代循环)、condition(条件分支)、parallel(并行执行)。这种设计让Agent工作流具备了CI/CD管道级别的确定性——同样的输入永远产生相同的控制流(LLM输出本身除外)。

变现评估:Microsoft Agent Framework 1.0已进入生产可用阶段,配合Azure Functions的Durable Agent Workflows,可直接打包为"企业Agent治理合规训练营",目标客户为金融/医疗等强监管行业。

二、Oracle Open Agent Spec:跨框架Agent可移植性的野心

Oracle的Open Agent Spec(Agent Spec)是目前最具学术深度的声明式Agent规范。其技术报告(arXiv:2510.04173)详细论述了Agent定义碎片化的问题:同一Agent在不同框架中的定义互不兼容,迁移成本极高。

Agent Spec的核心设计原则是关注点分离:将Agent的"做什么"(意图)与"怎么做"(执行细节)严格分离。一个Agent Spec定义包含五个顶层概念域:

agent:
  identity:      # Agent是谁(名称、版本、描述)
  capabilities:  # Agent能做什么(工具、技能)
  behavior:      # Agent怎么表现(指令、约束、安全策略)
  composition:   # Agent与谁协作(多Agent编排)
  deployment:    # Agent部署到哪里(运行时配置)

Oracle已提供Python SDK,可通过open-agent-spec包安装。其编译器能将Agent Spec YAML转换为LangGraph、CrewAI、AutoGen等多个框架的代码。这意味着理论上可以"一次定义、到处编译"。

# Agent Spec 示例
apiVersion: agent-spec/v1
kind: Agent
metadata:
  name: research-assistant
  version: "1.0"
spec:
  identity:
    description: "Deep research agent with web search and synthesis"
  capabilities:
    tools:
      - name: web_search
        type: MCP
      - name: document_analysis
        type: function
  behavior:
    instructions: |
      You are a research assistant. Analyze queries thoroughly.
    constraints:
      max_iterations: 10
      timeout: 300s

变现评估:Agent Spec的"跨框架编译"能力是独特卖点,适合做成"Agent可移植性评估SaaS"或"多框架Agent管理平台"。

三、Snap Agent Format:Kubernetes式Agent声明标准

Snap Inc.在2026年3月推出的Agent Format可能是最具运维基因的方案。它的设计灵感直接来自Kubernetes的声明式容器编排——一个.agf.yaml文件声明Agent的一切:身份、指令、工具、记忆、组合方式。

Agent Format的核心创新是适配器模型(Adapter Model)。任何框架都可以实现一个适配器,读取.agf.yaml文件并转换为自身的内部表示。这就像CRI(Container Runtime Interface)让Kubernetes不关心底层容器运行时一样,Agent Format让Agent定义不依赖任何特定框架。

# .agf.yaml 示例 — Agent Format
apiVersion: agentformat/v1
kind: Agent
metadata:
  name: customer-support
  labels:
    team: support
    tier: production
spec:
  identity:
    name: Customer Support Agent
    description: Handles customer inquiries with empathy
  instructions: |
    You are a helpful customer support agent.
    Always respond in the customer's language.
  tools:
    - name: knowledge_base
      type: MCP
      config:
        server: knowledge-mcp
    - name: ticket_system
      type: function
      handler: createTicket
  memory:
    type: conversation
    retention: 30d
  composition:
    handoff:
      - name: billing-specialist
        condition: "topic contains billing"
      - name: technical-support
        condition: "topic contains technical"

Agent Format的五段式结构(identity、instructions、tools、memory、composition)覆盖了Agent定义的核心维度。Snap的工程博客将其比喻为"Agent世界的Dockerfile"。

变现评估:Agent Format天然适合"Agent市场/商店"场景。一个标准化的Agent定义格式是构建Agent交易市场的基础设施。训练营角度:可做"Agent打包发布实战课"。

四、agents.yaml:可移植Agent运行时语义

agents.yaml项目走了一条不同的路——它不试图定义Agent的全部,只聚焦于运行时可移植语义。一个agents.yaml文件描述的是"这个Agent在运行时需要什么":模型配置、工具绑定、上下文管理、Runtime Profile。

其独特概念是Runtime Profile Specification——一种描述Agent运行时兼容性的标准格式。一个Profile声明Agent需要的最低运行时能力:

# agents.yaml 示例
agents:
  research-agent:
    model:
      provider: openai
      name: gpt-4o
      temperature: 0.3
    tools:
      - web_search
      - file_read
      - code_execute
    memory:
      type: episodic
      max_tokens: 8000
    runtime:
      profile: standard
      requirements:
        - tool_execution
        - streaming
        - human_in_the_loop

agents.yaml的设计目标是让Agent定义可以在不同运行时之间无缝迁移。它与Agent Format的区别在于:Agent Format更像Dockerfile(定义构建),agents.yaml更像docker-compose(定义运行)。

五、duckflux:极简确定性DSL的哲学追求

duckflux是这场标准战争中最具哲学色彩的项目。创建者Gondim在经历了OpenClaw和Lobster两个多Agent编排项目后,总结出一个核心洞察:现有框架都缺少一个运行时无关的、确定性的工作流DSL。

duckflux的设计原则极端克制:

# duckflow flow.yaml 示例
name: support-triage
nodes:
  classify:
    type: llm
    model: claude-haiku
    prompt: "Classify this ticket: {{input}}"

  route-billing:
    type: handoff
    agent: billing-agent

  route-technical:
    type: handoff
    agent: tech-agent

edges:
  - from: classify
    to: route-billing
    condition: "{{nodes.classify.output.category}} == billing"

  - from: classify
    to: route-technical
    condition: "{{nodes.classify.output.category}} == technical"

duckflux的GitHub仓库(deepducks/spec)自称为"🦆📜 最小的、确定性的、运行时无关的DSL",MIT协议,目前还在早期阶段。

六、Archon:用YAML锁死编码Agent的确定性

Archon在2026年4月7日完成了一次完全重写,从一个Python Agent构建器蜕变为YAML工作流引擎。它的定位极其精准——只为AI编码Agent服务。

Archon的DAG工作流包含四种命令类型: - Prompt:向LLM发送指令 - Bash:执行Shell命令 - Loop:迭代执行(带终止条件) - Condition:条件分支

# Archon workflow.yaml 示例 — 代码审查流水线
name: pr-review
steps:
  - id: checkout
    type: bash
    command: "git checkout {{branch}}"

  - id: analyze
    type: prompt
    agent: claude-sonnet
    prompt: "Analyze all changed files for bugs and issues"

  - id: iterate-fixes
    type: loop
    max_iterations: 5
    condition: "{{steps.analyze.output.has_issues}}"
    body:
      - type: prompt
        agent: claude-sonnet
        prompt: "Fix issue: {{steps.analyze.output.current_issue}}"
      - type: bash
        command: "npm test"

Archon的核心理念是"给AI编码Agent一个脚本让它跟着走"(Giving AI Coding Agents a Script to Follow)。其Workflow Marketplace允许社区共享和复用工作流模板,类似于GitHub Actions Marketplace。

架构对比:六种声明式哲学的分野

graph TB
    subgraph "声明式Agent DSL六极格局"
        direction TB

        subgraph "平台绑定派"
            MS[Microsoft AgentSchema<br/>+ Conductor]
            MS --> MS_PHILOSOPHY["企业级确定性<br/>Azure生态绑定"]
        end

        subgraph "跨框架统一派"
            ORACLE[Oracle Open Agent Spec]
            ORACLE --> ORACLE_PHILOSOPHY["一次定义到处编译<br/>学术驱动标准化"]

            SNAP[Snap Agent Format]
            SNAP --> SNAP_PHILOSOPHY["Kubernetes式声明<br/>适配器模型"]
        end

        subgraph "运行时可移植派"
            AGENTS_YAML[agents.yaml]
            AGENTS_YAML --> AY_PHILOSOPHY["运行时语义可移植<br/>Profile约束"]
        end

        subgraph "极简确定性派"
            DUCK[duckflux]
            DUCK --> DUCK_PHILOSOPHY["最小确定性<br/>运行时无关"]

            ARCHON[Archon]
            ARCHON --> ARCHON_PHILOSOPHY["编码Agent确定性<br/>DAG锁死流程"]
        end
    end

    MS_PHILOSOPHY --> CONVERGENCE{统一终点?}
    ORACLE_PHILOSOPHY --> CONVERGENCE
    SNAP_PHILOSOPHY --> CONVERGENCE
    AY_PHILOSOPHY --> CONVERGENCE
    DUCK_PHILOSOPHY --> CONVERGENCE
    ARCHON_PHILOSOPHY --> CONVERGENCE

    CONVERGESIS --> |"最可能"| WINNER["Agent Format + Open Agent Spec<br/>合并为行业标准"]
    CONVERGESIS --> |"次可能"| FRAGMENTED["持续碎片化<br/>每家维护自己的DSL"]

三大哲学分歧深度拆解

分歧一:定义范围——Agent定义还是工作流定义?

六大方阵在"定义什么"上存在根本分歧。AgentSchema、Agent Spec、Agent Format、agents.yaml聚焦于Agent本身的定义——Agent的身份、能力、工具、记忆。而Conductor、duckflux、Archon聚焦于Agent之间的工作流——DAG、条件路由、循环迭代。

这恰好对应了Kubernetes生态中的两个层次:Deployment/Pod定义(Agent定义)与Argo Workflows/Tekton(工作流定义)。两者并不矛盾,但目前没有一套DSL同时优雅地解决两个层次。Microsoft通过AgentSchema + Conductor的组合拳最接近全栈覆盖。

分歧二:平台绑定还是运行时无关

Microsoft的方案天然绑定Azure生态(虽然MIT协议开源)。Agent Spec、Agent Format、duckflux则明确追求运行时无关。这种选择直接影响Agent定义的可移植性和锁定风险。

在实际生产中,运行时无关是一个理想而非现实。每个框架的Agent Loop实现不同,工具调用的Schema格式不同,记忆管理的接口不同。Agent Format的适配器模型是最务实的折中——承认差异存在,用适配器层抹平。

分歧三:确定性程度——从"给提示"到"给脚本"

六种DSL提供的确定性保证形成光谱:

确定性等级 代表 机制
L1 弱确定性 AgentSchema 声明意图,执行由LLM决定
L2 中确定性 Agent Spec 约束条件限制LLM行为
L3 强确定性 Conductor/duckflux YAML DAG完全决定控制流
L4 极强确定性 Archon DAG + 条件 + 循环 + Bash,零LLM路由

Archon的L4确定性是最极端的——整个Agent工作流的每一步、每一个分支、每一次循环都在YAML中预先定义,LLM只在Prompt节点内部参与推理。这种极端确定性的代价是灵活性丧失:无法处理YAML中未预见的场景。

代码对比:同一个Agent在六种DSL中的定义

以"客户支持分流Agent"为例,对比六种DSL的表达能力:

Microsoft AgentSchema:

apiVersion: agentschema/v1
kind: Agent
metadata:
  name: support-triage
spec:
  instructions: "Classify and route customer inquiries"
  tools: [knowledge_search, ticket_create]
  handoffs:
    - target: billing-agent
      condition: "billing-related"

Oracle Agent Spec:

apiVersion: agent-spec/v1
kind: Agent
spec:
  identity:
    name: support-triage
  capabilities:
    tools: [knowledge_search, ticket_create]
  behavior:
    instructions: "Classify and route inquiries"
  composition:
    routing:
      - agent: billing-agent
        when: "topic == billing"

Snap Agent Format (.agf.yaml):

apiVersion: agentformat/v1
kind: Agent
spec:
  identity:
    name: support-triage
  instructions: "Classify and route"
  tools:
    - name: knowledge_search
      type: MCP
  composition:
    handoff:
      - name: billing-agent
        condition: "topic contains billing"

从以上对比可以看出:三者高度相似。Agent Format和Agent Spec在结构上几乎同构,Microsoft AgentSchema稍有差异但核心概念域一致。这暗示了标准化收敛的可能性——当三家的DSL长得越来越像,合并或互操作的阻力就越小。

生产落地的真实差距

评估维度 Microsoft Oracle Snap agents.yaml duckflux Archon
文档完整度 ★★★★★ ★★★★ ★★★★ ★★★ ★★ ★★★★
生产案例数 50+ <10 <5 <3 0 20+
IDE/工具支持 VS Code + LangGraph Studio CLI + Python SDK CLI + 适配器 CLI CLI CLI + Marketplace
CI/CD集成 Azure DevOps/GitHub Actions 通用 通用 通用 通用 原生Git Worktree
调试能力 LangGraph Studio可视化 编译后调试 适配器层调试 有限 有限 DAG可视化

关键发现:Microsoft在生产就绪度上遥遥领先,主要得益于Azure生态的完整工具链。Oracle和Snap在标准化理念上更先进,但缺少足够的实战验证。Archon在编码Agent的垂直场景中表现最强。duckflux和agents.yaml目前更适合技术预研而非生产部署。

推荐方案

场景一:企业级生产部署(首选Microsoft)

如果团队已使用Azure/GitHub生态,Microsoft AgentSchema + Conductor是最务实的选择。MAF 1.0的生产稳定性、LangGraph Studio的可视化调试、Azure Functions的Durable Agent Workflows提供了端到端的生产级解决方案。

场景二:跨框架Agent产品(首选Agent Format)

如果Agent需要被不同框架的消费方使用(如Agent市场、SaaS产品),Snap的Agent Format适配器模型提供了最佳的互操作性。其五段式结构(identity/instructions/tools/memory/composition)覆盖面广,.agf.yaml文件格式直观易学。

场景三:编码Agent流水线(首选Archon)

如果核心场景是AI编码Agent的流程控制(代码审查、自动修复、测试生成),Archon的YAML DAG工作流提供了最强确定性保证。其Workflow Marketplace提供开箱即用的模板。

场景四:轻量自动化(首选duckflux)

如果只是需要简单的多步骤Agent流水线,不想引入重量级框架,duckflux的极简DSL提供了最低的上手成本。

场景五:学术研究/标准制定(关注Agent Spec)

Oracle的Agent Spec提供了最严谨的形式化定义,适合学术研究或参与行业标准制定。

风险提示

目前六大DSL均未形成行业共识标准。如果选择任何一个进行深度投入,需要关注:(1) Agent Format与Agent Spec的合并可能性;(2) Microsoft是否会在MAF后续版本中兼容外部DSL;(3) W3C或ISO是否启动Agent定义标准化进程。2026年Q3-Q4将是关键观察窗口。

参考来源

  1. Conductor: Deterministic orchestration for multi-agent AI workflows — Microsoft Open Source Blog — Microsoft Conductor开源发布公告,详述零Token编排理念
  2. Agent Format: A Declarative Standard for AI Agents — Snap Engineering — Snap提出Kubernetes式Agent定义标准的技术设计文档
  3. Open Agent Specification Technical Report — arXiv:2510.04173 — Oracle Agent Spec学术论文,论述跨框架Agent可移植性
  4. duckflux: A Declarative Workflow DSL Born from the Multi-Agent Orchestration Gap — dev.to — duckflux DSL的设计动机与哲学
  5. Declarative Agent Specification: Configuration Languages and Standards — Zylos Research — 声明式Agent规范全景综述,对比各标准的设计取舍

[!tip] 51学通信知识星球 星主:爱卫生(微信:gprshome201101)——公众号「51学通信」创办者,19 年通信行业运维与讲师经验,著有《GPRS网络信令实例详解》《EPC原理与实践》《5G核心网原理与实践》三本纸质书(各大电商平台有售)。 星球定位:深耕 5G 核心网、IMS、NFV/AI、云原生等 ICT 领域,主打运维岗位与信令分析。 当前规模:5200 篇主题 / 990 个回答,198 元/年。 加入福利:加入星球后请加爱卫生微信,拉您进知识星球年度陪伴与答疑群——不限量回复您的各种问题,另有群内分享。 AI 加持:51学通信知识星球已作为 skill 接入 WorkBuddy,使用 deepseek-4-flash 在海量星球帖子中精准找贴、找视频、找 FAQ 和案例,做总结、找文档和 PPT 等场景全覆盖。

51学通信知识星球海报-扫码加入