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
- Run
bun add tardiein your project to add the package. - 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.
- 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.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page