---
name: bijection-durable-agents
description: "Evaluate and integrate the Durable Agents component with Bijection."
---

# Durable Agents

Durable agent execution

- Package: @bijectionhq/durable-agents
- Category: AI & Agents
- Status: Reference
- License: Apache-2.0
- Bijection source (repository access required): https://github.com/bijectionhq/durable-agents/tree/6322213b09dc69d3c9c82ab465ca30fbcb7d2070
- Upstream: https://github.com/ziegfried/convex-durable-agents/tree/85959879a9d61a5b85b1eb543531606277e071b4
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/durable-agents

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/durable-agents.git
cd durable-agents
git checkout 6322213b09dc69d3c9c82ab465ca30fbcb7d2070
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Integration workflow

1. Read the source README and package manifest at the recorded revision.
2. Confirm the required SDK, dependency availability, and runtime compatibility.
3. Follow the component's documented setup and configuration. Never invent an npm install command from a catalog package name.
4. Keep credentials in the project's existing secret store.
5. Follow the project's execution rules for verification and report what was actually checked.

## Original upstream skill

The following guidance describes convex-durable-agents. Its installation commands and APIs refer to the upstream package. Evaluate compatibility with the Bijection source separately.


> Agents: read this skill fully before writing code that uses Durable Agents. Follow the installation and configuration steps exactly.

# Durable Agents

## Instructions

This component provides durable AI agents that can run indefinitely and survive server restarts or failures. Built on AI SDK v6, it executes agent tool loops asynchronously to avoid Convex action time limits while maintaining persistent streaming and automatic retries. Agents can call external APIs through Convex actions and optionally route execution through workpools for parallelism control.

### Installation

```bash
npm install convex-durable-agents
```

Current npm version: `convex-durable-agents@0.2.6`

## Use cases

- **Long-running AI workflows** that need to survive dev server restarts and production failures without losing conversation state
- **AI agents with external API calls** that require automatic retry logic and durable execution when tools fail or timeout
- **Multi-step agent tasks** that exceed Convex action time limits by running tool loops asynchronously with persistent state
- **Production chatbots** that need real-time streaming with message persistence and the ability to resume interrupted conversations
- **Background AI processing** where agents need to continue working even when the user disconnects or the browser closes

## How it works

The component wraps AI SDK's `streamText` API with Convex's durable execution model. You define agents using `streamHandlerAction` with your language model and tools, then export a complete API using `defineAgentApi` for public access or `defineInternalAgentApi` for server-only access.

Tools are implemented as Convex actions using `createActionTool` for synchronous results or `createAsyncTool` for background processing. The component handles automatic retries with configurable backoff strategies and can route execution through `@convex-dev/workpool` for parallelism control.

Real-time streaming works through `streamUpdates` queries that deliver message deltas to React components via the `useAgentChat` hook. Thread state persists across failures, allowing agents to resume exactly where they left off using `resumeThread`. Authorization callbacks protect thread access, and the component maintains full conversation history with support for both user messages and tool execution results.

## When NOT to use

- When a simpler built-in solution exists for your specific use case
- If you are not using Convex as your backend
- When the functionality provided by Durable Agents is not needed

## Resources

- [npm package](https://www.npmjs.com/package/convex-durable-agents)
- [GitHub repository](https://github.com/ziegfried/convex-durable-agents)
- [Live demo](https://github.com/ziegfried/convex-durable-agents/tree/main/example)
- [Convex Components Directory](https://www.convex.dev/components/durable-agents)
- [Convex documentation](https://docs.convex.dev)