DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

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

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

Short answer: Run bun add tardie in your project to add the package; then Define a durableAtom with a name, the Event input, the TrajectoryState schema, an initial value and the reduceTrajectory reducer; Derive a messages atom from the durable history with get, as in the README example. All steps.

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

The problemAgent state kept only in memory or in ad hoc fields is hard to inspect, replay or recover.

The outcomeA durable atom that reduces an event log into trajectory state, with messages derived from it.

What you need first

  • Bun installed, since the README uses bunx and bun add
  • Working knowledge of TypeScript
  • A model and credentials configured for the generated project
  • A Cloudflare account for Cloudflare hosting, or a Celld fleet with a storage bucket for self-hosting

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 for your agent

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.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for clavia-labs/tardigrade and "Rebuild agent state by replaying an event log"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer