Rivet

Rivet Actors are the primitive for stateful workloads.

Built for AI agents, collaborative apps, and durable execution.

QuickstartDocumentationChangelogDiscordX

What is Rivet?

Rivet Actors are long-running, lightweight processes designed for stateful workloads. State lives in-memory with automatic persistence. Create one per agent, per session, or per user — with built-in workflows, queues, and scheduling.

Backend

const agent = actor({
  // In-memory, persisted state for the actor
  state: { messages: [] as Message[] },

  // Long-running actor process
  run: async (c) => {
    // Process incoming messages from the queue
    for await (const msg of c.queue.iter()) {
      c.state.messages.push({ role: "user", content: msg.body.text });
      const response = streamText({ model: openai("gpt-5"), messages: c.state.messages });

      // Stream realtime events to all connected clients
      for await (const delta of response.textStream) {
        c.broadcast("token", delta);
      }

      c.state.messages.push({ role: "assistant", content: await response.text });
    }
  },
});

Client (frontend or backend)

// Connect to an actor
const agent = client.agent.getOrCreate("agent-123").connect();

// Listen for realtime events
agent.on("token", delta => process.stdout.write(delta));

// Send message to actor
await agent.queue.send("how many r's in strawberry?");

Features

One Actor per agent, per session, per user — state, storage, and networking included.

Rivet provides:

Actors support:

Use Cases

One primitive that adapts to agents, workflows, collaboration, and more.

How Actors Compare

Rivet Actors vs. Traditional Infrastructure

Metric Rivet Actor Kubernetes Pod Virtual Machine
Cold start ~20ms ~6s ~30s
Memory per instance ~0.6KB ~50MB ~512MB
Idle cost $0 ~$85/mo (cluster) ~$5/mo
Horizontal scale Infinite ~5k nodes Manual
Multi-region Global edge 1 region 1 region

State

Metric Rivet Actor Redis Postgres
Read latency 0ms ~1ms ~5ms
Benchmark details & methodology

Cold Start

Memory Per Instance

Read Latency

Idle Cost

Horizontal Scale

Multi-Region

Built-In Observability

Powerful debugging and monitoring tools from local development to production at scale.

Rivet Inspector

Deployment Options

RivetKit is a library. Connect it to Rivet Cloud or self-host when you need scaling, fault tolerance, and observability.

Just a Library

Install a package and run locally. No servers, no infrastructure. Actors run in your process during development.

npm install rivetkit

Get started →

Self-Host

Single Rust binary or Docker container. Works with Postgres, file system, or FoundationDB.

docker run -p 6420:6420 rivetdev/engine

Self-hosting documentation →

Rivet Cloud

Fully managed. Global edge network. Connects to your existing cloud — Vercel, Railway, AWS, wherever you already deploy.

Sign up →

Open source, permissively licensed — Self-hosting matters for enterprise deployments, cloud portability, and avoiding vendor lock-in. Apache 2.0 means you own your infrastructure. View on GitHub →

Getting Started

Use with Your Coding Agent

Give your coding agent the Rivet skills to create examples or integrate into existing projects:

npx skills add rivet-dev/skills

Works with Claude Code, Cursor, Windsurf, and other AI coding tools.

Start From Scratch

View documentation →

Integrations

Serverless, containers, or your own servers — Rivet Actors work with your existing infrastructure, frameworks, and tools.

Infrastructure: VercelRailwayAWSDocker

Frameworks: ReactNext.jsHonoExpressElysiatRPC

Runtimes: Node.jsBunDeno

Tools: VitestPinoAI SDKOpenAPIAsyncAPI

Request an integration →

Projects in This Repository

Project Description
RivetKit TypeScript Client & server library for building actors
RivetKit Rust Rust client (experimental)
RivetKit Python Python client (experimental)
Rivet Engine Rust orchestration engine
Pegboard Actor orchestrator & networking
Gasoline Durable execution engine
Guard Traffic routing proxy
Epoxy Multi-region KV store (EPaxos)
Dashboard Inspector for debugging actors
Website Source for rivet.dev
Documentation Source for rivet.dev/docs

Community

License

Apache 2.0