Agents that survive
crashes and pauses.

An async-first runtime where agents call tools, remember across sessions, pause for human approval, and resume after a process restart — without you writing any of that infrastructure. Durable execution, event-sourced, like Temporal — scoped to LLM agents.

Read docsGitHub
$uv add agent-substrate
Postgres-journaled
Zero-cost suspension
No double-sends
Case: Payment workflow crash
Step 1/7
agent.py
In-Memory
$ python agent.py
Result: Lost state & double spend
substrate.log
Durable
$ substrate run payment.agent
Result: Exact step recovered
BUILD YOUR AGENTS
01

Not just a prompt wrapper. A resilient runtime engine for real-world agents.

Sandboxed tool chaining, autonomous subagent swarms, long-term memory compaction, security guardrails, and dynamic code interpretation.

Tool Chaining. Script multiple tools in one sandboxed turn, piping large data by ref with 0 round-trips.
SANDBOX CHAIN
DATA BY REF
# Pipe data with 0 round-trips
res = tools.query_db("events")
summary = tools.analyze(res)
return summary.report
1 Execution Turn92% fewer calls
Subagent Teams. Coordinate specialized ReAct and Orchestrator agents that delegate tasks autonomously.
HIERARCHYSUPERVISED
Orchestrator
researcher
coder
Priority delegationAuto-handoff
Long-Term Memory. Postgres & Redis history with vector recall and smart token budget compaction.
MEMORY STORE
-87% TOKENS
Raw Turn History14,200 tok
Compacted State1,840 tok
Sliding + LLM SummaryPostgres + Redis
Guardrails Middleware. Pre/post turn pipeline stopping prompt injections and redacting sensitive PII in real time.
SAFETY PIPELINE
TRIPWIRE
PII (SSN/Email)REDACTED
Prompt InjectionBLOCKED
Tool SchemaVALIDATED
Pre & Post TurnZero Leakage
Code Interpreter. Synthesize and execute Python on the fly when no pre-built tool matches the task.
CODE INTERPRETER
ZERO-EGRESS
# Fallback: No tool found
↳ synthesize & run script
import polars as pl
df = pl.read_csv("data.csv")
Isolated Sandbox<15ms Boot
Platform primitives:MCP GatewayVisual BuilderHuman GovernanceMulti-Model RouterEvals Fabric
Zero prompt-chain glue code needed
OPERATE IN PRODUCTION
02

Built for mission-critical operations. Run agents with complete safety, budget control, and reliability.

Automatic crash recovery, hard spend ceilings, zero-cost pauses for human approvals, and full step-by-step activity visibility.

Crash Protection. If a server restarts mid-task, resume instantly with saved state and 0 duplicate tool calls.
FAILOVER RECOVERY
INSTANT RESUME
Step 1: Parse instructionsSAVED
Step 2: Query databaseSAVED
Server restartedResumed at Step 3
Zero lost progress0 duplicate API calls
Spend & Loop Caps. Hard dollar limits per task that auto-halt runaway tool loops before surprise cloud bills.
BUDGET SAFETY
ACTIVE GUARD
Task Cost Ceiling$5.00 limit
Current Task Cost$1.73
No surprise billsAuto-halt armed
Zero-Cost Pauses. Pause for human approvals or webhooks with 0% CPU and $0 server cost, waking instantly.
APPROVAL GATE
$0.00 / HR
StatusAWAITING APPROVAL
Server Resources0% CPU · 0 MB RAM
Idle DurationDays or weeks safe
Zero idle costInstant wake-up
Execution Timeline. Transparent activity log showing every prompt, tool query, latency, and exact token cost.
ACTIVITY TIMELINE
FULL AUDIT
1. User request parsed0.2s · $0.01
2. Query analytics DB0.18s · $0.00
3. Generate report1.1s · $0.04
Full step visibilityExact cost per step
Operational guarantees:Crash ProtectionHard Spend LimitsZero-Cost PausesLoop Auto-HaltFull Audit Trail
Learn how Substrate protects your production budget
SYSTEM ARCHITECTURE
03

Layered for modularity and isolation. From pure kernel contracts to production fabric.

A 4-tier subsystem hierarchy engineered for strict separation of concerns, zero circular dependencies, and isolated runtime execution.

SUBSTRATE HIERARCHY
TOP → FOUNDATION
L2 - S1
APPEND-ONLY TRUTH

Infrastructure Substrate

Durable state of truth and messaging backbones: immutable append-only PostgreSQL event journaling, Redis hot caches for active turn state, and native OpenTelemetry distributed tracing.

CORE SUBMODULES4 COMPONENTS
infrastructure.database
Append-only PostgreSQL WAL enabling <10ms failover recovery.
infrastructure.cache
Redis hot cache for active turn state and sliding token memory.
infrastructure.runtime.backends
Asynchronous signal bus and pub/sub event fanout.
infrastructure.observability
Native W3C distributed trace spans and metric emitters.
PYTHON API CONTRACTSTRICT SIGNATURES
# L2-S1: Append-Only Event Journal & Telemetry
from substrate.infrastructure.database import DurableJournal
from substrate.infrastructure.observability import configure_otel

# Durably commit turn to PostgreSQL WAL before leasing worker compute
journal = DurableJournal("postgresql+asyncpg://acme_db")
await journal.append_event(thread_id="thr_4910b8", event_type="USER_MESSAGE")

# Stream native spans to Datadog or Honeycomb with zero SDK overhead
configure_otel(service_name="agent-substrate", trace_ceiling=5.0)
Consumes L0 · Isolated Persistence
Zero Circular Dependencies
Architectural invariants:Zero Circular ImportsDecoupled Compute & StateImmutable KernelPluggable SuperpowersW3C Distributed OTel
Explore complete subsystem specification
HONEST & FLEXIBLE ACCESS

Open source at the core. Simple credit-based cloud.

Run it yourself for free, try the live demo on us, buy credits to talk more without managing infrastructure, or partner with us for bespoke enterprise solutions.

MIT Licensed
OPEN SOURCE

Run Locally (Free)

100% open source under MIT. Deploy on your laptop, Docker, or Kubernetes with zero platform limits.

Free Trial
LIVE DEMO

Try in Browser

Test the agent runtime instantly in the web chat with complimentary starter credits. No credit card needed.

Most Flexible
PAY-AS-YOU-GO

Buy Credits to Scale

Top up flexible credit packs or connect BYOK to run longer conversations, tool chains, and background jobs.

Custom Solutions
BESPOKE

Consulting & Sales

Need custom agent architecture, private VPC deployment, or bespoke tools? Work directly with our engineering team.