b175718: # Comprehensive AgentKit Enhancements
Major improvements to AgentKit with enhanced documentation, new API routes, comprehensive UI components, and example applications.
New Advanced Pattern Guides:
legacy-ui-streaming.mdx - Guide for UI streaming with useAgent hookuse-chat.mdx - Comprehensive guide for building chat interfacesuse-threads.mdx - Documentation for managing conversation threadsuse-agent.mdx - Updated agent integration patternsDocumentation Reorganization:
Comprehensive Streaming Architecture:
Event Types Supported:
run.started, run.completed, run.failed, run.interruptedtext.delta, reasoning.delta, data.deltatool_call.arguments.delta, tool_call.output.deltapart.created, part.completed, part.failedhitl.requested, hitl.resolvedusage.updated, metadata.updated, stream.endedDeveloper Experience:
This streaming system enables real-time UI updates that perfectly match the useAgent hook expectations, creating seamless agent-to-UI communication.
Chat & Communication:
POST /api/chat - Main chat endpoint with Zod validation and Inngest integrationPOST /api/chat/cancel - Chat cancellation with run interruption eventsPOST /api/approve-tool - Human-in-the-loop tool approval systemPOST /api/realtime/token - Real-time subscription token generationThread Management:
GET/POST /api/threads - Thread listing and creation with paginationGET/DELETE/PATCH /api/threads/[threadId] - Individual thread operationsIntegration:
/api/inngest/route - Inngest function serving with runAgentChatAI-Specific Elements:
Actions & Action - Interactive action buttons with tooltipsBranch components - Conversation branching and navigationCodeBlock - Syntax-highlighted code display with copy functionalityConversation - Chat conversation containers with scroll managementImage - AI-generated image display componentsInlineCitation - Citation cards and source referencingLoader - Loading animations and statesMessage components - Message display with avatars and contentPromptInput - Responsive chat input with model selectionReasoning - Agent reasoning display with streaming supportSources - Source material display and linkingSuggestion - AI suggestion chips and interactionsTask - Task display and management componentsTool - Tool call display with input/output viewsWebPreview - Web page preview componentsChat Interface Components:
Chat - Main chat interface with sidebar integrationEmptyState - Welcome screen with suggestionsChatHeader - Header with actions and agent informationShareDialog - Thread sharing functionalityMessageActions - Copy, edit, regenerate, like/dislike functionalityMessageEditor - In-place message editingPlayground & Development Tools:
SqlPlayground - Interactive SQL query interfaceSqlEditor - SQL editing with syntax highlightingEphemeralChat - Client-side only chat for demosMultiChat - Multiple concurrent chat sessionsUI Primitives & Layout:
Button, Card, Dialog, Sheet, Tabs and 30+ UI primitivesExample Applications:
/chat/[threadId])Build & Configuration:
Development Tools:
This release significantly enhances the AgentKit ecosystem with production-ready tools for building sophisticated AI chat applications.
Fetched April 3, 2026