AI
AI SDK Patterns
PatternsLearnnewComposeGitHub
PatternsComposeLearnAI SDK DocsGitHub

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

© 2026 AI SDK Patterns

Part of The loop → What is an agent loop?

Multi-Step Agent

Build an agent that orchestrates multiple tool calls in sequence, using stopWhen: stepCountIs() and automatic tool result forwarding.

Popularagentsadvanced

🔒 Demo mode - multi-step agent with sequential tool execution

Install this lab

Option 1: shadcn CLI

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

Option 2: Copy or download

Use cases

Travel Planning Assistants

Build agents that research destinations, compare prices, book flights, and create itineraries through multiple coordinated steps.

Research Assistant Systems

Create agents that gather information from multiple sources, synthesize findings, and generate comprehensive reports.

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.