Skip to main content
The Cookbook contains self-contained, portable patterns you can copy into any AI chat application. Unlike the main docs which focus on ChatJS installation and configuration, these recipes work independently of ChatJS.

Recipes by Category

Streaming

Patterns for handling real-time AI response streams.

Resumable Streams

Continue AI responses after connection interruptions using Redis pub/sub

Tool Part

Connect backend tools to frontend UI components with loading states

Models

Patterns for the model system.

Auto-Updating Models

Fetch model catalogs at runtime with fallback to a static snapshot

Data

Database patterns and state management.

Provisional IDs

Seamless client-side navigation without page reloads using pre-generated UUIDs

Credit Tracking

Track and limit AI usage with credit budgets

Neon Branching

Isolated database environments for schema development

Auth

Authentication patterns for AI applications.

Dev Auth Bypass

Auto-authenticate AI agents for browser testing

AI UX

User experience patterns for chat interfaces.

Follow-up Questions

Generate contextual follow-up suggestions after AI responses

Chat Layout

Resizable split-panel layout with collapsible secondary panel

Development

Workflow patterns for local development.

Git Worktrees

Parallel development environments without branch switching