AI
AI SDK Patterns
PatternsLearnnewComposeGitHub
PatternsComposeLearnAI SDK DocsGitHub

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

© 2026 AI SDK Patterns

Chat with Citations

A chat interface that includes inline source citations with expandable source cards. Responses include numbered references that link to source details.

chatintermediate

🔒 Demo mode - responses with inline citations and sources

Install this lab

Option 1: shadcn CLI

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

Option 2: Copy or download

Use cases

Academic Research Assistant

Build research tools that provide answers with proper citations to academic papers, journals, and scholarly sources.

Legal Research Platforms

Create systems that answer legal questions with citations to case law, statutes, and legal precedents.

Related labs

Web Search Agent

Integrate third-party search APIs (Tavily, Exa) with the AI SDK to build a grounded search agent with source citations.

RAG Pipeline

Retrieval-Augmented Generation: embed documents, store in a vector database, and retrieve context for grounded AI responses.

Streaming Chat

Stream text responses from AI models in real-time using streamText and the useChat hook.