File: create-ai.md | Updated: 11/15/2025
Menu
v5 (Latest)
AI SDK 5.x
Model Context Protocol (MCP) Tools
Copy markdown
==============================================================================
AI SDK RSC is currently experimental. We recommend using AI SDK UI for production. For guidance on migrating from RSC to UI, see our migration guide .
Creates a client-server context provider that can be used to wrap parts of your application tree to easily manage both UI and AI states of your application.
import { createAI } from "@ai-sdk/rsc"
Record<string, Action>
Server side actions that can be called from the client.
any
Initial AI state to be used in the client.
any
Initial UI state to be used in the client.
() => UIState
is called during SSR to compare and update UI state.
(Event) => void
is triggered whenever an update() or done() is called by the mutable AI state in your action, so you can safely store your AI state in the database.
Event
AIState
The resulting AI state after the update.
boolean
Whether the AI state updates have been finalized or not.
It returns an <AI/> context provider.
Learn to manage AI and UI states in Next.js Learn to persist and restore states UI/AI states in Next.js
On this page
Deploy and Scale AI Apps with Vercel.
Vercel delivers the infrastructure and developer experience you need to ship reliable AI-powered applications at scale.
Trusted by industry leaders: