Back to Rivet

Vercel Eve

website/src/content/docs/integrations/vercel-eve.mdx

2.3.93.9 KB
Original Source

import { Hosting } from "@/components/docs/Hosting";

{/* Sync policy: rivet-dev/agentos/examples/{flue,vercel-eve} are the source of truth. Before changing either integration, manually read both agentOS examples and guides and compare every hardcoded snippet in both Rivet guides: website/src/content/docs/integrations/{flue,vercel-eve}.mdx. Do not use CodeSnippet here: the source files live in another repository and importing them would couple Rivet's docs build to agentOS. Copy Flue code from rivet-dev/agentos/examples/flue and Eve code from rivet-dev/agentos/examples/vercel-eve. Update both repositories whenever either example changes. */}

<Info> This integration is in beta. APIs may change between releases. </Info>

Eve owns the agent runtime and session lifecycle, while agentOS maps every sandbox session to an isolated VM actor with a durable /workspace filesystem.

View the complete example →

Quickstart

<Steps> <Step title="Create an Eve agent">
sh
npx eve@latest init my-agent
cd my-agent
</Step> <Step title="Install the integrations">
sh
npm add @rivet-dev/agentos @rivet-dev/agentos-eve @rivet-dev/vercel-world
  • @rivet-dev/agentos and @rivet-dev/agentos-eve: Provide the agentOS VM and connect Eve's sandbox API to it.
  • @rivet-dev/vercel-world: Runs Eve workflows on Rivet World.
</Step> <Step title="Set up the Eve agent">

Update agent/agent.ts:

ts
import { defineAgent } from "eve";

export default defineAgent({
	model: "anthropic/claude-sonnet-5",
	build: {
		externalDependencies: [
			"@rivet-dev/agentos",
			"@rivet-dev/agentos-core",
			"@rivet-dev/agentos-eve",
			"@rivet-dev/agentos-runtime-core",
			"@rivet-dev/agentos-sidecar",
			"@rivet-dev/vercel-world",
			"@rivetkit/engine-cli",
		],
	},
	experimental: {
		workflow: { world: "#world" },
	},
});
</Step> <Step title="Configure Rivet World">

Rivet World lets you run Eve on top of Rivet.

Add the World module import to package.json:

json
{
	"imports": {
		"#world": "./world.ts"
	}
}

Create world.ts:

ts
import { createWorld as createRivetWorld } from "@rivet-dev/vercel-world";
import { registry } from "./actors";

export const createWorld = () => createRivetWorld({ registry });

The first World operation starts this registry and waits for the Rivet envoy to be ready.

</Step> <Step title="Configure agentOS">

Create actors.ts:

ts
import { agentOS, setup } from "@rivet-dev/agentos";
import { vercelWorldActors } from "@rivet-dev/vercel-world/registry";

const vm = agentOS();

export const registry = setup({
	use: { ...vercelWorldActors, vm },
});

Create agent/sandbox.ts:

ts
import { agentOSBackend } from "@rivet-dev/agentos-eve";
import { defineSandbox } from "eve/sandbox";
import { registry } from "../actors";

export default defineSandbox({
	backend: agentOSBackend({ actor: "vm", registry }),
});
</Step> <Step title="Run Eve">

Link Eve to Vercel once so it can call your configured model:

sh
npx eve link

Then run the agent:

sh
npx eve dev
</Step> <Step title="Deploy"> <Hosting /> </Step> </Steps>

Using with other sandbox providers

agentOS is a drop-in replacement for any Eve sandbox backend.

Read the Eve sandbox documentation →

Configuring agentOS with Eve

agentOS() configures the VM's filesystems, software, extensions, and limits.

Read the agentOS + Vercel Eve documentation →

Configuring Rivet World with Eve

Rivet World stores Eve's runs in Rivet Actors so agents resume instead of restarting.

Read the Rivet World + Vercel Eve documentation →