Enterprise
CopilotKit integration with Spring AI. Java-based agent backend with full feature coverage including frontend tools, in-chat and in-app human-in-the- loop, generative UI, per-tool renderers, agent context, interrupt-adapted scheduling (Strategy B), per-token state streaming, and prebuilt chat surfaces (sidebar / popup / slots / headless). loop, generative UI, per-tool renderers, agent context, per-token state streaming, and prebuilt chat surfaces (sidebar / popup / slots / headless). Demos that depend on LangGraph-specific primitives (interrupt, multi-agent orchestration, MCP-driven UI) are documented as skipped in PARITY_NOTES.md.
Copy-paste command to clone the canonical Spring AI starter
npx copilotkit@latest init --framework spring-ai
Natural conversation with frontend tool execution
Default CopilotChat re-themed via scoped CSS overrides
Agent invokes client-side handlers registered with useFrontendTool
useFrontendTool with an async handler — agent awaits a client-side async operation and uses the returned result
Long-running agent tasks with generated UI
Docked sidebar chat via <CopilotSidebar />
Floating popup chat via <CopilotPopup />
Customize CopilotChat via its slot system
Minimal custom chat surface built on useAgent
Frontend provides read-only context to the agent via useAgentContext
Bearer-token gate via runtime onRequest hook with unauthenticated / authenticated states
Agent streams HTML + CSS into a sandboxed iframe via the built-in OpenGenerativeUIActivityRenderer
Sandboxed UI can call host-side functions (evaluateExpression, notifyHost) via the provider's sandboxFunctions registration
CopilotChat mic button via a runtime mounted with TranscriptionServiceOpenAI; transcribed text is forwarded to the Spring AI backend
Frontend forwards typed config (tone, expertise, responseLength) to Spring, which rebuilds the system prompt per request
Dedicated Spring tool emits a fixed flight-card component tree plus a data model; frontend catalog renders each component
Full chat built from scratch on useAgent plus low-level render hooks (useRenderToolCall, useRenderActivityMessage, useRenderCustomMessages)
Polished brand-themed chat surface over the Spring AI agent with seeded suggestion pills
Custom reasoningMessage slot renders the agent's thinking chain as a tagged amber banner (renders when the adapter emits REASONING_MESSAGE_* events)
Zero-config reasoning — CopilotChatReasoningMessage renders the built-in collapsible card when REASONING_MESSAGE_* events are emitted
Per-tool renderers (WeatherCard, FlightListCard) plus custom reasoningMessage slot composed in a single chat
A2UI dynamic-schema against a branded catalog; backend owns the `generate_a2ui` tool
Bidirectional shared state — UI writes preferences into agent state; the agent's set_notes tool mutates state.notes and emits a STATE_SNAPSHOT back to the UI
Per-token state streaming — the agent's write_document tool streams content into state.document via STATE_SNAPSHOT events; the frontend renders the growing document live
Supervisor delegates to research / writing / critique sub-agents (each its own ChatClient call). Every delegation appends a Delegation entry to state.delegations and emits a STATE_SNAPSHOT for a live UI log
CopilotChat AttachmentsConfig for images + PDFs; sample files inject through the same pipeline as the paperclip upload
User approves agent actions before execution via text input inside the chat
Agent requests approval via useFrontendTool; the approval UI pops up as an app-level modal OUTSIDE the chat
Multi-step HITL flow where the agent pauses for user confirmation at each step
Backend agent tools rendered as UI components
Frontend registers per-tool component renderers via useComponent; the Spring agent calls render tools that paint chart components inline in the chat
Out-of-the-box tool rendering — the Spring backend defines tools; the frontend adds zero custom renderers and relies on CopilotKit's built-in default UI
Single branded wildcard renderer via useDefaultRenderTool — the same app-designed card paints every Spring tool call
Time-picker card rendered inline via useHumanInTheLoop for a booking flow against the Spring AI agent
MCP server-driven UI via the runtime mcpApps middleware; sandboxed iframe rendered via the built-in MCPAppsActivityRenderer
Streaming hashbrown UI kit (MetricCard + PieChart + BarChart + DealCard) rendered by @hashbrownai/react against the Spring AI ChatClient stream
Time-picker card rendered inline via useFrontendTool with an async handler that blocks until the user picks a slot — Strategy B adaptation of LangGraph's interrupt() primitive
Time-picker popup rendered in the app surface (outside the chat) via useFrontendTool with an async handler — headless variant of the interrupt-adapted pattern
Zero-tool agent emits a flat-spec JSON object rendered by @json-render/react against a Zod-validated catalog of MetricCard, BarChart, and PieChart components