Anchor — the Durable Execution Engine for Mission-Critical AI Agents
说明与用途
Anchor 通过在 PostgreSQL 中原子记录侧效,使用时代令牌防止分裂大脑写入,并为不安全工具提供人工审核队列,实现多步骤 AI 代理的容错执行,消除重复计费、重复邮件和高昂的基础设施成本。
问题
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.
结果
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.
工作流
- 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
证据
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
- 记录日期: 2026-09-08T06:14:45.101Z