CopilotKit Runtime
@copilotkit/runtime is the server half of CopilotKit: it accepts AG-UI protocol
requests, dispatches them to an AbstractAgent (built-in or external), runs the
stream through an AgentRunner, and responds as Server-Sent Events.
This SKILL.md is the index. Read the reference under references/ that matches
your task — do not try to absorb the whole package from this file.
Mental Model — the three dictionaries you hand to CopilotRuntime
new CopilotRuntime({
agents, // Record<string, AbstractAgent> — see wiring-external-agents or built-in-agent
runner, // AgentRunner (optional) — see agent-runners
intelligence, // CopilotKitIntelligence (optional) — see intelligence-mode (auto-wires runner)
mcpApps, // McpAppsConfig (optional) — see wiring-mcp-apps-middleware
a2ui, // A2UIConfig (optional) — see packages/a2ui-renderer skill
hooks, // { onRequest, onBeforeHandler } — see middleware
beforeRequestMiddleware,
afterRequestMiddleware, // legacy — see middleware
transcription, // TranscriptionService (optional) — see transcription
});
You then mount it:
import { createCopilotRun…