DEV Community

George Belsky
George Belsky

Posted on

I built a durable execution protocol - what if Temporal were designed for AI agents?

Every time I needed a human to approve something mid-workflow, I'd build the same glue - webhook endpoint, email sender, polling loop, Redis for state, retry logic. 200 lines before the actual business logic.

So I built AXME - an intent-based protocol (AXP) and managed service for operations that finish later. Submit once, track lifecycle, complete later - with retries, timeouts, human approvals, and delivery guarantees built in.

The question that started it

What if Temporal were designed today, knowing that half your "services" will be AI agents that need human sign-off before proceeding?

Before and after

Before (polling + webhooks + Redis job state):

response = requests.post("/generate", json=data)
job_id = response.json()["job_id"]
while True:
    status = requests.get(f"/status/{job_id}")
    if status.json()["done"]:
        break
    time.sleep(5)
Enter fullscreen mode Exit fullscreen mode

After (intent lifecycle):

intent_id = client.send_intent(to="agent://my-corp/report-service", ...)
result = client.wait_for(intent_id)  # real-time SSE, no polling
Enter fullscreen mode Exit fullscreen mode

4 lines. AXME handles routing, delivery, retries, timeouts, reminders, and human approval gates.

What I built

  • 5 SDKs: Python, TypeScript, Go, Java, .NET
  • CLI with 30+ built-in runnable examples
  • MCP server with 28 tools for AI assistant integration
  • 8 human task types: approval, form, review, override, confirmation, assignment, clarification, manual action
  • 5 delivery modes: SSE stream, poll, HTTP webhook, inbox, internal runtime

How it compares

DIY (webhooks + polling + Redis) - about 200 lines of code, you operate everything yourself. Retry logic scattered, state management manual, human approval breaks the chain.

Temporal - about 80 lines, powerful but you run a Temporal cluster, deal with determinism constraints, and need a dedicated platform team.

AXME - 4 lines, managed service, nothing to operate. No determinism constraints, no workflow engine to run.

Not a Temporal replacement - different model. Intent lifecycle instead of replay-based execution. Simpler for the 80% of cases where you need "do thing, maybe ask human, finish later."

The simplest workflow - one JSON file

{
  "agents": [{"address": "my-service", "delivery_mode": "stream"}],
  "workflow": {
    "steps": [{"step_id": "process", "assigned_to": "my-service"}]
  },
  "intent": {"type": "task.v1", "payload": {"data": "..."}}
}

axme scenarios apply scenario.json --watch
Enter fullscreen mode Exit fullscreen mode

This provisions agents, compiles the workflow, submits the intent, and streams lifecycle events - all in one command.

Architecture

Runs on GCP with 5 Cloud Run services:

  • Gateway (FastAPI, async) - routing, auth, rate limiting
  • Agent-Core - SSE delivery streams, agent lifecycle
  • Worker - step scheduling via Cloud Tasks with retry
  • MCP Server - 28 tools for AI assistants
  • Auth - email OTP, JWT sessions

Pub/Sub for event fan-out, Cloud Tasks for scheduled delivery, PostgreSQL for state, BigQuery for archive. No Redis, no Kafka.

Try it

curl -fsSL https://raw.githubusercontent.com/AxmeAI/axme-cli/main/install.sh | sh
axme login
axme examples run human/cli
Enter fullscreen mode Exit fullscreen mode

Working in 5 minutes.

Links

Solo founder. Built the entire stack - protocol, gateway, scheduler, 5 SDKs, CLI, MCP server, Cloud Run deployment. Alpha stage - looking for feedback and early adopters.

If you're building AI agent workflows with human-in-the-loop, I'd love to hear about your use case.

Top comments (0)