Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ecosystem Integrations

This page summarizes common AG-UI and AI SDK integration patterns and maps them to this project.

Which Frontend Path To Choose

Use this quick rule:

NeedPreferred path
Fastest chat-style integration with useChatAI SDK v6
Rich shared state, frontend tools, generative UI, HITLAG-UI / CopilotKit
Backend-only tools with a thin frontend adapterAI SDK v6
Frontend-executed tools that suspend and resume runsAG-UI / CopilotKit
Canvas-style or co-agent-like UXAG-UI / CopilotKit

Repo-specific mapping:

IntegrationBackend endpointFrontend runtime shapeBest for
AI SDK v6POST /v1/ai-sdk/agents/:agent_id/runsuseChat + SSE adapter routeplain chat, minimal glue, backend-centric tools
AG-UI / CopilotKitPOST /v1/ag-ui/agents/:agent_id/runsCopilotKit runtime proxy + HttpAgentshared state, frontend tools, approvals, canvas UX

In-Repo Shortest Paths

  • AI SDK: examples/ai-sdk-starter/
  • CopilotKit / AG-UI: examples/copilotkit-starter/

These are the primary references when you need full working frontend integrations rather than protocol reference alone.

CopilotKit Integration Patterns

Pattern A: Runtime Proxy + HttpAgent (remote backend)

Used when agent runtime is hosted separately and exposes AG-UI over HTTP.

  • CopilotKit runtime runs in Next.js route (/api/copilotkit).
  • HttpAgent points to backend AG-UI run endpoint.

Examples:

Pattern B: Runtime Proxy + framework-specific adapter

Used when framework has a dedicated CopilotKit adapter.

  • LangGraphHttpAgent / LangGraphAgent
  • MastraAgent

Examples:

Pattern C: Canvas and HITL focused apps

Used for shared state, generative UI, and human-in-the-loop workflows.

Examples:

Official Starter Ecosystem Support

The table below combines AG-UI upstream support status with CopilotKit official starter availability.

Framework/SpecAG-UI Upstream StatusCopilotKit Starter AvailabilityStarter Repositories
LangGraphSupportedwith-*, canvas-*, coagents-*, persisted threadswith-langgraph-fastapi, with-langgraph-fastapi-persisted-threads, with-langgraph-js, with-langgraph-python, canvas-with-langgraph-python, coagents-starter-langgraph
MastraSupportedwith-*, canvas-*with-mastra, canvas-with-mastra
Pydantic AISupportedwith-*with-pydantic-ai
LlamaIndexSupportedwith-*, canvas-*with-llamaindex, canvas-with-llamaindex, canvas-with-llamaindex-composio
CrewAI FlowsSupported (CrewAI)with-*, coagents-*with-crewai-flows, coagents-starter-crewai-flows
Microsoft Agent FrameworkSupportedwith-*with-microsoft-agent-framework-dotnet, with-microsoft-agent-framework-python
Google ADKSupportedwith-*with-adk
AWS StrandsSupportedwith-*with-strands-python
AgnoSupportedwith-*with-agno
AG2Supporteddemo-level onlyag2-feature-viewer
A2A ProtocolSupportedprotocol starterswith-a2a-middleware, with-a2a-a2ui
Oracle Agent SpecSupportedprotocol/spec starterwith-agent-spec
MCP AppsSupportedprotocol/spec starterwith-mcp-apps
AWS Bedrock AgentsIn Progressnone yet(no official starter repo found)
OpenAI Agent SDKIn Progressnone yet(no official starter repo found)
Cloudflare AgentsIn Progressnone yet(no official starter repo found)

Minimum Feature Comparison (Official Starters)

This comparison is based on actual page.tsx and route.ts usage in each starter.

StarterRuntime AdapterShared StateFrontend ActionsGenerative UIHITL
with-langgraph-fastapiLangGraphHttpAgentYesYesYesYes
with-langgraph-jsLangGraphAgentYesYesYesNo
with-mastraMastraAgentYesYesYesYes
with-pydantic-aiHttpAgentYesYesYesYes
with-llamaindexLlamaIndexAgentYesYesYesNo
with-crewai-flowsHttpAgentYesYesYesNo
with-agnoHttpAgentNoYesYesNo
with-adkHttpAgentYesYesYesYes
with-strands-pythonHttpAgentYesYesYesNo
with-microsoft-agent-framework-dotnetHttpAgentYesYesYesYes
with-microsoft-agent-framework-pythonHttpAgentYesYesYesYes
with-langgraph-fastapi-persisted-threadsLangGraphHttpAgentYesYesYesYes

Notes:

  • Most starters use Next.js copilotRuntimeNextJSAppRouterEndpoint as the frontend runtime bridge.
  • Most non-LangGraph/Mastra starters use generic HttpAgent transport.
  • with-langgraph-fastapi-persisted-threads is the explicit persisted-thread variant.

AG-UI Supported Frameworks (Upstream)

AG-UI upstream lists first-party/partner integrations including LangGraph, CrewAI, Microsoft Agent Framework, ADK, Strands, Mastra, Pydantic AI, Agno, and LlamaIndex.

AI SDK Frontend Pattern

For @ai-sdk/react, the common pattern is:

  1. useChat in the browser.
  2. Next.js /api/chat route adapts UI messages to backend request body.
  3. Route passes through SSE stream and AI SDK headers.

Best in this repository when:

  • frontend is mostly a chat shell
  • the backend remains the only place tools execute
  • you want the smallest integration surface

Related how-to:

AG-UI / CopilotKit Frontend Pattern

For CopilotKit and AG-UI, the common pattern is:

  1. CopilotKit runtime runs behind a same-origin Next.js route.
  2. HttpAgent points at Tirea’s AG-UI endpoint.
  3. AG-UI SSE events drive chat, shared state, activity updates, and frontend tool suspensions.
  4. Frontend decisions are sent back to resume pending interactions.

Best in this repository when:

  • frontend must participate in tool execution
  • you need richer HITL flows
  • you want persisted thread hydration plus shared state UI

Related how-to:

Related docs:

Mapping to Tirea Endpoints

Run streaming:

  • AG-UI: POST /v1/ag-ui/agents/:agent_id/runs
  • AI SDK v6: POST /v1/ai-sdk/agents/:agent_id/runs

History:

  • Raw messages: GET /v1/threads/:id/messages
  • AG-UI encoded: GET /v1/ag-ui/threads/:id/messages
  • AI SDK encoded: GET /v1/ai-sdk/threads/:id/messages

In-Repo Integration Examples

CopilotKit:

  • examples/copilotkit-starter/README.md
  • examples/travel-ui/README.md
  • examples/research-ui/README.md

AI SDK:

  • examples/ai-sdk-starter/README.md