# Tidebase Documentation

Tidebase is an open-source checkpoint layer for AI agents: wrap your steps, and failed runs resume from the last safe point — in your own Postgres, without moving execution into a new runtime.

It is **not** a workflow engine, queue, LLM proxy, or hosted runtime. Your code keeps running in your own app, worker, or job process. Tidebase stores checkpoints, live state, events, approval gates, and usage records around it, so the question "this run died at step 7 — is it safe to rerun?" has a reliable answer.

```typescript
import { Tidebase } from '@tidebase/sdk'

const tide = new Tidebase()

await tide.run('generate-report', { runId }, async (run, input) => {
  const plan = await run.step('plan', () => makePlan(input))
  await run.state.set({ status: 'writing', progress: 0.7 })
  return run.step('write-report', () => writeReport(plan))
})
```

Re-invoke the same workflow with the same `runId` after a crash: completed steps return their checkpointed results instantly, and execution continues at the first incomplete step.

## Guides

- [Quickstart](quickstart.md) — running in one command sequence, agent-executable
- [How to resume a failed AI agent run](how-to-resume-a-failed-ai-agent-run.md)
- [How to checkpoint AI agent workflows in Postgres](checkpoint-ai-agent-workflows-postgres.md)
- [Is it safe to rerun? The replay contract](replay-contract-is-it-safe-to-rerun.md)
- [Human approval gates for AI agents](human-approval-gates-for-ai-agents.md)
- [Fork, time travel, and snapshot agent runs](fork-and-time-travel-agent-runs.md)
- [Queues, cron schedules, and cancellation](queues-schedules-and-cancellation.md)
- [Fan out to subagents with child runs](fanout-subagents-child-runs.md)
- [Track LLM token usage and cost per run](track-llm-token-costs-per-run.md)

## Integrations

- [How to checkpoint Vercel AI SDK agents](integrate/vercel-ai-sdk.md)
- [How to checkpoint Claude Agent SDK sessions](integrate/claude-agent-sdk.md)
- [How to add durable checkpoints to Mastra agents](integrate/mastra.md)
- [Approval gates and a durable run record for any MCP agent](integrate/mcp-agents.md)
- [How to checkpoint OpenAI Agents SDK runs](integrate/openai-agents-sdk.md)
- [How to use Tidebase with LangGraph](integrate/langgraph.md)
- [How to checkpoint CrewAI crews](integrate/crewai.md)
- [How to checkpoint Pydantic AI agents](integrate/pydantic-ai.md)
- [How to run durable AI workflows behind a Next.js route](integrate/nextjs.md)
- [How to wire Tidebase into an Express app](integrate/express.md)
- [How to wire Tidebase into a Hono app](integrate/hono.md)
- [How to wire Tidebase into a FastAPI app](integrate/fastapi.md)
- [How to wire Tidebase into a SvelteKit app](integrate/sveltekit.md)

## Comparisons

- [Tidebase vs Temporal](compare/tidebase-vs-temporal.md)
- [Tidebase vs Inngest](compare/tidebase-vs-inngest.md)
- [Tidebase vs LangGraph checkpointers](compare/tidebase-vs-langgraph-checkpointer.md)
- [Tidebase vs DBOS and Restate](compare/tidebase-vs-dbos-restate.md)
- [Tidebase vs Trigger.dev](compare/tidebase-vs-trigger-dev.md)
- [Tidebase vs Hatchet](compare/tidebase-vs-hatchet.md)
- [Tidebase vs BullMQ](compare/tidebase-vs-bullmq.md)
- [Tidebase vs Cloudflare Workflows](compare/tidebase-vs-cloudflare-workflows.md)

## For AI assistants and agents

- [/llms.txt](../llms.txt) — index of these docs for retrieval
- [/llms-full.txt](../llms-full.txt) — all docs in one file
- [MCP server](../mcp-server/README.md) — inspect runs, resolve gates, and debug replay from your assistant
- [Tidebase Agent Skill](../skills/tidebase/SKILL.md) — teaches coding agents when and how to use Tidebase

## Status

Tidebase is an open-source (Apache-2.0), self-hosted alpha: Postgres-backed server, TypeScript and Python SDKs, and a Studio dashboard. API auth is opt-in via a shared `TIDEBASE_API_KEY`; without it, run in trusted local/self-hosted environments only. Repo: <https://github.com/BlueprintLabIO/tidebase>