Trigger.dev chat agent icon

Trigger.dev chat agent

Trigger.dev chat agent is a durable AI chat backend for stateful conversations that survive refreshes, crashes, and long-running turns with AI SDK useChat.

Trigger.dev chat agent

Overview

Trigger.dev chat agent is a durable AI chat backend for building stateful conversations that continue across turns, refreshes, and crashes. It runs each conversation on a machine with no timeouts, sleeps when idle, and wakes when new messages arrive, so the agent can keep its state without requiring you to manage separate request, queue, or cache layers.

The product is built for developer workflows that use the AI SDK. The changelog example shows a `chat.agent()` task that returns `streamText`, and the backend documentation says the same wire protocol works with the `chat.agent()`, `chat.createSession()`, and raw-primitives approaches. Trigger.dev Cloud pricing also shows managed infrastructure, usage-based compute, and a free plan alongside paid tiers.

Core capabilities

Stateful conversation runtime

Keeps a conversation attached to a stateful machine instead of a single HTTP request, so the agent can pause and continue across turns without rebuilding state in a database each time.

Frontend-to-backend wiring

Streams responses directly through the AI SDK and `useChat`, with no API route required between the frontend and the chat backend.

Durable execution and stream recovery

Supports long-running turns with no timeout, durable streams, and crash recovery so an interrupted chat can resume on the next message.

Conversation-scoped memory

Preserves in-memory state for the duration of a conversation, which can be useful for caches, variables, and sub-agents that need to persist across turns.

Observability for agent runs

Includes built-in tracing, metrics, and an AI metrics dashboard for cost, token, and latency visibility.

Configurable machine sizing

Offers machine presets from micro upward, with dedicated CPU, memory, and disk and the ability to choose the size per agent or override per conversation.

Practical use cases

  • Long-lived customer or assistant chats

    Use `chat.agent()` when you want a chat UI that can disconnect and return later without losing state, because the conversation lives on a durable machine rather than a request handler.

  • Slow, multi-step agent workflows

    Use the backend for tool-heavy agents that may take longer than a normal server request, including workflows with multiple steps, stop signals, or sub-agents.

  • AI SDK chat interfaces

    Use the AI SDK integration when you already have a frontend built around `useChat` and want to connect it directly to a Trigger.dev-backed conversation.

  • Stateful conversational memory

    Use the runtime when you need conversation-scoped memory for caches or intermediate data that should survive between turns but still reset with a new conversation or crash recovery.

  • Custom backend control

    Use the lower-level backend options when you need manual control over turn code, persistence, telemetry, or custom stream conversion beyond the default agent flow.

Pros and Cons

Pros

  • Built for chats that need to survive refreshes, crashes, and long pauses without losing conversation identity.
  • No timeout on a turn, which helps with slow model calls, tool chains, and sub-agents that need time to think.
  • Integrates with the AI SDK and can stream directly to `useChat`, reducing backend glue code.
  • Provides built-in observability for debugging and cost tracking across turns.
  • Offers a progression from high-level `chat.agent()` to lower-level primitives when a project needs more control.

Cons

  • The most advanced control paths, such as raw primitives or custom stream conversion, require moving beyond the highest-level `chat.agent()` API.
  • The durable model is designed around Trigger.dev's managed workers and chat-specific runtime, so teams that want a plain stateless endpoint may need to adapt their architecture.
  • Pricing for larger-scale usage can include both compute time and per-run invocation costs, so usage planning matters.

FAQ

What is chat.agent() used for?

It is a Trigger.dev AI chat backend built around a durable `chat.agent()` task. The conversation runs on a machine with no timeouts, and the frontend can connect with the AI SDK `useChat` flow without an API route in between.

How does a basic chat setup work?

The changelog shows `chat.agent()` returning a `streamText` result from the task `run` function, and the backend docs note that it handles message accumulation, stop signals, turn lifecycle, and auto-piping automatically.

Does chat.agent() recover after a refresh or crash?

The announcement says the conversation state can survive refreshes and crashes, and the backend docs describe automatic continuation recovery on new runs for `chat.agent()`.

How is Trigger.dev priced?

Trigger.dev pricing is tiered: there is a Free plan, a Hobby plan, a Pro plan, and an Enterprise plan with custom pricing. The pricing page also shows usage-based compute and per-run invocation charges.

Can Trigger.dev be self-hosted?

The pricing page says Trigger.dev can be self-hosted, and the changelog notes that chat.agent runs on managed infrastructure while the underlying machine is a real Linux machine.

Quick Facts

Category
Developer Tool / AI Chat
Product
Trigger.dev chat agent
Platform
Managed cloud with self-hosting support
Primary users
Developers building durable AI chat and agent workflows
Website
trigger.dev
Pricing model
Free and paid plans with usage-based compute and run charges