Skip to main content
Back

Trigger.dev's chat.agent Rebuilds AI Chat So Every Conversation Gets Its Own Machine

Trigger.dev shipped chat.agent, a durable primitive that gives every conversation its own long-running Linux machine that sleeps between turns and survives crashes.

Repo, Full Access
  • chat.agent gives every conversation a durable Linux machine that survives refreshes, redeploys, and crashes.
  • A tool with no execute function suspends the run until a human replies, and waiting is billed at zero.
  • Head Start runs the first LLM call in your warm server while the durable agent boots, roughly halving time to first token.
  • The MCP server 2.1 lets Claude Code or Cursor chat with deployed agents and manage prompt versions.
  • Every project ships with an AI metrics dashboard for spend, tokens, latency, and cache savings, queryable via TRQL.
  • Apache 2.0 and open source, with 14.6k GitHub stars and self-hosting supported.

Trigger.dev has been quietly rebuilding what a chat backend looks like, and the result is now live in its open-source repo. The company shipped chat.agent, a new primitive where every conversation gets its own stateful machine that keeps running for the entire session, sleeps when nobody is typing, and picks up exactly where it left off. It arrived alongside an upgraded MCP server that lets coding assistants like Claude Code or Cursor drive those agents directly.

Trigger.dev development interface

One machine per conversation, not one request per message

The core idea behind chat.agent rejects the request/response model for LLM chat. Multi-turn AI conversations become durable tasks that resume across refreshes, redeploys, and crashes, so you can build agents without stitching together the usual infrastructure.

You write the turn as a Trigger.dev task that takes messages and returns a stream, then point the Vercel AI SDK's useChat hook straight at it, with no API route in between. The backend for a full chat becomes about a dozen lines:

import { chat } from "@trigger.dev/sdk/ai";
import { streamText, stepCountIs } from "ai";
import { anthropic } from "@ai-sdk/anthropic";
export const myChat = chat.agent({
  id: "my-chat",
  run: async ({ messages, signal }) => {
    return streamText({
      model: anthropic("claude-sonnet-4-5"),
      messages,
      abortSignal: signal,
      stopWhen: stepCountIs(15),
    });
  },
});

Why request/response falls apart for agents

Anyone who has shipped an LLM feature knows the workarounds: writing intermediate state to Postgres, using Redis for durable streams, offloading slow work to background queues, and gluing it all back together. A real machine with real memory turns out to fit the problem better.