Build reliable
chat agents
Build chat agents in TypeScript with no timeouts. Keep state between turns, sleep while idle, and let users pick up the conversation after a refresh.
16 reasons to use chat agent
Your chat survives refreshes, deploys and crashes
Refresh the page or come back after a crash. Your conversation is still there. Deploys leave existing chats on the version they started on.
The whole backend is one function
Use chat.agent with streamText on the backend and useChat from the AI SDK on the frontend.
Used in production at scale
Every LLM call is traced
Turns, tool calls and model requests land in a trace automatically, with logs and metrics alongside them. Export everything through OpenTelemetry.
Every LLM call is traced
Turns, tool calls and model requests land in a trace automatically, with logs and metrics alongside them. Export everything through OpenTelemetry.
See spend and token usage across every run
Query input and output tokens, cost and latency by task, model or prompt version.
Prompts are versioned
Manage your system prompt as versioned config with typed variables. Override it without a deploy, and link every LLM call to the version that produced it.
Write agents that coding agents understand
Write your agents in plain TypeScript. Coding agents already know how. Use normal loops and API calls, without structuring your code around replay rules.
Durable streaming out of the box
Refresh mid-response and the stream picks up where your browser stopped reading, without re‑running the model.
Build rich experiences
An agent can do more than reply. Build dashboards, canvases, and creative tools that users can shape as they go.
A real Linux machine per agent
Run ffmpeg, a headless browser, or any CLI that expects a real filesystem and process tree.
A condensed replay of recorded FFmpeg output illustrates the transcode tool in a Trigger.dev chat agent. A six-second input video is encoded to an H.264 MP4 file. This is not a render-speed benchmark.
No timeout on a turn
A single turn can run as long as it needs to, including slow tools and sub-agents that think for minutes, hours, or even days.
Pause for human approval
Let your agent do the work. Bring in a human when it matters, then pick up exactly where you left off.
Keep state between turns
Each conversation gets a long-lived process that keeps variables, caches and working state in memory between turns.
Five chat.agent sessions, each with its own working memory. Incoming messages wake each session's suspended run. It calls a tool, then streams a reply back out. The same working memory is retained through sleep and resume, shown by the unchanged pattern of memory blocks. Compute sleeps again after replying and waiting for another message. A session can span multiple runs; this animation shows the same run resuming, rather than a new run starting.
Sitting idle is free
A suspended agent costs nothing while it waits. Come back days later with a new message and the conversation picks up where you left off.
Start simple, take control when you need to
Begin with chat.agent, which handles the turn loop, approvals and recovery. When you need more, own the loop with createSession and keep the frontend unchanged.
Deploys don't interrupt a conversation
A run continues on the version it started on. Call chat.requestUpgrade() to move a chat to a new version when you choose.
| Deploy | Version | Status |
|---|---|---|
h7kp9mCurrent | 20261016.3 | Deployed |
f3nx2q | 20261016.2 | Deployed |
d8wr4v | 20261016.1 | Deployed |
c2mt6b | 20261015.2 | Deployed |
a9js5r | 20261015.1 | Deployed |
Use any model or any framework
Bring the AI SDK and any provider you like, or your own loop.
Open source under Apache 2.0
chat.agent lives in the Apache 2.0 repository alongside the rest of the platform. Read the exact code that keeps a conversation alive through a crash, or self-host the whole thing.

