Skip to content

AxmeAI/axme-sdk-python

axme-sdk-python

Python SDK for AXME - send intents, listen for deliveries, resume workflows. Durable execution without polling or webhooks.

Alpha PyPI License

Quick Start · Docs · Examples


Install

pip install axme

Requires Python 3.11+.


Quick Start

from axme import AxmeClient, AxmeClientConfig

client = AxmeClient(AxmeClientConfig(api_key="axme_sa_..."))

# Send an intent - survives crashes, retries, timeouts
intent = client.create_intent({
    "intent_type": "order.fulfillment.v1",
    "to_agent": "agent://myorg/production/fulfillment-service",
    "payload": {"order_id": "ord_123"},
}, idempotency_key="fulfill-ord-123-001")

# Wait for resolution - blocks until done, even across process restarts
result = client.wait_for(intent["intent_id"])
print(result["status"])

Connect an Agent

for delivery in client.listen("agent://myorg/production/my-agent"):
    intent = client.get_intent(delivery["intent_id"])
    result = process(intent["payload"])
    client.resume_intent(delivery["intent_id"], result)

Human Approvals

intent = client.create_intent({
    "intent_type": "intent.budget.approval.v1",
    "to_agent": "agent://myorg/prod/agent_core",
    "payload": {"amount": 32000},
    "human_task": {
        "task_type": "approval",
        "notify_email": "approver@example.com",
        "allowed_outcomes": ["approved", "rejected"],
    },
})
result = client.wait_for(intent["intent_id"])  # waits until human acts

8 task types: approval, confirmation, review, assignment, form, clarification, manual_action, override. Full reference: axme-docs.


Observe Lifecycle Events

for event in client.observe(intent["intent_id"]):
    print(event["event_type"], event["status"])
    if event["status"] in {"RESOLVED", "CANCELLED", "EXPIRED"}:
        break

Examples

export AXME_API_KEY="axme_sa_..."
python examples/basic_submit.py

More: axme-examples


Development

python -m pip install -e ".[dev]"
pytest

Related

axme-docs API reference and integration guides
axme-examples Runnable examples
axp-spec Protocol specification
axme-cli CLI tool
axme-conformance Conformance suite

hello@axme.ai · Security · License

About

Python SDK for AXME — send intents, listen for deliveries, resume workflows. pip install axme

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages