Agent Chat History

A comprehensive chat history component that displays conversation sessions with search, filtering, and management capabilities.

Features

  • Session Management: View and manage multiple chat sessions
  • Search Functionality: Search through conversations by title or content
  • Filtering Options: Filter by starred or archived sessions
  • Message Preview: View full conversation history for selected sessions
  • Actions: Star, archive, export, and delete sessions
  • Token Tracking: Display token usage per message
  • Time Formatting: Smart date/time display (Today, Yesterday, etc.)

Examples

Basic Chat History

A complete chat history interface with sessions list and message preview.

3 conversations

Building a React App

I'd be happy to help you build a React app with TypeScript! Let me guide you through the process ste...

2 messagesToday

Debugging JavaScript Error

This error typically occurs when you're trying to access a property on a value that is undefined. Le...

2 messagesToday

Python Data Analysis

Pandas is excellent for CSV data analysis! I'll show you the essential operations you need to know.

2 messagesYesterday

Building a React App

2 messages • Last updated Today

user8:22:09 PM15 tokens

Can you help me build a simple React app with TypeScript?

assistant8:23:49 PM28 tokens

I'd be happy to help you build a React app with TypeScript! Let me guide you through the process step by step.

Installation

npx shadcn add "https://agents-ui-kit.com/c/agent-chat-history.json"

API Reference

AgentChatHistory

PropTypeDefaultDescription
sessionsChatSession[]-Array of chat sessions
selectedSessionIdstring-ID of the currently selected session
onSelectSession(session: ChatSession) => void-Callback when a session is selected
onDeleteSession(sessionId: string) => void-Callback to delete a session
onStarSession(sessionId: string) => void-Callback to star/unstar a session
onArchiveSession(sessionId: string) => void-Callback to archive a session
onExportSession(sessionId: string) => void-Callback to export a session
classNamestring-Additional CSS classes

ChatSession

PropertyTypeRequiredDescription
idstringYesUnique session identifier
titlestringYesSession title
messagesChatMessage[]YesArray of messages in the session
createdAtDateYesSession creation date
updatedAtDateYesLast update date
starredbooleanNoWhether session is starred
archivedbooleanNoWhether session is archived

ChatMessage

PropertyTypeRequiredDescription
idstringYesUnique message identifier
role"user" | "assistant"YesMessage sender role
contentstringYesMessage content
timestampDateYesMessage timestamp
tokensnumberNoToken count for the message
modelstringNoModel used (for assistant messages)