Agents
Run a coding agent as a durable Rivet Actor, with its tools in a separate sandbox.
Each agent on Rivet is one Rivet Actor. You define the agent once, and every key you call it with gets its own Actor, session, and sandbox.
- The agent loop runs in the Actor. Model calls, retries, and the conversation run in your backend, next to your application code, where you control credentials, permissions, and logging.
- Tools run in a separate sandbox. File and shell tools call into a sandbox such as E2B or Daytona. Nothing the agent runs executes on your worker, and your provider keys never enter the sandbox.
- Agents are durable. The Actor saves the session to its SQLite database and restores it when it wakes, so an idle agent can sleep, and a crash or deploy does not lose the conversation.
Quickstart
Run your first agent, with its tools in a sandbox.
Pi
Run the Pi coding agent as a durable Actor.
Why Rivet
Stateful agents on any infrastructure
- A live process per agent. Each agent is an Actor with its own memory and SQLite database. It keeps the session loaded between prompts and runs one prompt at a time, so two servers never race on the same agent. Nothing is rebuilt from a database or replayed from an event log on each request.
- No cloud lock-in. Rivet is open source under Apache 2.0. Use Rivet Cloud, bring your own compute, or self-host everything. Workers run on Kubernetes, AWS ECS, Railway, Render, Vercel, Google Cloud Run, AWS Lambda, or any VM.
Any harness, any model
- Bring your harness. Rivet runs existing agent harnesses, starting with Pi, instead of asking you to rewrite your agent for a new framework.
- Bring your model and keys. Use any provider the harness supports, your own API keys, or your users’ own subscriptions.
Built for scale and realtime
- Lightweight. A running Actor adds about 72 KB of memory on top of the agent’s session, and a sleeping agent uses none. Give every user, task, or thread its own agent.
- Wakes in milliseconds. A sleeping agent wakes on its next prompt in about 12 ms, instead of the seconds it takes to boot a container.
- Realtime and multiplayer. Clients connect over WebSockets and stream events as the agent works. Many users can watch and steer the same session.
- One primitive for your backend. Agents are Actors, like the rest of your Rivet app, so they call other agents and Actors directly and use the same schedules, queues, and workflows.
- Swappable sandboxes. A sandbox crash does not lose the session, and a tool call adds about 10 ms in the same datacenter.
Core
Design Patterns
Keys, subagents, agent-to-agent messages, workflows, schedules, and shared credentials.
LLM API Keys
Give agents model access with your own provider keys.
Sandboxes
Run an agent’s file and shell tools in E2B, Daytona, or your own provider.
Custom Tools
Give an agent tools that run in your backend, with your APIs and secrets.
Session Lifecycle
The events one prompt produces, and how to steer or cancel a run.
Concepts
Instructions
Set an agent’s system prompt and project rules, and add context to a single prompt.
User Subscriptions
Let your users run agents on their own Claude or ChatGPT subscription.
Observability
Trace every agent run with OpenTelemetry.
Architecture
The states an agent moves through, and what survives sleep, crashes, and deploys.
Security Model
What reaches the sandbox, where secrets live, and who can connect to an agent.