Observed since 20 Oct, 23:11 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Framework-agnostic transactional agent runtime with idempotent tool calls, saga compensations, and deterministic replay.
AgentRelay is a framework-agnostic, transactional runtime for AI agents and tool-based workflows.
It gives you:
AgentRelay is designed for “production-style” agent workflows in domains like fintech, healthcare, and operations, where you care about not double-charging users, not sending emails twice, and being able to debug and audit what an agent actually did.
Idempotent tool calls
Saga-style compensations
Deterministic replay
tool_calls table instead of calling external APIs or LLMs again.Framework-agnostic
LLM usage tracking
BudgetExceededError before spend grows unbounded.Once published to PyPI:
pip install agentrelay
from agent_relay.runtime import AgentRuntime
from agent_relay.tooling import tool
runtime = AgentRuntime.from_env()
@tool(runtime, name="charge_card", compensation="refund_card")
def charge_card(amount_cents: int, card_id: str) -> str:
# call your payment provider
return "payment-id-123"
@tool(runtime, name="refund_card")
def refund_card(amount_cents: int, card_id: str) -> None:
# undo the charge
return None
def billing_agent(event: dict) -> dict:
payment_id = charge_card(amount_cents=event["amount_cents"], card_id=event["card_id"])
return {"payment_id": payment_id}
with runtime.agent_session(name="billing", input_payload={"amount_cents": 2500, "card_id": "card-1"}) as session:
result = billing_agent({"amount_cents": 2500, "card_id": "card-1"})
session.set_output(result)
AgentRelay will connect to the database specified in AGENTTRAIL_DB_URL, AGENTTRAIL_DATABASE_URL, or DATABASE_URL. If none are set, it defaults to a local SQLite file (./agenttrail.db).
You can also build connection strings manually:
from agent_relay.db import sqlite_connection_string, mysql_connection_string
sqlite_url = sqlite_connection_string("./agenttrail.db")
mysql_url = mysql_connection_string(user="agenttrail", password="agenttrail", host="localhost", database="agenttrail")
with runtime.agent_session(
name="support_agent",
budget_limit=2.00,
compensate_on_budget_exceeded=False,
) as session:
...
from agent_relay.llm import wrap_openai_call
response = wrap_openai_call(
model="gpt-4o-mini",
input_cost_per_1k=0.15,
output_cost_per_1k=0.60,
request_payload={"messages": [{"role": "user", "content": "Hello"}]},
call=lambda: client.responses.create(model="gpt-4o-mini", input="Hello"),
)
exported = runtime.export_run(run_id)
replayed = runtime.replay_exported_json(exported, billing_agent, {"amount_cents": 2500, "card_id": "card-1"})
The demo/agent.py script shows saga compensation, idempotency, and replay patterns.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.2 | 12 Jan 2026 | 4 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Public sponsor counts have not been collected. These signals belong to the repository owner.
github · 1 observations shown. Missing days are unknown.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-21 | 0 | 2026-10-21T20:35:09.5173119Z |
Observed since 20 Oct, 23:11 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:be4126191223b7479bbfbdc756ddf67e9441a5ea993c60548be909500b132e80