Chat interface for LangGraph agents with auth, admin dashboard, and multi-server management
English | νκ΅μ΄
Docs Β· Examples Β· Report Issue
A Next.js web app for interacting with LangGraph agents. Connect to multiple LangGraph servers, manage users with NextAuth-based auth, and configure everything from an admin dashboard.
- SSE-based real-time response streaming
- Multiple LangGraph server connections with graph switching
- Tool call visualization and subgraph node execution tracking
- Thread management (save, rename, delete)
- File upload (images and attachments)
- KaTeX LaTeX rendering, LangSmith trace linking
- Automatic form UI from
input_schema
- NextAuth: credentials, OAuth (Google, GitHub, etc.), email magic link
- Signup policy: open or admin approval
- User status: active / pending / suspended
- Role-based access: admin and regular user
- Auth checks on all server actions via
requireAuth
- User management: list, role/status changes, deletion
- Signup approval/rejection for pending requests
- Global settings: feature toggles, default connection values
- Audit logging for management operations
- Branding: logo, app name, description
- Dark / light / auto theme
- Configurable conversation starter questions
- Markdown-based user guide page
- Node.js 18+
- pnpm 8+
- A running LangGraph server (
langgraph dev)
git clone https://github.com/teddynote-lab/langgraph-chat-ui.git
cd langgraph-chat-ui
pnpm install
pnpm launchpnpm launch runs an interactive setup wizard: run mode, auth mode, LangGraph server URL, LangSmith API key, database migration, and auto-start.
See
examples/for per-mode configuration examples.
| Mode | Description | NextAuth | DB Required |
|---|---|---|---|
standalone |
No auth, immediate use (local dev) | - | - |
credentials |
Email/password login | Yes | Yes |
oauth |
Google, GitHub, etc. OAuth | Yes | Yes |
email |
Magic link (passwordless) | Yes | Yes |
oauth-direct |
LangGraph server handles OAuth | - | - |
Instead of pnpm launch, configure manually:
cp frontend/.env.example frontend/.env
# Edit frontend/.env with your settings, then:
cd frontend
pnpm db:setup # Required for credentials, oauth, email modes
pnpm devOpen http://localhost:3000. When using credentials, oauth, or email auth mode, the first user to sign up gets admin privileges.
Settings are in frontend/src/configs/site.ts:
export const siteConfig = {
meta: {
title: "LangGraph Chat UI",
description: "A production-ready chat interface for LangGraph agents",
},
branding: {
appName: "LangGraph Chat UI",
logoPath: "/logo.svg",
description: "Ask your LangGraph agent anything.",
},
buttons: {
enableFileUpload: true,
chatInputPlaceholder: "Ask anything...",
},
threads: {
showHistory: true,
enableDeletion: true,
enableTitleEdit: true,
sidebarOpenByDefault: true,
},
theme: {
colorScheme: "light", // light, dark, auto
},
};Manage multiple LangGraph servers from the in-app settings panel:
- API URL (required) β LangGraph server URL
- Connection Name β Display name for identification
- Assistant ID β Graph ID (shows selection list if empty)
- API Key β LangSmith API key
Next.js handles DB-based user auth; the LangGraph server only verifies JWTs.
sequenceDiagram
autonumber
participant Browser
participant NextJS as Next.js Server
participant DB as Database
participant LG as LangGraph Server
rect rgb(240, 248, 255)
Note over Browser,DB: Authentication (Next.js)
Browser->>NextJS: Login (OAuth / Credentials / Email)
NextJS->>DB: Verify user & manage sessions
NextJS->>NextJS: Issue JWT (AUTH_SECRET)
NextJS-->>Browser: Session cookie + JWT
end
rect rgb(255, 248, 240)
Note over Browser,LG: API Requests (LangGraph)
Browser->>NextJS: Chat request
NextJS->>LG: Forward with JWT (Bearer token)
LG->>LG: Verify JWT (JWT_SECRET_KEY)
LG-->>NextJS: Agent response (streaming)
NextJS-->>Browser: SSE stream
end
Important:
AUTH_SECRET(Next.js) andJWT_SECRET_KEY(LangGraph) must be the same value.
SQLite (development), PostgreSQL, and MySQL. Set DATABASE_PROVIDER and DATABASE_URL in your env. Schema setup is handled by pnpm db:setup.
Configurable from the admin dashboard:
openβ Open signup (default)approvalβ Admin approval required
activeβ Normal accesspendingβ Awaiting approval (login disabled)suspendedβ Suspended (login disabled)
For JWT-based auth with LangGraph Platform, see the Auth Guide.
Access at /admin:
- User management β list, role/status changes, deletion
- Signup approval β approve or reject pending requests
- Global settings β signup policy, feature toggles, default connection, connection selection permissions
| Area | Measure |
|---|---|
| Server Actions | Auth checks on all server actions (requireAuth) |
| API Proxy | SSRF prevention (private IP blocking), CORS origin restrictions |
| Cookie Security | httpOnly and secure flags on connection cookies (production only) |
| File Upload | MIME-type-based extension detection, SVG XSS prevention |
| JWT | Shared-secret server-to-server auth, secure token generation |
| Data Integrity | Prisma transactions for atomic user state changes |
| Input Validation | UUID format validation on LangSmith API parameters |
| Option | LangSmith Required | Infrastructure |
|---|---|---|
| LangGraph Platform | Yes (free tier available) | Redis + PostgreSQL |
| FastAPI Standalone | No | Optional |
See the Deployment Guide for details.
# UI + PostgreSQL
docker compose up -d
# Full stack (UI + LangGraph server + PostgreSQL + Redis)
docker compose -f docker-compose.full.yml up -dSQLite is not supported on Vercel. Use PostgreSQL with
DATABASE_PROVIDER=postgresql.
| Area | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| UI | React 19, Radix UI, Framer Motion |
| Styling | Tailwind CSS 4 |
| Language | TypeScript |
| Auth | NextAuth.js v5 beta (Auth.js) |
| Database | Prisma ORM (SQLite / PostgreSQL / MySQL) |
| LangGraph | @langchain/langgraph-sdk |
| Markdown | react-markdown, KaTeX, remark-gfm |
| Document | Description |
|---|---|
| Quick Start | Get running in 5 minutes (standalone, no auth) |
| Integration Guide | Connect to your LangGraph server with auth + JWT |
| Auth Guide | Auth method comparison and selection guide |
| Production Deployment | Docker, Vercel, self-hosted deployment |
| Environment Variables | All env vars by auth mode |
| Troubleshooting | Common errors and fixes |
| Examples | Per-auth-mode configuration examples |
pnpm install
pnpm dev # dev server on :3000
pnpm lint # ESLint
pnpm format:check # Prettier
pnpm build # production buildFork the repo, create a branch, and open a PR. CI requires pnpm lint and pnpm format:check to pass.
