Skip to main content
Actors

The primitive for agent orchestration, real-time, and per-tenant databases

One Actor per agent, per session, per user. The same primitive powers realtime apps, multiplayer, and collaborative state.

Documentation

Actors in action.

AI Agent

Each agent runs as its own actor with persistent context, memory, and the ability to schedule tool calls.

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

  // 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.ts
const agent = client.agent.getOrCreate("agent-123").connect();
agent.on("token", delta => process.stdout.write(delta));
await agent.queue.send("hello!");

How Actors Compare

Cold Start

~300xfaster
Rivet ActorIncludes durable state init, not just a process spawn. No actor key, so no cross-region locking. Measured with Node.js and FoundationDB.~20ms
Kubernetes PodNode.js 24 Alpine image (56MB compressed) on AWS EKS with a pre-provisioned m5.large node. Breakdown: ~1s image pull and extraction, ~3-4s scheduling and container runtime setup, ~1s container start.~6s
Virtual MachineAWS EC2 t3.nano instance from launch to SSH-ready, using an Amazon Linux 2 AMI. t3.nano is the smallest available EC2 instance (512MB RAM).~30s

Memory Per Instance

~80,000xsmaller
Rivet ActorRSS (resident set size) delta divided by actor count, measured by spawning 10,000 actors in Node.js v24 on Linux x86.~0.6KB
Kubernetes PodMinimum idle Node.js container on Linux x86: Node.js v24 runtime (~43MB RSS), containerd-shim (~3MB), pause container (~1MB), and kubelet per-pod tracking (~2MB).~50MB
Virtual MachineAWS EC2 t3.nano, the smallest available EC2 instance with 512MB allocated memory.~512MB

Read Latency

0ms
Rivet ActorState is read from co-located SQLite/KV storage on the same machine as the actor, with no network round-trip.0ms
RedisAWS ElastiCache Redis (cache.t3.micro) in the same availability zone as the application.~1ms
PostgresAWS RDS PostgreSQL (db.t3.micro) in the same availability zone as the application.~5ms

Idle Cost

$0
Rivet ActorAssumes Rivet Actors running on a serverless platform. Actors scale to zero with no idle infrastructure costs. Traditional container deployments may incur idle costs.$0
Virtual MachineAWS EC2 t3.nano ($0.0052/hr compute + $1.60/mo for 20GB gp3 storage) running 24/7. t3.nano is the smallest available EC2 instance (512MB RAM).~$5/mo
Kubernetes ClusterAWS EKS control plane ($73/mo) plus a single t3.nano worker node with 20GB gp3 storage, running 24/7. t3.nano is the smallest available EC2 instance (512MB RAM).~$85/mo

Actors scale to zero with no idle infrastructure.

Horizontal Scale

Add capacity
Rivet ActorsActors are independently scheduled. Available capacity depends on the deployment you choose.Add capacity
KubernetesKubernetes officially supports clusters of up to 5,000 nodes per the Kubernetes scalability documentation.~5k nodes
Postgres1 primary

Multi-Region

Routed
Rivet CloudRivet Cloud routes Actor requests across its managed regions. Placement and availability depend on the selected deployment.Multi-region routing
Traditional Deployment1 region

Observe the whole stack.

Inspect Actor state, SQLite data, workflow progress, events, and callable actions from the Rivet dashboard.

SQLite Viewer

Browse and query SQLite databases in real-time across actors and agent sessions

Workflow State

Inspect workflow progress, steps, and retries as they execute

Event Monitoring

Follow Actor actions, connection events, and application logs while debugging a run

REPL

Debug actors and agent sessions by calling actions, subscribing to events, and interacting directly with your code

Rivet Actor Inspector showing state, events, and callable actions for a running Actor

Develop locally. Deploy your way.

Rivet Cloud

Deploy Actors on Rivet Cloud with managed infrastructure and persisted Actor data.

Open the dashboard

Self-Host

Run the open-source Rivet control plane as a Rust binary or container on your infrastructure.

Read self-hosting docs

Frequently asked questions

Infrastructure for the agentic era.

Build with agents, build for agents, and run it where your data lives.