Step-by-step guides that build on Rivet Actors, with links to working templates and example code.
Patterns for building an AI agent backend with persistent conversation memory: one Rivet Actor per conversation, queue-driven message handling, streaming LLM responses as realtime events, and sandboxed coding agents.
Give every AI agent its own computer: a persistent agent workspace with a filesystem, processes, shells, networking, and coding agent sessions on a lightweight in-process VM. Run AI generated code, persist session transcripts across restarts, and mount a full sandbox when agents need native binaries.
Build a realtime chat room backend with Rivet Actors. One actor per room key, SQLite-backed message history, and WebSocket broadcast of new messages to every connected client, plus extension patterns for typing indicators, presence, and per-user inboxes.
Build a collaborative text editor backend with Yjs CRDTs and Rivet Actors: a per-document actor relays CRDT document sync and awareness updates to every collaborator, persists merged Yjs snapshots in actor KV, and a coordinator actor indexes documents per workspace.
Durable cron jobs and scheduled tasks with Rivet Actors. Use c.schedule.after and c.schedule.at for persistent timers that survive restarts, deploys, and crashes, plus recurring jobs that re-arm themselves, idempotent handlers, and singleton job actors.
Multi-tenant data isolation with one Rivet Actor per tenant. The actor key is the tenant id, so each tenant gets its own actor and its own isolated dataset with no shared tables. Covers JSON state vs SQLite vs Drizzle, migrations, and deriving the tenant id from auth.
Patterns for live cursors and multiplayer presence with Rivet Actors: per-connection cursor state, realtime cursor sharing over typed events or raw WebSockets, presence join and leave cleanup, and update throttling guidance.
Pragmatic patterns for building multiplayer games: matchmaking, tick loops, realtime state, interest management, and validation.