# AI use cases for Tardigrade (clavia-labs/tardigrade)

Repo: [clavia-labs/tardigrade](https://github.com/clavia-labs/tardigrade) | Use cases: 5 | Page: https://dedupedai.com/use-cases/clavia-labs-tardigrade/

Tardigrade is a TypeScript framework for building composable actors and agents around an immutable event log, built on Effect TS.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Scaffold a research agent from the quickstart template: https://dedupedai.com/use-cases/clavia-labs-tardigrade/scaffold-research-agent-from-quickstart/
- Rebuild agent state by replaying an event log: https://dedupedai.com/use-cases/clavia-labs-tardigrade/rebuild-agent-state-from-event-log/
- Deploy an actor to Cloudflare Workers: https://dedupedai.com/use-cases/clavia-labs-tardigrade/deploy-actor-to-cloudflare-workers/
- Self-host actors on a Celld fleet: https://dedupedai.com/use-cases/clavia-labs-tardigrade/self-host-actors-on-celld-fleet/
- Run an actor inside a plain Bun process: https://dedupedai.com/use-cases/clavia-labs-tardigrade/run-actor-in-bun-process/

## How to scaffold a research agent from the quickstart template with Tardigrade

Repo: [clavia-labs/tardigrade](https://github.com/clavia-labs/tardigrade) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Generate a working Tardigrade agent project and adapt its atoms to your own task.

**Who it is for:** A TypeScript developer who wants a first working agent project without wiring the framework by hand.

**The problem:** Starting an agent framework from an empty repo means guessing how atoms, actors and services fit together.

**The outcome:** A generated project with an actor composed from atoms, ready to edit for a specific research task.

### Steps

1. Run `bunx tardie init meeseeks --template quickstart` to generate the starter project.
2. In the generated project, change the role and style atoms so they describe your research task.
3. Compose the researcher actor with defineActor, codeMode, compact and infer, as shown in the README.
4. Run `bunx wrangler dev` to start the project locally and check that it runs.

### Prompt to paste into your agent

```text
Using the repo clavia-labs/tardigrade, run `bunx tardie init meeseeks --template quickstart` in a new directory named <project-name>, then change the role atom to describe <target research task>. Expected output: a project with an actor defined by defineActor that uses atom, codeMode, compact and infer. Verify that the actor file imports from tardie/core and tardie/agent.
```

### Caveat

The README warns that Tardigrade is under active development and APIs may change, so pin the version you generate against.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/clavia-labs-tardigrade/scaffold-research-agent-from-quickstart/

## How to rebuild agent state by replaying an event log with Tardigrade

Repo: [clavia-labs/tardigrade](https://github.com/clavia-labs/tardigrade) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Keep an agent's history as an immutable log and derive its state from it.

**Who it is for:** A developer building an agent that must recover its conversation state after a restart or on a new host.

**The problem:** Agent state kept only in memory or in ad hoc fields is hard to inspect, replay or recover.

**The outcome:** A durable atom that reduces an event log into trajectory state, with messages derived from it.

### Steps

1. Run `bun add tardie` in your project to add the package.
2. Define a durableAtom with a name, the Event input, the TrajectoryState schema, an initial value and the reduceTrajectory reducer.
3. Derive a messages atom from the durable history with get, as in the README example.
4. Use an effectAtom, such as the compact example, to read messages and propose summarize actions.

### Prompt to paste into your agent

```text
In the repo clavia-labs/tardigrade, add a durableAtom named <atom-name> that uses reduceTrajectory and the Event input, then derive a messages atom from it. Expected output: a TypeScript module that exports the durable history and messages atoms. Verify that the initial value matches the TrajectoryState schema.
```

### Caveat

The README shows the durable atom pattern but does not document how events are persisted beyond the thread database, so check the docs before relying on a specific storage behavior.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/clavia-labs-tardigrade/rebuild-agent-state-from-event-log/

## How to deploy an actor to Cloudflare Workers with Tardigrade

Repo: [clavia-labs/tardigrade](https://github.com/clavia-labs/tardigrade) | Difficulty: Intermediate | Time: 60 minutes | Basis: From the README

Test an actor locally with wrangler, then deploy it to Cloudflare.

**Who it is for:** A developer who wants a hosted agent that runs on Cloudflare with a directory of threads.

**The problem:** Turning an agent prototype into a running hosted service requires routing, per-thread storage and deployment config.

**The outcome:** A deployed Worker where ActorDO routes requests and each ThreadDO keeps its own database.

### Steps

1. Generate the project with `bunx tardie init meeseeks --template quickstart`.
2. Configure your model and credentials in the generated services file.
3. Run `bunx wrangler dev` and follow the local setup guide to verify the actor responds.
4. Run `bunx wrangler deploy` to publish the Worker to Cloudflare.

### Prompt to paste into your agent

```text
Using the repo clavia-labs/tardigrade, generate a project with `bunx tardie init meeseeks --template quickstart`, add model credentials for <model-provider>, then run `bunx wrangler dev`. Expected output: a local Worker that serves the actor. Verify that both ActorObject and ThreadObject bindings are exported from the Worker entrypoint before deploying with `bunx wrangler deploy`.
```

### Caveat

The README says to configure your model and credentials and points to the Cloudflare guide for details, so check that guide before deploying to production.

Risk, credentials: Model and Cloudflare credentials must be configured for deployment, so keep them in your secret store and out of the repo.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/clavia-labs-tardigrade/deploy-actor-to-cloudflare-workers/

## How to self-host actors on a Celld fleet with Tardigrade

Repo: [clavia-labs/tardigrade](https://github.com/clavia-labs/tardigrade) | Difficulty: Advanced | Time: 90 minutes | Basis: From the README

Deploy the same Worker entrypoint to your own Celld fleet with an S3 bucket.

**Who it is for:** A platform engineer who must run agent actors on infrastructure they control instead of Cloudflare.

**The problem:** Teams that cannot use a hosted edge platform need the same actor model on their own fleet with shared storage.

**The outcome:** Actors running on a self-hosted Celld fleet, using a storage bucket for their data.

### Steps

1. Read the Celld guide at docs/platforms/celld.mdx for configuration and credentials.
2. Create a celld.jsonc config for your fleet and set your bucket credentials.
3. Run `celld deploy --config celld.jsonc --bucket s3://actors` with your own bucket name in place of actors if different.
4. Confirm the deployed actors respond at the endpoint your Celld configuration exposes.

### Prompt to paste into your agent

```text
In the repo clavia-labs/tardigrade, follow docs/platforms/celld.mdx to write a celld.jsonc for <fleet-name>, then run `celld deploy --config celld.jsonc --bucket s3://<bucket-name>`. Expected output: a deployment summary from celld. Verify that the same Worker entrypoint from createActorWorker is used and that the bucket credentials are read from the environment, not committed to the repo.
```

### Caveat

The README links to a Celld project for its docs, so the exact celld.jsonc fields are not covered here and must come from the Celld guide.

Risk, credentials: The storage bucket and fleet credentials give write access to actor data, so scope them tightly and avoid committing them.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/clavia-labs-tardigrade/self-host-actors-on-celld-fleet/

## How to run an actor inside a plain Bun process with Tardigrade

Repo: [clavia-labs/tardigrade](https://github.com/clavia-labs/tardigrade) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Start an actor from the Bun example without deploying to a Worker host.

**Who it is for:** A developer who wants to try or script an actor locally without a Cloudflare or Celld setup.

**The problem:** Setting up a full hosting platform just to test agent behavior slows down early experiments.

**The outcome:** An actor running in a Bun process with services wired from the example files.

### Steps

1. Open packages/examples/bun.ts to see how the actor is started.
2. Open packages/examples/services.ts and set the model and credentials it reads.
3. Run `bun packages/examples/bun.ts` from the repo root to start the example. (inferred, check the README)
4. Send a request to the running actor and check that the response matches your atoms.

### Prompt to paste into your agent

```text
In the repo clavia-labs/tardigrade, read packages/examples/bun.ts and packages/examples/services.ts, set the model credentials for <model-provider> in services, then run `bun packages/examples/bun.ts`. Expected output: the actor starts in the Bun process. Verify that the services file provides the same services the actor's infer atom needs.
```

### Caveat

The README points to the Bun example as the way to run outside a Worker but does not describe its inputs or outputs, so read the example files before running them.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/clavia-labs-tardigrade/run-actor-in-bun-process/
