⚡ Supreme AI Reliability Infrastructure · PyPI v0.2.3

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.2.3 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.2.3) 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.2.3 Active Protection)
Toggle OFF to test Raw AI Failure Mode
PROTECTION: ON (+ agent-saga)
REAL-TIME TRANSACTION EXECUTION LOG (WAL v0.2.3) 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.

☁️ Self-Hosted Control Plane (cloud-server)

Run your own control plane backend (agent-saga cloud-server) matching the sagaops.dev SaaS REST API for audit ingest, approvals, and fleet budget sync.

Click to inspect code →

📐 BPMN 2.0 Visual Workflow Designer

Interactive web canvas tab on the dashboard to visually design agent compensation flows and export typed @saga_scope Python code in 1 click.

Click to inspect code →

🧪 Standalone pytest-agent-saga Package

Dedicated Pytest companion package (pip install pytest-agent-saga) providing isolated WAL fixtures, multi-point chaos runners, and deterministic replay assertions.

Click to inspect code →

🛡️ Array & Dotted Redaction (redact_path)

Surgically mask nested fields including list indices (e.g. redact_path(records, "kwargs.items.0.cvv")) without writing custom lambda functions.

Click to inspect code →

🔄 Multi-Turn Agent Self-Healing Loop

Bounded correction loop (SelfHealingLoop) that feeds gate refusal reasons back to the agent with exponential backoff and human escalation fallback.

Click to inspect code →

🧠 Zero-Config Embedding Risk Scorer

Dynamic anomaly risk scoring against known-bad tool calls (EmbeddingRiskScorer) with zero external dependencies and offline execution.

Click to inspect code →

💬 Slack OAuth & Slash Command Integration

Interactive Slack Block Kit app with OAuth URL construction (build_oauth_install_url) and /saga-approve slash command handling.

Click to inspect code →

📊 OpenTelemetry & LangSmith Tracing

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

Click to inspect code →

💻 Protected Web Dashboard (agent-saga ui)

Web UI dashboard serving visual approval queues, SSE live WAL streaming, spend limit gauges, and token authentication.

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!