Examples
Basic Chat
The simplest use case — streaming AI conversation with auto-scroll, stop button, and keyboard handling. All in 10 lines with AgentsKit.
The simplest use case — streaming AI conversation with auto-scroll, stop button, and keyboard handling. All in 10 lines with AgentsKit.
Hi! I'm your AI assistant. Ask me anything about streaming, React hooks, or how AgentsKit works under the hood.
#With AgentsKit
import { useChat, ChatContainer, Message, InputBar } from '@agentskit/react'
import { anthropic } from '@agentskit/adapters'
import '@agentskit/react/theme'
function Chat() {
const chat = useChat({ adapter: anthropic({ apiKey: 'key', model: 'claude-sonnet-4-6' }) })
return (
<ChatContainer>
{chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
<InputBar chat={chat} />
</ChatContainer>
)
}Explore nearby
- PeerExamples
Interactive demos. For copy-paste code, see Recipes.
- PeerTool Use
AI assistants that call functions — weather, search, DB queries. Tool calls render as expandable cards.
- PeerMulti-Model Comparison
Compare responses from different AI models side-by-side. Same input, different adapters — AgentsKit makes it trivial.