Multi-agent inbox UI built with Next.js 16 (App Router) that communicates with AI agents via the AG-UI protocol through CopilotKit.
- Bun (package manager and runtime)
- Install dependencies:
bun install- Copy the environment file:
cp .env.example .env.localLocal dev uses a file-based SQLite database (file:local.db) by default -- no external services needed. For production, set TURSO_DATABASE_URL and TURSO_AUTH_TOKEN for Turso cloud.
- Start the dev server:
bun devOpen http://localhost:3000 in your browser.
Agents are defined in agents.config.json at the project root. Each entry has an id, name, endpoint_url (AG-UI protocol endpoint), optional api_docs URL, and description. To add a new agent, add an entry to this file.
| Command | Description |
|---|---|
bun dev |
Start Next.js dev server |
bun run build |
Production build |
bun start |
Start production server (runs migrations first) |
bun run lint |
ESLint |
bun run format |
Format all files with Prettier |
bun run format:check |
Check formatting (CI) |
bun run typecheck |
Type-check without emitting |
bun run test |
Run unit tests (Vitest) |
bun run test:watch |
Run unit tests in watch mode |
bun run test:coverage |
Run unit tests with coverage |
bun run db:migrate |
Run database migrations manually |
bun run opencode:append-thread [pr-number] [session-id] |
Post session transcript to a PR as a marked comment |
bunx playwright test |
Run end-to-end tests (Playwright) |
- Agent Configuration -- Agents defined in
agents.config.jsonare loaded at startup. - AG-UI Protocol Bridge -- The
/api/copilotkitroute creates aCopilotRuntimethat instantiatesHttpAgentinstances for each configured agent, bridging CopilotKit to remote AG-UI endpoints. - Chat Interface --
ChatThreadwraps CopilotKit'suseCopilotChat()hook for streaming messages, loading states, and stop-generation. - Data Persistence -- Turso (libSQL/SQLite) stores agents, threads, and messages. Local dev uses a file-based SQLite database; production uses Turso cloud.
src/
components/
inbox/ -- Inbox list, filtering, thread previews
thread/ -- Chat UI (MessageList, MessageBubble, ChatInput)
sidebar/ -- Agent list sidebar, new thread dialog
providers/ -- AppLayout root client component
ui/ -- shadcn/ui primitives
lib/
agents/ -- Agent config loading and types
hooks/ -- Data hooks (useInbox, useMessages)
types/ -- Database types
db/ -- Turso/libSQL client, schema, and migrations
/-- redirects to/inbox/inbox-- Thread list (all or filtered by agent)/thread/[id]-- Individual thread chat view/api/copilotkit-- AG-UI protocol endpoint (POST)/api/mock-agent-- Test agent endpoint
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- UI: shadcn/ui (Radix UI + Tailwind CSS 4)
- Database: Turso (libSQL/SQLite); local dev uses
file:local.db - Networking: Tailscale (private access to agent endpoints)
- Hosting: Railway
- Agent Protocol: AG-UI via CopilotKit
- Testing: Vitest (unit), Playwright (e2e)
- Package Manager: Bun