Show HN: AgentML – SCXML for Deterministic AI Agents (MIT)

github.com

5 points by jeffreyajewett 18 hours ago

Hey HN,

We’ve been experimenting with how to make AI agents more deterministic, observable, and production-safe, and that led us to build AgentML — an open-source language for defining agent behavior as state machines, not prompt chains.

My co-founder posted before but linked to the project website instead of the repo, so resharing here.

AgentML lets you describe your agent’s reasoning and actions as a finite-state model (think SCXML for agents). Each state, transition, and tool call is explicit and machine-verifiable.

That means you can:

- Reproduce any decision path deterministically

- Trace reasoning and tool calls for debugging or compliance

- Guarantee agents only take valid actions (e.g. “never send a payment before verification”)

- Run locally, in the cloud, or within MCP-based frameworks

Example:

```

<?xml version="1.0" encoding="UTF-8"?>

<agentml xmlns="github.com/agentflare-ai/agentml" xmlns:openai="github.com/agentflare-ai/agentml-go/openai" version="1.0" datamodel="ecmascript" name="researcher">

<datamodel>

    <data id="papers" expr="[]"
        schema='{"type":"array","description":"Fetched papers from Hugging Face"}' />

    <data id="summary" expr="''"
        schema='{"type":"string","description":"Summary of the papers"}' />
</datamodel>

<state id="start">

    <onentry>

        <log label="Researcher: "
            expr="`Fetching papers from Hugging Face and summarizing with OpenAI\n`" />

        <openai:generate model="gpt-4o" location="summary" stream="false">

            <openai:prompt>Summarize these recent AI/ML papers from Hugging Face:

                {{fetch "https://huggingface.co/api/daily_papers"}}

                Provide a concise summary of the key trends, breakthroughs, and developments in AI/ML research.
            </openai:prompt>

        </openai:generate>

    </onentry>

    <transition target="log_summary" />
</state>

<state id="log_summary">

    <onentry>

        <log label="Researcher Summary: " expr="summary" />

    </onentry>

    <transition target="done" />
</state>

<final id="done" />

</agentml>

```

We’re using this in Agentflare to add observability, cost tracking, and compliance tracing for multi-agent systems — but AgentML itself is fully open-source (MIT licensed).

Repo: https://github.com/agentflare-ai/agentml Docs: https://docs.agentml.dev

We also launched SQLite-Graph, a Cypher-compatible graph extension for SQLite, which will serve as the base for AgentML’s native memory layer. It’s also MIT licensed: https://github.com/agentflare-ai/sqlite-graph

Would love feedback from anyone building with LLM orchestration frameworks, rule-based systems, or embedded MCP tool servers… especially around how to extend deterministic patterns to multi-agent coordination.

— Jeff @ Agentflare

gwillen85 17 hours ago

You can execute the above `OPENAI_API_KEY=YOUR_API_KEY amlx run researcher.aml`