from agentspan.agents import (
start, AgentHandle, AgentRuntime,
)
handle = start(agent, "analyze 10k records")
# process dies 4 min in — agent lives on
# reconnect from any machine, any time
handle = AgentHandle(
workflow_id="wf-f8a2c1",
runtime=AgentRuntime(),
) # picks up right where it left off@tool(approval_required=True)
def process_refund(order_id, amount):
"""Refund — needs human approval."""
...
handle = start(agent, "refund #8821")
# agent pauses, state held on server
# approve from Slack, web, or code
handle.approve()
# or handle.reject("over limit")
# resumes from the exact waiting pointfrom agentspan.agents import Agent, run
researcher = Agent("researcher", ...)
writer = Agent("writer", ...)
editor = Agent("editor", ...)
# three agents, one expression, durable
result = run(
researcher >> writer >> editor,
"state of AI agents in 2026",
)
# each step: logged · crash-safe