AI
AI SDK Patterns
PatternsLearnnewComposeGitHub
PatternsComposeLearnAI SDK DocsGitHub

Built with AI SDK · shadcn/ui · Next.js

© 2026 AI SDK Patterns

Durable Multi-Turn Chat Agent

Stateful conversation agent with Workflow DevKit that persists messages across pauses/resumes, calls tools, and streams responses using DurableAgent.

workflowsadvanced

🔒 Demo mode - session state persisted across tool calls

Install this lab

Option 1: shadcn CLI

pnpm dlx shadcn@latest add https://ai-sdk-patterns.vercel.app/r/durable-chat-agent

Option 2: Copy or download

Use cases

Custom Applications

Adapt this pattern for your specific use case and requirements.

Learning & Prototyping

Use this pattern to learn AI SDK concepts and prototype new ideas.

Related labs

Tool Calling

Let the AI model call functions and use external tools with the multi-step tool loop.

Human-in-the-Loop

Pause AI execution to get human approval before executing sensitive tool calls. Uses tool confirmation flow with the AI SDK.