For AI Platforms

The Backend for
App Generators.

Don't burn tokens managing database schemas in your context window. Give every generated app its own isolated, stateful Actor instantly.

platform_api.ts
1import { actor } from "rivetkit";
2
3// Spawn a new backend for a user's generated app
4// cleanly isolated with zero infrastructure overhead
5export const appManager = actor({
6 state: { runningApps: [] },
7 actions: {
8 deployGeneratedApp: async (c, { code, schema }) => {
9 // 1. Create a dedicated actor for this app
10 const appActor = await c.spawn("generated_backend", {
11 env: { DATABASE_MODE: 'in-memory' }
12 });
13
14 // 2. Hot-load the logic
15 await appActor.rpc.loadCode(code);
16
17 return { url: appActor.url, status: "ready" };
18 }
19 }
20});

Stop Paying for State

Traditional AI coding tools waste thousands of tokens passing database schemas and state history back and forth. Rivet Actors hold state in memory, keeping your context window focused on logic.

Traditional LLM Backend

DB Schema (2k tokens)
User History (4k tokens)
ORM Definitions (2k)
Actual Logic
$$$ High Cost / Slow

Rivet Actor Backend

Pure Logic
Actor Memory
State persisted automatically
⚡ Low Cost / Fast

Infrastructure for Generation

Primitives designed for AI code generation platforms.

Sandbox Isolation

Every generated app gets its own Actor. Crashes in one user's app never affect the platform.

Zero-Config State

Your users don't need to setup Postgres. `state.count++` is persisted instantly.

Token Efficient

Reduce prompt size by 80%. Don't send the DB schema with every request; just send the logic.

Instant Deploy

Spawn a new backend in <10ms. Perfect for 'Click to Run' AI interfaces.

Hot Swappable

Update the actor's behavior in real-time as the AI generates new code versions.

Streaming Outputs

Pipe stdout/stderr from the actor directly to your user's browser via WebSockets.

Powering the Next Gen

No-Code Builders

Let users describe an app and deploy a real, stateful backend instantly.

Interactive Tutors

Spawn a coding environment for each student where the AI can verify state.

Internal Tool Gens

Generate admin panels on the fly that connect to real APIs and persist settings.

Game Engines

Allow users to prompt-generate multiplayer game rules that run on authoritative servers.

Works with your stack

Vercel AI SDK
LangChain
OpenAI
Anthropic
Replit
Sandpack

Build the platform.

Give your users the power of stateful backends without the complexity.