Rivet Actors are lightweight, long-running processes that combine in-memory state, durable storage, real-time communication, and scheduling into a single primitive. Built for AI agents, multiplayer apps, and workflows, they eliminate the complexity of managing state across distributed systems by co-locating compute and data. Developers can deploy actors globally via Rivet Cloud, self-host with Rust or Docker, or run locally during development — all with zero idle costs and ~20ms cold starts.
Rivet is built in Rust with a TypeScript-first developer experience. It integrates with Cloudflare Workers, Vercel, AWS, and Kubernetes, and supports SQLite, FoundationDB, or your own database for persistence. The engine includes Pegboard (orchestration), Gasoline (durable execution), and Epoxy (multi-region KV store), enabling scalable, edge-optimized stateful compute without traditional infrastructure overhead.
What You Get
- In-memory state - State is co-located with compute, enabling 0ms read latency using SQLite or BYO databases like FoundationDB or Postgres.
- Runs indefinitely, sleeps when idle - Actors persist state and remain active during use, then hibernate with $0 idle cost until triggered again.
- Global edge network - Actors auto-deploy near users across regions with built-in routing, enabling low-latency access and legal jurisdiction compliance.
- WebSockets - Built-in bidirectional streaming for real-time updates to clients without external libraries or infrastructure.
- Durable queues - Reliable message queues for async processing with guaranteed delivery, used for AI tool calls, chat messages, or workflow steps.
- Scheduling & timers - Native cron jobs and timed events within actors, enabling automated retries, cleanup, or periodic data syncs without external schedulers.
- Workflow orchestration - Multi-step operations with automatic retry logic, state persistence between steps, and visual inspection in the Inspector.
- SQLite Viewer - Real-time browser-based interface to inspect and query an actor’s embedded SQLite database during development and production.
- Event Monitoring - Live tracking of every state change, message, and action within an actor for debugging and audit trails.
- REPL - Interactive debugging console to call actor functions, subscribe to events, and modify state in real time without redeploying.
Common Use Cases
- AI Agent with persistent memory - An AI coding assistant uses a Rivet Actor to maintain conversation history, schedule tool calls, and persist context across sessions without external databases.
- Real-time collaborative document editor - Each document is a Rivet Actor broadcasting edits via WebSockets to all connected users with in-memory state and SQLite persistence.
- Per-tenant data isolation - A SaaS platform runs one Rivet Actor per tenant, providing low-latency reads and durable storage without shared database complexity.
- Sandbox orchestration - A code execution platform uses Actors to manage sandbox lifecycles, queue workloads, and schedule cleanup tasks with built-in durability.
Under The Hood
Architecture
- Monorepo structure with pnpm and Turbo enabling efficient cross-package builds and clear workspace isolation between frontend, engine, and SDKs
- Strict dependency encapsulation via centralized Node.js abstraction layers and Biome’s import restrictions to enforce clean boundaries
- Modular service design with dedicated packages for API, runner, and database layers, promoting single-responsibility and testability
- Type-safe communication across layers using shared TypeScript types and workspace resolutions to maintain consistency
- Comprehensive tooling pipeline with Biome, Lefthook, and Turbo enforcing uniform code quality and pre-commit standards
- Production-grade dependency governance with deny.toml for license compliance and vulnerability mitigation
Tech Stack
- Rust backend powered by Axum, Tokio, and Tracing, with UniversalDB and PostgreSQL for data persistence
- TypeScript/Next.js frontend with React 19, Vite, and Tsup for high-performance bundling, integrated with Sentry and Biome
- Unified build and linting pipeline leveraging Turbo for orchestration, Biome for formatting, and Lefthook for Git hooks
- Cross-platform tooling including zx for scripting, pnpm for package management, and custom SDKs for API and cloud protocols
- Infrastructure-as-code patterns with Docker templates and testcontainers for reliable integration testing
- Clean encapsulation of Node.js system modules through centralized utility layers to prevent direct imports
Code Quality
- Extensive test coverage across all layers with Vitest, including edge cases for state persistence and actor lifecycle
- Strong type safety enforced consistently in both TypeScript and Rust, with explicit error types and structured error codes
- Modular, well-organized codebase with clearly separated packages for engine, guard, and workflow components
- Consistent idiomatic patterns across languages, including descriptive naming and state access conventions
- Robust error handling with custom error classes and precise error codes that enable predictable recovery and logging
- Comprehensive test automation with mocking, async assertions, and waitFor patterns to validate distributed system behavior
What Makes It Unique
- Native ClickHouse templating with built-in OpenTelemetry schemas and columnar storage optimizations for real-time observability
- Web Worker-based TypeScript REPL with dynamic AST transformation and Shiki-powered syntax highlighting in isolated sandboxes
- Deep CodeMirror integration with live JSON validation and linting embedded directly in the UI for infrastructure editing
- Mobile-optimized navigation using Zustand and framer-motion with context-aware rendering for nested component hierarchies
- Actor RPC system exposing remote functions as first-class JavaScript primitives for in-browser serverless debugging
- Unified configuration templating across Docker, ClickHouse, and frontend assets using declarative XML/JSX patterns to abstract environment logic