The Universal Language for AI Agents
AgentML is to agent frameworks what HTML is to web browsers. Write your agent's behavior once and run it anywhere—ending the cycle of costly rewrites caused by framework fragmentation.
The Problem: Framework Fragmentation
The AI agent landscape is fragmented and accelerating, with new frameworks appearing weekly. This creates vendor lock-in and forces costly rewrites when a chosen framework becomes limiting or unmaintained.
AgentML : Agent Frameworks = HTML : Web Browsers
Just as HTML lets you write content once and have it render in any browser, AgentML lets you define your agent's behavior once and run it anywhere. This is achieved by building on the battle-tested W3C SCXML standard, a formal model for state machines that has been proven for over 20 years in complex industrial systems.
By separating behavior from runtime, your agents outlive framework trends.
Key Features
Why AgentML?
The core promise of AgentML is to end the cycle of constant rewrites caused by framework fragmentation. By providing a universal agent definition language built on proven standards, AgentML gives you framework insurance.
Write your agent logic once in AgentML, then run it natively with the high-performance agentmlx runtime (Go/WASM), or transform it to integrate with existing ecosystems like LangGraph, CrewAI, or n8n. Your choice of runtime is based on deployment needs, not sunk costs or vendor lock-in.
By unifying LLMs with state machines, AgentML provides the best of both worlds: the creativity of AI and the reliability of software engineering. This consistency accelerates development and facilitates a growing ecosystem of shareable, reusable agents.
Simple Example
<agentml xmlns="github.com/agentflare-ai/agentml"
datamodel="ecmascript"
xmlns:gemini="github.com/agentflare-ai/agentml-go/gemini">
<datamodel>
<data id="user_input" expr="''"/>
<data id="response" expr="''"/>
</datamodel>
<state id="main">
<state id="awaiting_input">
<onentry>
<assign location="user_input" expr="getUserInput()"/>
</onentry>
<transition target="processing"/>
</state>
<state id="processing">
<onentry>
<gemini:generate model="gemini-2.0-flash-exp"
location="_event"
promptexpr="'Process: ' + user_input"/>
</onentry>
<transition event="action.response"
event:schema='{"type":"object","properties":{"message":{"type":"string"}}}'
target="responding"/>
</state>
<state id="responding">
<onentry>
<assign location="response" expr="_event.data.message"/>
<log expr="'Response: ' + response"/>
</onentry>
<transition target="awaiting_input"/>
</state>
</state>
</agentml>
Example Use Cases
AgentML is suitable for complex, long-running AI agents that require structured decision logic. Examples include:
- Multi-step customer support bots with flows for checking policies, booking flights, and more
- Autonomous research agents that invoke specialized sub-tools and coordinate complex workflows
- Agent swarms with supervisor-worker delegation patterns
- Any scenario where you need the AI to follow a strict, auditable workflow
See the provided examples (e.g., a full customer support bot with flight, hotel, and rental booking flows) for real-world AgentML implementations.