Build durable AI agents in Convex that survive failures, restarts, and execute tool calls asynchronously without time limits.
npm install convex-durable-agentsA Convex component for building durable AI agents with an async tool loop. The goal of this component is to provide a way to build AI agents that can run indefinitely and survive failures and restarts. It provides some of the functionality of the Convex Agents Component (such as persistent streaming), while deliberately leaving out some of the more advanced features (context management, RAG, rate limiting, etc.). The component is built on top of the AI SDK v6 and aims to expose its full streamText API with persistence and durable execution.
Note: This component is still in early development and is not yet ready for production use. The API will very likely change before a first stable release.
Features#
Async Execution: Agent tool loop is executed asynchronously to avoid time limits of convex actions
Tool Execution: via convex actions - support for both sync and async tools
Automatic Retries: Failed tool calls are automatically retried (opt-in)
Durable Execution: Agent tool loops survive crashes and dev server restarts
Workpool Support: Optionally route agent and tool execution through @convex-dev/workpool for parallelism control
The Durable Agents Component for Convex provides persistent state management and automatic recovery for AI agent workflows. When your server restarts or crashes, the component automatically resumes agent execution from the last saved state, ensuring no work is lost.
This component executes AI agent tool loops asynchronously, bypassing Convex action time limits. Instead of running everything in a single action, it breaks down agent execution into smaller, manageable chunks that can run indefinitely.
The component includes automatic retry logic for failed tool calls. You can enable opt-in retries that will automatically re-execute failed tools, with configurable retry policies to handle transient failures in your AI agent workflows.
The Durable Agents Component for Convex is currently in early development and not recommended for production use. The API is likely to change significantly before the first stable release, so expect breaking changes during development.
The Durable Agents Component focuses specifically on persistence and durability while deliberately omitting advanced features like context management, RAG, and rate limiting found in the official component. It exposes the full AI SDK v6 streamText API with added persistence and fault tolerance.
The Durable Agents Component for Convex is built on top of AI SDK v6 and aims to expose its complete streamText API. This ensures compatibility with the latest AI SDK features while adding persistence and durable execution capabilities.
Yes, the Durable Agents Component supports optional integration with @convex-dev/workpool for parallelism control. This allows you to route agent and tool execution through a workpool to manage concurrent agent workflows effectively.