Skip to main content
Agent Chat UI is a Next.js application that provides a conversational interface for interacting with any LangChain agent. It supports real-time chat, tool visualization, and advanced features like time-travel debugging and state forking. Agent Chat UI works seamlessly with agents created using create_agent and provides interactive experiences for your agents with minimal setup, whether you’re running locally or in a deployed context (such as LangSmith). Agent Chat UI is open source and can be adapted to your application needs.
You can use generative UI in the Agent Chat UI. For more information, see Implement generative user interfaces with LangGraph.

Quick start

The fastest way to get started is using the hosted version:
  1. Visit Agent Chat UI
  2. Connect your agent by entering your deployment URL or local server address
  3. Start chatting - the UI will automatically detect and render tool calls and interrupts

Local development

For customization or local development, you can run Agent Chat UI locally:
# Create a new Agent Chat UI project
npx create-agent-chat-app --project-name my-chat-ui
cd my-chat-ui

# Install dependencies and start
pnpm install
pnpm dev

连接到您的 Agent

Agent 聊天 UI 可以连接到 本地已部署的 Agent 启动 Agent 聊天 UI 后,您需要配置它以连接到您的 Agent:
  1. Graph ID:输入您的 Graph 名称(在 `langgraph.json` 文件的 `graphs` 下查找)
  2. Deployment URL:您的 Agent 服务器端点(例如,本地开发为 `http://localhost:2024\`,或您已部署的 Agent URL)
  3. LangSmith API key (可选):添加您的 LangSmith API 密钥(如果使用本地 Agent 服务器则不需要)
配置完成后,Agent 聊天 UI 将自动获取并显示您的 Agent 中任何中断的线程。
Agent 聊天 UI 开箱即支持渲染工具调用和工具结果消息。要自定义显示哪些消息,请参阅 在聊天中隐藏消息