What problem does it solve? LLM generations are expensive, non-reproducible outputs that are lost when apps stream to the client without saving, serve ephemeral base64 images, or keep state only in React or localStorage. This Skill enforces patterns so every generation gets an ID, a permanent URL, database storage, and cost metadata. ## Core Features & Use Cases - Generate-Then-Redirect Pattern: Create a database record with a nanoid before generation, then redirect to an addressable page like /chat/[id] for shareable URLs and refresh-safe streaming. - Persistence Schema & Storage Strategy: Drizzle/Postgres schema for text and metadata, Vercel Blob for generated images, and Upstash Redis for prompt dedup caching. - Cost Tracking: Capture token usage and estimated cost per generation for billing, budgeting, and abuse detection. - Use Case: Building an AI chat app where users can share conversation links, revisit generation history across devices, and avoid paying twice for identical prompts. ## Quick Start Set up my Next.js AI chat route so every generation is saved to the database with an ID and redirected to a shareable /chat/[id] page.