What problem does it solve?
TanStack AI conversations and generated media disappear on reloads, server restarts, and multi-device use unless you persist them. This Skill guides you through wiring server-side chat persistence (withPersistence), client-side persistence, and the store contracts so conversations, runs, interrupts, and generated artifacts survive across sessions and devices.
Core Features & Use Cases
- Server chat persistence: Wire
withPersistence middleware with MessageStore, RunStore, InterruptStore, and MetadataStore contracts against your own database (Postgres, SQLite, D1, Mongo, Prisma, Drizzle).
- Generation artifact storage: Persist generated image, audio, and video bytes with ArtifactStore and BlobStore pairs, including R2/D1 recipes for Cloudflare Workers and range-request serving.
- Adapter recipes and conformance: Follow per-stack recipes (Drizzle, Prisma, Cloudflare, custom) and validate any adapter with the
runPersistenceConformance testkit.
- Use Case: A production chat app needs conversations to survive server restarts and work across devices. Use this Skill to implement the four chat stores against the app's existing Postgres client, wire
withPersistence into the chat route, and verify idempotency invariants with the conformance suite.
Quick Start
Ask the AI to add TanStack AI server-side chat persistence to your app using the database it already runs, wiring withPersistence into the chat route.