rivet: The orchestrator for agentic workloads.
What problem it solves
Agentic workloads often need durable state, live client connections, scheduling, and fault-tolerant execution. Rivet addresses these needs with long-lived Actors that can represent individual agents, users, sessions, tenants, workflows, or applications.
Key features
Stateful Actors — Each Actor combines a long-lived process with in-memory state, durable SQLite storage, WebSockets, and scheduling. Actors can represent agents, users, sessions, tenants, or other workload-specific units.
Source: README
Realtime Actor Communication — Clients can call Actors over HTTP or maintain live WebSocket connections. Actors can broadcast events to connected clients and call other Actors by key across the cluster.
Source: README
Fault Tolerance and Scheduling — Actors retain their state when a node goes down and can move elsewhere. Cron and scheduling can wake an Actor at a specified time or on a schedule.
Source: README
Typed Client Ecosystem — The project provides typed clients for backend applications and React hooks for frontend applications. Actors run on native Node.js and Bun without requiring a custom runtime.
Source: README
Flexible Deployment — Rivet supports local development, self-hosted production deployments, managed cloud clusters, and deployments into a customer VPC. Object storage is the only stated infrastructure dependency for deployment.
Source: README
Quick start
Copied verbatim from the project's README.
Run npx skills add rivet-dev/skills, then ask me what to build and run it locally.// server.ts
import { actor, setup } from "rivetkit";
import { db } from "rivetkit/db";
import { streamText } from "ai";
import { openai } from "@ai-sdk/openai";
// One Actor per agent, created on first use: agent.getOrCreate(["agent-123"])
export const agent = actor({
// 1. SQLite: every agent has its own database, so history survives restarts
db: db({
onMigrate: async (db) => {
await db.execute("CREATE TABLE IF NOT EXISTS messages (role TEXT, content TEXT)");
},
}),
// 2. In-memory state: plain variables that live with the Actor, with no database round trip
createVars: () => ({ online: new Map<string, string>() }),
// 3. WebSockets: each client holds a live connection, and the Actor pushes to all of them
onDisconnect: (c, conn) => {
c.vars.online.delete(conn.id);
c.broadcast("online", [...c.vars.online.values()]);
},
actions: {
join: (c, user: string) => {
c.vars.online.set(c.conn.id, user);
c.broadcast("online", [...c.vars.online.values()]);
},
sendMessage: async (c, text: string) => {
// Save the message
await c.db.execute("INSERT INTO messages VALUES (?, ?)", "user", text);
const messages = await c.db.execute("SELECT role, content FROM messages");
// Stream tokens to every connected client
const response = streamText({ model: openai("gpt-5"), messages });
for await (const delta of response.textStream) {
c.broadcast("token", delta);
}
// Save the response
await c.db.execute("INSERT INTO messages VALUES (?, ?)", "assistant", await response.text);
},
},
});
export const registry = setup({ use: { agent } });// client.ts (frontend or backend)
import { createClient } from "rivetkit/client";
import type { registry } from "./server";
const client = createClient<typeof registry>();
// Open a WebSocket connection to the agent
const agent = client.agent.getOrCreate(["agent-123"]).connect();
// Listen for realtime events
agent.on("online", users => console.log("online:", users));
agent.on("token", delta => process.stdout.write(delta));
// Call actions on the Actor
await agent.join("nathan");
await agent.sendMessage("how many r's in strawberry?");Who it may suit
Inference: may suit developers building durable AI agents, multiplayer applications, multi-step workflows, collaborative editors, and generated applications that require persistent state and realtime communication.
Topics to discuss
Which actor patterns are most useful for durable and multiplayer AI agents?
How should applications divide orchestration, state, and sandboxed code execution?
Which deployment and observability practices work best for self-hosted actor clusters?
Written by ReadmeX AI from the project's README, source and public GitHub data; it may contain mistakes.
Read the original README https://github.com/rivet-dev/rivet#readme
ReadmeX opened this community for a trending project; it is not run by the project. Maintainers can claim it from the community page.
Comments
…