> Documentation index: https://rift.sh/llms.txt

[Use Rift with your agent](https://rift.sh/docs/use-with.md)

# Use Rift with Rivet Actors

A Rivet Actor can hold an agent's session state and schedule, and a Rift folder can hold the files it writes, on a worker that runs as a long-lived process on a machine you operate.

## Set it up

A serverless worker has no lasting disk and cannot run Rift, so these steps are for a worker on a machine you operate. On your own machine, make an invite for that worker and share the folder it should write to.

```
$ rift invite worker
$ rift share runs/worker-1 worker
```

On every machine that runs workers, install Rift and join with the token the invite printed.

```
$ curl -fsSL https://rift.sh/install | sh
$ rift init --invite <token>
```

The actor's code reads and writes ordinary files in that folder, which appears on the worker at `~/rift/worker-1`. Keep each file's path, relative to that folder, in the actor's state, and keep the file itself in Rift.

## What you get

Rivet Actors keeps the session, its queue and its schedule. Rift keeps the files the session writes, and brings them to your machines and to any other agent you share that folder with.

## How they differ

The comparison says what each one does, who can read your files and when to choose which.

[Rift vs Rivet Actors](https://rift.sh/compare/rift-vs-rivet-actors.md)
