⚡ Supreme AI Reliability Infrastructure · PyPI v0.1.8

The supreme transactional engine for autonomous AI agents.

From hobby builders and indie coders to high-precision medical examination, banking settlements, and flight control — agent-saga v0.1.8 guarantees 99.999% reliability with pre-flight safety gates, anti-hallucination reality anchors, OpenTelemetry & LangSmith tracing, GitHub/AWS/Slack connectors, and automatic LIFO rollbacks.

$pip install agent-saga
Test Custom Input Sandbox → View Documentation Star on GitHub
Write-Ahead Log (WAL v0.1.8) SAGA_LIVE · 99.999% Grounded
001SAGA_START user_tenant_402reversible
002REALITY_ANCHOR verify_dosage3/3 consensus
003STEP_COMMITTED github.create_prcompensable
004PRE_FLIGHT_GATE intercepted errorblocked
005COMPENSATED github.close_pr↺ auto-reverted

Universal Spectrum Coverage

From Hobby Makers & Coders to High-Precision Aerospace.

Whether building an indie side project, auto-refactoring code, executing $10M banking transfers, or diagnosing patient treatments, agent-saga powers mission-critical reliability everywhere.

Hobbyists & Makers 🛠️

IoT & Hardware Robotics

Enforces hardware actuator angle limits and battery voltage bounds, preventing physical servo burnout or runaway robot motor commands.

Coders & Software Engineers 💻

GitHub & Cloud Infrastructure

Plug-and-play GitHub/GitLab PR auto-reverts and AWS/GCP/K8s infrastructure auto-cleanup if deployment or coding agent tasks fail.

Banking & FinTech 🏦

High-Value Wire & Billing

Enforces 3/3 Triple Redundant Consensus before executing multi-million dollar transfers, preventing hallucinated refunds or duplicated wire charges.

Medical & Healthcare 🩺

Prescription & Diagnosis Safety

Intersects LLM treatment recommendations against strict clinical boundary range rules (0.1mg - 50mg), blocking lethal medication overdose attempts pre-flight.

Observability & Tracing 📊

LangSmith, Phoenix & OTEL

Stamps Saga UUID and prompt context into OpenTelemetry spans and LLM trace providers, linking hallucinated prompts directly to rollback causes.

Risk Team Dashboard 🛡️

Interactive Web UI & Replay

Clean Web UI (agent-saga ui) and CLI Time-Travel Replay (agent-saga replay <id>) for risk teams to inspect, approve, or debug failed sagas.

Interactive Practical Playground

Practically test your own input data: Before vs. After agent-saga.

Type custom input parameters below. Use the prominent toggle switch to compare how raw AI models crash and corrupt data (BEFORE) versus how agent-saga verifies and auto-restores state (AFTER).

● MODE: AFTER (+ agent-saga v0.1.8 Active Protection)
Toggle OFF to test Raw AI Failure Mode
PROTECTION: ON (+ agent-saga)
REAL-TIME TRANSACTION EXECUTION LOG (WAL v0.1.8) READY
Enter your custom parameters on the left and click Execute AI Simulation.

Engineered Innovations

Click any feature to inspect its live code payload & architecture.

📊 OpenTelemetry & LangSmith Tracing

Binds Saga UUIDs to OpenTelemetry spans, LangSmith runs, and Phoenix traces, identifying the exact prompt context that caused a transaction rollback.

Click to inspect code →

🔌 Expanded Native Connectors

Plug-and-play safety connectors for GitHub PR/Commit auto-revert, AWS/GCP/K8s infra auto-cleanup, and Slack/Discord message redactions.

Click to inspect code →

🛡️ Dynamic AI Risk Policies

Evaluates anomaly risk scores in real-time. If an anomaly score exceeds threshold, spend limits dynamically scale down and escalate to human review.

Click to inspect code →

🗄️ Relational Postgres Approval Store

Stores pending human approvals directly in PostgreSQL (PostgresApprovalStore) for enterprise risk teams without requiring Redis infrastructure.

Click to inspect code →

⏳ Time-Travel Debugging & Replay

Run agent-saga replay <saga_id> to simulate historical failed sagas locally from WAL data without touching live production APIs.

Click to inspect code →

💻 Risk Team Dashboard (agent-saga ui)

Out-of-the-box web UI server (agent-saga ui) providing risk teams with visual approval queues, token auth, and live trace inspection.

Click to inspect code →

Developer Documentation

Quickstart & Integration Reference.

Get started in 30 seconds. Wrap your agent loops in a single decorator or context manager.

1. Installation

pip install agent-saga

2. OpenTelemetry & LangSmith Tracing Setup

from agent_saga.observability import setup_telemetry, link_llm_trace # Enable OpenTelemetry tracing setup_telemetry() # Link LLM prompt trace to Saga UUID link_llm_trace(saga_id="saga_123", trace_id="tr_9988", prompt_context="Refactor payment engine")

3. GitHub & Cloud Connector Safety

from agent_saga.connectors import GitHubConnector, CloudConnector gh = GitHubConnector() pr = await gh.create_pull_request(repo="org/app", title="Auto Patch", head="fix-branch") # Auto-closes PR if downstream step fails!