ai-core/chat-experience

Implement streaming SSE chat endpoints and clients with TanStack AI.

3.0k|295|Updated Oct 8, 2025
One-click install
npx skills add https://github.com/TanStack/ai --skill ai-core-chat-experience
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-core/chat-experience
Source: https://github.com/TanStack/ai/tree/main/packages/typescript/ai/skills/ai-core/chat-experience
Command: npx skills add https://github.com/TanStack/ai --skill ai-core-chat-experience

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Stops teams from piecing together incompatible TanStack AI chat endpoints, streaming clients, and rendering rules by documenting the complete SSE/HTTP architecture for server and framework hooks.

Core Features & Use Cases

  • Streaming chat lifecycle: Demonstrates how to expose chat() streams via toServerSentEventsResponse or toHttpResponse while wiring framework-specific fetchers like fetchServerSentEvents and fetchHttpStream.
  • Multimodal and thinking content rendering: Shows how to render UIMessage parts (text, thinking, tool-call, image) along with adapter modelOptions to surface reasoning and multimedia inside useChat.
  • Use Case: Power a help-center assistant that streams Claude or Gemini thinking, renders images from the model, and respects middleware analytics while avoiding outdated Vercel patterns.

Quick Start

Spin up a TanStack Start chat route feeding chat() into toServerSentEventsResponse and connect useChat with fetchServerSentEvents to stream UIMessage parts, including thinking and multimodal content, to the client.

Frequently Asked Questions about ai-core/chat-experience

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stream AI chat responses using server-sent events in TanStack Start?

Stream AI chat responses by passing the chat() function into toServerSentEventsResponse on a TanStack Start route, then connect the useChat client hook with fetchServerSentEvents to handle real-time UIMessage rendering.

How does TanStack AI handle multimodal content and thinking parts in a chat stream?

TanStack AI handles multimodal content and thinking parts by rendering UIMessage components that explicitly support text, image, tool-call, and reasoning outputs, allowing you to surface model logic and multimedia directly inside the useChat interface.

Can I use TanStack AI chat hooks with frameworks other than React?

Yes, TanStack AI chat hooks support building streaming chat experiences across React, Vue, Solid, Svelte, and Preact, allowing you to wire framework-specific fetchers for SSE or HTTP stream conversations.

What is the best way to configure model adapters for a streaming chat client?

The best way to configure model adapters is by applying adapter modelOptions within your chat() setup, which ensures the streaming client correctly maps generation parameters and message structures to the useChat hook.

Why does my TanStack AI chat stream break when applying analytics middleware?

Chat streams can break if middleware disrupts the streaming lifecycle, but TanStack AI provides middleware-driven lifecycle tracking to properly intercept and execute analytics without terminating the server-sent events connection.

How do I render tool-call and image parts from an SSE chat stream?

You render tool-call and image parts by mapping the multimodal UIMessage parts array received from the fetchServerSentEvents stream, extracting the specific tool-call and image structures for UI display within your client component.