# Mastra + Dapr

Make your [Mastra](https://mastra.ai) agents production-ready. These tutorials show you how to add fault tolerance using Dapr.

- [Durable Workflows](https://docs.diagrid.io/getting-started/quickstarts/ai-agents?agentframework=mastra#1-log-in-to-catalyst) — Make Mastra agents immune to failures with automatic recovery and replay.

---

## Why Dapr for Mastra?

| Challenge | Dapr Solution |
|-----------|---------------|
| A crash mid-turn loses the whole turn, model calls included | **Durable workflows** checkpoint every model call and every tool call |
| A flaky tool has no retry story of its own | **Built-in retries** with exponential backoff, applied in place — the model is never re-invoked to get them |
| Multi-instance deployments risk duplicating work | **Automatic recovery** replays completed activities from history instead of re-running them |
| Custom infrastructure for each deployment | **Portable components** work anywhere |
