How rezformbay/ag-ui works
This starter pairs a CopilotKit chat-and-canvas frontend with a Claude Agent SDK backend. The user’s main path runs from the chat UI through the CopilotKit HTTP route to the agent, which can query sample data or generate UI; frontend tools and renderers then provide charts, meeting selection, and shared todos. The README also documents A2UI flight and dashboard experiences, Intelligence threads, and optional Slack/Teams channels. Some backend and UI links are documented rather than visible in sampled implementation excerpts.
Main entry points: page.tsx Chat and canvas · agent.ts Tool orchestration · use-generative-ui-examples.tsx Tool and UI setup · channel-host.mts Channel host
Components 25
Frontend experience
- Chat and canvas
src/app/page.tsx - Chat/app layout
src/components/example-layout/index.tsx - Todo canvas
src/components/example-canvas/todo-list.tsx - Prompt suggestions
src/hooks/use-example-suggestions.tsx
Interactive UI features
- Tool and UI setup
src/hooks/use-generative-ui-examples.tsx - Charts
src/components/generative-ui/charts/bar-chart.tsx - Meeting picker
src/components/generative-ui/meeting-time-picker.tsx - A2UI renderers
src/app/declarative-generative-ui/renderers.tsx - A2UI catalog
src/app/declarative-generative-ui/definitions.ts - Theme state
src/hooks/use-theme.tsx
Agent runtime
- CopilotKit route
src/app/api/copilotkit/[[...slug]]/route.ts - HTTP agent client
src/agent.ts - AG-UI server
agent/src/server.ts - Tool orchestration
agent/src/agent.ts - Model selection
agent/src/model.ts - Financial data query
agent/src/query.ts - Flight search UI
agent/src/a2ui_fixed_schema.ts - Dashboard generation
agent/src/a2ui_dynamic_schema.ts - A2UI operations
agent/src/a2ui.ts
Messaging channels
- Channel host
channel-host.mts - Channel handlers
channels.mts
Other components
- User
- Claude Agent SDK
- CopilotKit Intelligence
- Slack / Teams
Connections 25
- User → Chat and canvas: uses
src/app/page.tsx - Chat and canvas → Chat/app layout: renders
src/app/page.tsx - Chat and canvas → Todo canvas: renders
src/app/page.tsx - Chat and canvas → Prompt suggestions: configures
src/app/page.tsx - Chat and canvas → Tool and UI setup: registers UI tools
src/app/page.tsx - Chat/app layout → Todo canvas: displays
src/components/example-layout/index.tsx - Tool and UI setup → Charts: registers renderers
src/hooks/use-generative-ui-examples.tsx - Tool and UI setup → Meeting picker: renders interaction
src/hooks/use-generative-ui-examples.tsx - Tool and UI setup → Theme state: reads and updates
src/hooks/use-generative-ui-examples.tsx - A2UI renderers → A2UI catalog: uses catalog
src/app/declarative-generative-ui/renderers.tsx - Chat and canvas → CopilotKit route: sends chat requests
README.md - CopilotKit route → HTTP agent client: configures agent
src/app/api/copilotkit/[[...slug]]/route.ts - HTTP agent client → AG-UI server: connects over HTTP
README.md - AG-UI server → Tool orchestration: serves
agent/src/server.ts - Tool orchestration → Model selection: resolves model
agent/src/agent.ts - Tool orchestration → Financial data query: registers tool
agent/src/agent.ts - Tool orchestration → Flight search UI: registers tool
agent/src/agent.ts - Tool orchestration → Dashboard generation: registers tool
agent/src/agent.ts - Dashboard generation → A2UI operations: uses operations
agent/src/a2ui_dynamic_schema.ts - Flight search UI → A2UI operations: uses operations
agent/src/a2ui_fixed_schema.ts - Tool orchestration → Claude Agent SDK: delegates agent run
README.md - Chat and canvas → CopilotKit Intelligence: loads thread history
README.md - Channel host → Channel handlers: loads channel setup
channel-host.mts - Channel handlers → Tool orchestration: shares agent
channels.mts - Channel host → Slack / Teams: connects via Intelligence
README.md