Anchor — the Durable Execution Engine for Mission-Critical AI Agents
Description and use
Anchor delivers crash‑proof execution for multi‑step AI agents by atomically journaling side‑effects in PostgreSQL, fencing epochs, and providing a human‑review queue for unsafe tools. It eliminates duplicate token costs, double billing, and high infrastructure taxes.
Problem
AI agents executing multi‑step workflows crash due to OOM, redeploys, spot preemption, or network drops, causing duplicate side‑effects, lost state, and wasted token costs.
Outcome
Anchor reduces duplicate token costs by >$12k/month, eliminates double‑billing and spam, and removes the $5k+ infrastructure tax of external orchestrators. It achieves sub‑second recovery and guarantees idempotent side‑effects.
Workflow
- 1. Install Anchor:
pip install anchor-runtime anchor dev - 2. Define tools with
@anchor.tool(specify safety and idempotency) - 3. Define an agent with
@anchor.agentand yieldanchor.ToolCallfor each step - 4. Run the agent; Anchor writes TOOL_INTENT and TOOL_RESULT entries to PostgreSQL
- 5. On crash, a secondary worker acquires the lease, checks the journal, and replays completed steps
- 6. If a tool was unsafe and crashed mid‑execution, Anchor sets run to
needs_review; operators resolve viamark_executedormark_not_executed
Evidence
Unmanaged retries waste over $12,400/month in duplicate prompt tokens
Anchor atomically writes a TOOL_INTENT journal entry to PostgreSQL
If a worker process dies mid‑execution, the secondary worker checks the journal on recovery—replaying completed steps in <5ms
- Record date: 2026-09-08T06:14:45.101Z