Rivet Actors are a serverless primitive for stateful workloads. Each actor has built-in state, storage, workflows, scheduling, and WebSockets — everything needed to build the next generation of software.
import { actor } from "rivetkit";
export const chatRoom = actor({
// In-memory state, persisted automatically
state: { messages: [] },
// Type-safe RPC
actions: {
sendMessage: (c, user, text) => {
c.state.messages.push({ user, text });
c.broadcast("newMessage", { user, text });
},
},
});One Actor per agent, per session, per user — each with everything it needs built in.
Every Rivet Actor comes with:
| Feature | Description |
|---|---|
| In-memory state | Co-located with compute for instant reads and writes |
| SQLite or JSON persistence | Storage that survives restarts and deploys |
| Runs indefinitely, sleeps when idle | Long-lived when active, hibernates when idle |
| Scales infinitely, scales to zero | Supports bursty workloads, cost-efficient |
| WebSockets | Real-time bidirectional streaming built in |
| Workflows | Multi-step operations with automatic retries |
| Queues | Durable message queues for reliable async processing |
| Scheduling | Timers and cron jobs within your actor |
Rivet is one primitive that adapts to agents, workflows, collaboration, and more.
| Use Case | Description |
|---|---|
| AI Agent | Each agent runs as its own actor with persistent context and memory |
| Sandbox Orchestration | Coordinate sandbox sessions, queue work, and schedule cleanup |
| Workflows | Multi-step operations with automatic retries and durable state |
| Collaborative Documents | Real-time editing where each document is an actor |
| Per-Tenant Database | One actor per tenant with low-latency in-memory reads |
| Chat | One actor per room with in-memory state and realtime delivery |
Three options, same API. Pick what works for you.
|
Single Rust binary or Docker container. Works with Postgres, file system, or FoundationDB. docker run -p 6420:6420 rivetkit/engine |
Fully managed. Global edge network. Connects to your existing cloud — Vercel, Railway, AWS, wherever you already deploy. |
Apache 2.0. Audit the code, contribute features, run it however you want. |
Frameworks: Hono • Elysia • tRPC
Clients: JavaScript • React • Next.js