@copilotkit/runtime 1.70.3 → 1.71.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/agent/index.cjs +5 -1
  2. package/dist/agent/index.cjs.map +1 -1
  3. package/dist/agent/index.d.cts +1 -1
  4. package/dist/agent/index.d.cts.map +1 -1
  5. package/dist/agent/index.d.mts +1 -1
  6. package/dist/agent/index.d.mts.map +1 -1
  7. package/dist/agent/index.mjs +5 -1
  8. package/dist/agent/index.mjs.map +1 -1
  9. package/dist/package.cjs +3 -3
  10. package/dist/package.mjs +3 -3
  11. package/package.json +5 -6
  12. package/skills/runtime/SKILL.md +0 -98
  13. package/skills/runtime/references/agent-runners-custom.md +0 -161
  14. package/skills/runtime/references/agent-runners-in-memory.md +0 -79
  15. package/skills/runtime/references/agent-runners-sqlite.md +0 -90
  16. package/skills/runtime/references/agent-runners.md +0 -336
  17. package/skills/runtime/references/built-in-agent-factory-modes.md +0 -232
  18. package/skills/runtime/references/built-in-agent-helper-utilities.md +0 -123
  19. package/skills/runtime/references/built-in-agent-model-identifiers.md +0 -58
  20. package/skills/runtime/references/built-in-agent.md +0 -523
  21. package/skills/runtime/references/intelligence-mode.md +0 -364
  22. package/skills/runtime/references/middleware.md +0 -376
  23. package/skills/runtime/references/server-side-tools.md +0 -414
  24. package/skills/runtime/references/setup-endpoint.md +0 -503
  25. package/skills/runtime/references/transcription.md +0 -287
  26. package/skills/runtime/references/wiring-a2a.md +0 -40
  27. package/skills/runtime/references/wiring-adk.md +0 -45
  28. package/skills/runtime/references/wiring-ag2.md +0 -41
  29. package/skills/runtime/references/wiring-agno.md +0 -40
  30. package/skills/runtime/references/wiring-aws-strands.md +0 -59
  31. package/skills/runtime/references/wiring-crewai-crews.md +0 -51
  32. package/skills/runtime/references/wiring-crewai-flows.md +0 -45
  33. package/skills/runtime/references/wiring-external-agents.md +0 -348
  34. package/skills/runtime/references/wiring-langgraph.md +0 -49
  35. package/skills/runtime/references/wiring-llamaindex.md +0 -39
  36. package/skills/runtime/references/wiring-mastra.md +0 -70
  37. package/skills/runtime/references/wiring-mcp-apps-middleware.md +0 -73
  38. package/skills/runtime/references/wiring-ms-agent-framework.md +0 -41
  39. package/skills/runtime/references/wiring-pydantic-ai.md +0 -45
@@ -1,348 +0,0 @@
1
- # CopilotKit — Wire External Agent Frameworks
2
-
3
- `CopilotRuntime` takes any `AbstractAgent` subclass. Every framework below ships a
4
- ready-made subclass you construct and hand to `agents: { ... }`.
5
-
6
- | Framework | Package | Construct |
7
- | ------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
8
- | Mastra | `@ag-ui/mastra` | `MastraAgent.getLocalAgents({ mastra, resourceId? })` (record; `resourceId` required only when the agent has Memory enabled) |
9
- | LangGraph | `@copilotkit/runtime/langgraph` | `new LangGraphAgent({ deploymentUrl, graphId })` |
10
- | CrewAI Crews | `@ag-ui/crewai` | `new CrewAIAgent({ url })` |
11
- | CrewAI Flows | `@ag-ui/client` (HttpAgent) | `new HttpAgent({ url })` |
12
- | PydanticAI | `@ag-ui/client` (HttpAgent) | `new HttpAgent({ url })` |
13
- | Google ADK | `@ag-ui/client` (HttpAgent) | `new HttpAgent({ url })` |
14
- | LlamaIndex | `@ag-ui/llamaindex` | `new LlamaIndexAgent({ url: ".../run" })` (`/run` suffix) |
15
- | Agno | `@ag-ui/client` (HttpAgent) | `new HttpAgent({ url: ".../agui" })` (`/agui` suffix) |
16
- | AWS Strands | `@ag-ui/client` (HttpAgent) | `new HttpAgent({ url })` |
17
- | Microsoft Agent Framework | `@ag-ui/client` (HttpAgent) | `new HttpAgent({ url })` |
18
- | AG2 | `@ag-ui/client` (HttpAgent) | `new HttpAgent({ url })` |
19
- | A2A | `@ag-ui/a2a` | `new A2AAgent({ a2aClient })` (pre-built `A2AClient`, not a URL) |
20
-
21
- MCP Apps is NOT a framework — it's a runtime middleware:
22
- `new CopilotRuntime({ agents, mcpApps: { servers: [...] } })`. See
23
- [wiring-mcp-apps-middleware.md](wiring-mcp-apps-middleware.md).
24
-
25
- ## Setup
26
-
27
- Generic shape for every framework:
28
-
29
- ```typescript
30
- import {
31
- CopilotRuntime,
32
- createCopilotRuntimeHandler,
33
- } from "@copilotkit/runtime/v2";
34
- import { HttpAgent } from "@ag-ui/client";
35
-
36
- const runtime = new CopilotRuntime({
37
- agents: {
38
- default: new HttpAgent({ url: process.env.AGENT_URL! }),
39
- },
40
- });
41
-
42
- const handler = createCopilotRuntimeHandler({
43
- runtime,
44
- basePath: "/api/copilotkit",
45
- });
46
-
47
- export default { fetch: handler };
48
- ```
49
-
50
- ## Core Patterns
51
-
52
- ### Mastra (local agents)
53
-
54
- ```typescript
55
- import {
56
- CopilotRuntime,
57
- createCopilotRuntimeHandler,
58
- } from "@copilotkit/runtime/v2";
59
- import { MastraAgent } from "@ag-ui/mastra";
60
- import { mastra } from "./mastra";
61
-
62
- const runtime = new CopilotRuntime({
63
- // resourceId scopes Mastra Memory's working-memory buckets. Required when
64
- // the Mastra agent has Memory enabled (the runtime always supplies a
65
- // threadId, so Memory-enabled agents effectively always need it). Agents
66
- // without Memory can omit it — `examples/integrations/mastra` calls
67
- // `getLocalAgents({ mastra })` with no resourceId. See wiring-mastra.md.
68
- agents: MastraAgent.getLocalAgents({ mastra, resourceId: "default" }),
69
- });
70
-
71
- const handler = createCopilotRuntimeHandler({
72
- runtime,
73
- basePath: "/api/copilotkit",
74
- });
75
-
76
- export default { fetch: handler };
77
- ```
78
-
79
- See [wiring-mastra.md](wiring-mastra.md).
80
-
81
- ### LangGraph
82
-
83
- ```typescript
84
- import {
85
- CopilotRuntime,
86
- createCopilotRuntimeHandler,
87
- } from "@copilotkit/runtime/v2";
88
- import { LangGraphAgent } from "@copilotkit/runtime/langgraph";
89
-
90
- const runtime = new CopilotRuntime({
91
- agents: {
92
- supportAgent: new LangGraphAgent({
93
- deploymentUrl: process.env.LANGGRAPH_URL!,
94
- graphId: "support",
95
- langsmithApiKey: process.env.LANGSMITH_API_KEY,
96
- }),
97
- },
98
- });
99
-
100
- const handler = createCopilotRuntimeHandler({
101
- runtime,
102
- basePath: "/api/copilotkit",
103
- });
104
-
105
- export default { fetch: handler };
106
- ```
107
-
108
- See [wiring-langgraph.md](wiring-langgraph.md).
109
-
110
- ### Multi-framework single runtime
111
-
112
- ```typescript
113
- import {
114
- CopilotRuntime,
115
- createCopilotRuntimeHandler,
116
- } from "@copilotkit/runtime/v2";
117
- import { LangGraphAgent } from "@copilotkit/runtime/langgraph";
118
- import { CrewAIAgent } from "@ag-ui/crewai";
119
- import { HttpAgent } from "@ag-ui/client";
120
-
121
- const runtime = new CopilotRuntime({
122
- agents: {
123
- research: new LangGraphAgent({
124
- deploymentUrl: process.env.LANGGRAPH_URL!,
125
- graphId: "research",
126
- }),
127
- writer: new CrewAIAgent({ url: process.env.CREWAI_URL! }),
128
- translator: new HttpAgent({ url: process.env.PYDANTIC_AI_URL! }),
129
- },
130
- });
131
-
132
- const handler = createCopilotRuntimeHandler({
133
- runtime,
134
- basePath: "/api/copilotkit",
135
- });
136
-
137
- export default { fetch: handler };
138
- ```
139
-
140
- ### MCP Apps (runtime middleware, not an agent)
141
-
142
- ```typescript
143
- import {
144
- CopilotRuntime,
145
- createCopilotRuntimeHandler,
146
- BuiltInAgent,
147
- } from "@copilotkit/runtime/v2";
148
-
149
- const runtime = new CopilotRuntime({
150
- agents: {
151
- default: new BuiltInAgent({ model: "openai/gpt-4o" }),
152
- },
153
- mcpApps: {
154
- servers: [{ type: "http", url: "https://mcp.example.com/mcp" }],
155
- },
156
- });
157
-
158
- const handler = createCopilotRuntimeHandler({
159
- runtime,
160
- basePath: "/api/copilotkit",
161
- });
162
-
163
- export default { fetch: handler };
164
- ```
165
-
166
- ## Common Mistakes
167
-
168
- ### HIGH Using runtimeUrl as the agent URL
169
-
170
- Wrong:
171
-
172
- ```typescript
173
- import { LangGraphAgent } from "@copilotkit/runtime/langgraph";
174
-
175
- new LangGraphAgent({ deploymentUrl: "/api/copilotkit", graphId: "agent" });
176
- ```
177
-
178
- Correct:
179
-
180
- ```typescript
181
- new LangGraphAgent({
182
- deploymentUrl: process.env.LANGGRAPH_URL!,
183
- graphId: "agent",
184
- });
185
- ```
186
-
187
- External agents take their own upstream URL — the framework's server or deployment. The
188
- CopilotKit runtime URL (`/api/copilotkit`) is the frontend↔runtime hop, not the
189
- runtime↔agent hop.
190
-
191
- Source: `docs/integrations/langgraph/quickstart.mdx:355`.
192
-
193
- ### HIGH Wrapping MastraAgent.getLocalAgents in a key
194
-
195
- Wrong:
196
-
197
- ```typescript
198
- new CopilotRuntime({
199
- agents: {
200
- mastra: MastraAgent.getLocalAgents({ mastra, resourceId: "default" }),
201
- },
202
- });
203
- ```
204
-
205
- Correct:
206
-
207
- ```typescript
208
- new CopilotRuntime({
209
- agents: MastraAgent.getLocalAgents({ mastra, resourceId: "default" }),
210
- });
211
- ```
212
-
213
- `MastraAgent.getLocalAgents` already returns a `Record<string, AbstractAgent>`. Wrapping
214
- it turns the record into a nested value on one key, which fails the registry's shape check.
215
-
216
- Source: `docs/integrations/mastra/quickstart.mdx:213-220`.
217
-
218
- ### MEDIUM Missing /run or /agui suffix on LlamaIndex / Agno
219
-
220
- Wrong:
221
-
222
- ```typescript
223
- import { LlamaIndexAgent } from "@ag-ui/llamaindex";
224
- import { HttpAgent } from "@ag-ui/client";
225
-
226
- new LlamaIndexAgent({ url: "http://localhost:8000" });
227
- new HttpAgent({ url: "http://localhost:8000" });
228
- ```
229
-
230
- Correct:
231
-
232
- ```typescript
233
- new LlamaIndexAgent({ url: "http://localhost:8000/run" });
234
- new HttpAgent({ url: "http://localhost:8000/agui" });
235
- ```
236
-
237
- LlamaIndex requires a `/run` suffix, Agno requires `/agui`. The generic HttpAgent fallback
238
- would 404 without these.
239
-
240
- Source: `docs/integrations/llamaindex/quickstart.mdx:258`;
241
- `docs/integrations/agno/quickstart.mdx:215`.
242
-
243
- ### MEDIUM Passing a URL to A2AAgent instead of an A2AClient
244
-
245
- Wrong:
246
-
247
- ```typescript
248
- import { A2AAgent } from "@ag-ui/a2a";
249
-
250
- new A2AAgent({ url: "https://a2a.example" } as any);
251
- ```
252
-
253
- Correct:
254
-
255
- ```typescript
256
- import { A2AAgent } from "@ag-ui/a2a";
257
- import { A2AClient } from "@a2a-js/sdk/client";
258
-
259
- const a2aClient = new A2AClient("https://a2a.example");
260
- new A2AAgent({ a2aClient });
261
- ```
262
-
263
- `A2AAgent` expects a pre-built `A2AClient` instance — A2A has its own handshake that
264
- the client handles.
265
-
266
- Source: `examples/integrations/a2a-a2ui/app/api/copilotkit/[[...slug]]/route.tsx:12`.
267
-
268
- ### HIGH Treating MCP Apps as an agent
269
-
270
- Wrong:
271
-
272
- ```typescript
273
- new CopilotRuntime({
274
- agents: {
275
- mcpApps: new MCPAppsAgent({
276
- /* ... */
277
- } as any),
278
- } as any,
279
- });
280
- ```
281
-
282
- Correct:
283
-
284
- ```typescript
285
- new CopilotRuntime({
286
- agents: {
287
- /* your real agents */
288
- },
289
- mcpApps: {
290
- servers: [{ type: "http", url: "https://mcp.example.com/mcp" }],
291
- },
292
- });
293
- ```
294
-
295
- MCP Apps is runtime-level middleware auto-applied to all agents. Configure via
296
- `runtime.mcpApps`, not `agents`.
297
-
298
- Source: `packages/runtime/src/v2/runtime/core/runtime.ts:39-63`.
299
-
300
- ### MEDIUM Passing a framework `client` instead of its Agent wrapper
301
-
302
- Wrong:
303
-
304
- ```typescript
305
- import { mastraClient } from "./mastra"; // a Mastra client object
306
-
307
- new CopilotRuntime({
308
- agents: { default: mastraClient as any },
309
- });
310
- ```
311
-
312
- Correct:
313
-
314
- ```typescript
315
- import { MastraAgent } from "@ag-ui/mastra";
316
- import { mastra } from "./mastra";
317
-
318
- new CopilotRuntime({
319
- agents: MastraAgent.getLocalAgents({ mastra, resourceId: "default" }),
320
- });
321
- ```
322
-
323
- `CopilotRuntime` expects `AbstractAgent` subclasses. Framework SDK clients are not
324
- AbstractAgent instances — always pass the `@ag-ui/<framework>` wrapper or `HttpAgent`.
325
-
326
- Source: `packages/runtime/src/v2/runtime/core/runtime.ts:111-128`.
327
-
328
- ## References
329
-
330
- - [Mastra](wiring-mastra.md)
331
- - [LangGraph](wiring-langgraph.md)
332
- - [CrewAI Crews](wiring-crewai-crews.md)
333
- - [CrewAI Flows](wiring-crewai-flows.md)
334
- - [PydanticAI](wiring-pydantic-ai.md)
335
- - [Google ADK](wiring-adk.md)
336
- - [LlamaIndex](wiring-llamaindex.md)
337
- - [Agno](wiring-agno.md)
338
- - [AWS Strands](wiring-aws-strands.md)
339
- - [Microsoft Agent Framework](wiring-ms-agent-framework.md)
340
- - [AG2](wiring-ag2.md)
341
- - [A2A](wiring-a2a.md)
342
- - [MCP Apps middleware](wiring-mcp-apps-middleware.md)
343
-
344
- ## See also
345
-
346
- - `copilotkit/setup-endpoint` — mount the runtime that fronts these agents
347
- - `copilotkit/built-in-agent` — alternative when you want an in-tree agent
348
- - `copilotkit/agent-runners` — runner choice is independent of framework
@@ -1,49 +0,0 @@
1
- LangGraph — wired via `@copilotkit/runtime/langgraph`. Supports LangGraph Platform
2
- deployments and self-hosted LangGraph servers.
3
-
4
- ## Install
5
-
6
- `LangGraphAgent` (and `LangGraphHttpAgent` for self-hosted AG-UI LangGraph servers)
7
- ship with `@copilotkit/runtime` — no separate install needed.
8
-
9
- ## Minimal wire-up
10
-
11
- ```typescript
12
- import {
13
- CopilotRuntime,
14
- createCopilotRuntimeHandler,
15
- } from "@copilotkit/runtime/v2";
16
- import { LangGraphAgent } from "@copilotkit/runtime/langgraph";
17
-
18
- const runtime = new CopilotRuntime({
19
- agents: {
20
- default: new LangGraphAgent({
21
- deploymentUrl: process.env.LANGGRAPH_URL!,
22
- graphId: "agent",
23
- langsmithApiKey: process.env.LANGSMITH_API_KEY, // optional
24
- }),
25
- },
26
- });
27
-
28
- const handler = createCopilotRuntimeHandler({
29
- runtime,
30
- basePath: "/api/copilotkit",
31
- });
32
-
33
- export default { fetch: handler };
34
- ```
35
-
36
- ## Config fields
37
-
38
- | Field | Notes |
39
- | ----------------- | --------------------------------------------------------------------- |
40
- | `deploymentUrl` | Base URL of the LangGraph Platform deployment (or self-hosted server) |
41
- | `graphId` | The graph name registered with the deployment (e.g. `"agent"`) |
42
- | `langsmithApiKey` | Optional — enables LangSmith tracing |
43
-
44
- ## Gotcha — `deploymentUrl` is NOT the CopilotKit runtime URL
45
-
46
- The most common mistake is setting `deploymentUrl` to `/api/copilotkit`. That is the
47
- frontend↔runtime URL, not the LangGraph server. Use the actual LangGraph deployment URL.
48
-
49
- Source: `docs/content/docs/integrations/langgraph/quickstart.mdx:355`.
@@ -1,39 +0,0 @@
1
- LlamaIndex — wired via `@ag-ui/llamaindex`. Requires a `/run` URL suffix.
2
-
3
- ## Install
4
-
5
- ```bash
6
- pnpm add @ag-ui/llamaindex
7
- ```
8
-
9
- ## Minimal wire-up
10
-
11
- ```typescript
12
- import {
13
- CopilotRuntime,
14
- createCopilotRuntimeHandler,
15
- } from "@copilotkit/runtime/v2";
16
- import { LlamaIndexAgent } from "@ag-ui/llamaindex";
17
-
18
- const runtime = new CopilotRuntime({
19
- agents: {
20
- default: new LlamaIndexAgent({
21
- url: process.env.LLAMAINDEX_URL ?? "http://localhost:8000/run",
22
- }),
23
- },
24
- });
25
-
26
- const handler = createCopilotRuntimeHandler({
27
- runtime,
28
- basePath: "/api/copilotkit",
29
- });
30
-
31
- export default { fetch: handler };
32
- ```
33
-
34
- ## Gotcha — the `/run` suffix is mandatory
35
-
36
- LlamaIndex's AG-UI adapter mounts its workflow endpoint at `/run`. Pointing `url` at the
37
- server root (`http://localhost:8000`) returns 404. Always include `/run`.
38
-
39
- Source: `docs/content/docs/integrations/llamaindex/quickstart.mdx:258`.
@@ -1,70 +0,0 @@
1
- Mastra — local-first TypeScript agent framework wired via `@ag-ui/mastra`.
2
-
3
- ## Install
4
-
5
- ```bash
6
- pnpm add @ag-ui/mastra
7
- # plus your Mastra SDK:
8
- pnpm add @mastra/core
9
- ```
10
-
11
- ## Minimal wire-up
12
-
13
- ```typescript
14
- import {
15
- CopilotRuntime,
16
- createCopilotRuntimeHandler,
17
- } from "@copilotkit/runtime/v2";
18
- import { MastraAgent } from "@ag-ui/mastra";
19
- import { Mastra } from "@mastra/core";
20
- import { weatherAgent } from "./agents/weather"; // your Mastra agent
21
-
22
- const mastra = new Mastra({
23
- agents: { weather: weatherAgent },
24
- });
25
-
26
- const runtime = new CopilotRuntime({
27
- agents: MastraAgent.getLocalAgents({
28
- mastra,
29
- // Required ONLY when your Mastra agent has Memory enabled AND a threadId
30
- // is supplied (the runtime always supplies a threadId, so Memory-enabled
31
- // agents effectively always need this). Passing an empty string throws
32
- // AGENT_MEMORY_MISSING_RESOURCE_ID on every turn. Agents without Memory
33
- // can omit resourceId — e.g. the in-tree `examples/integrations/mastra`
34
- // quickstart calls `MastraAgent.getLocalAgents({ mastra })` with no
35
- // resourceId. Pick a stable per-user identifier in production; a literal
36
- // "default" is fine as a placeholder for single-tenant demos.
37
- resourceId: "default",
38
- }),
39
- });
40
-
41
- const handler = createCopilotRuntimeHandler({
42
- runtime,
43
- basePath: "/api/copilotkit",
44
- });
45
-
46
- export default { fetch: handler };
47
- ```
48
-
49
- ## Remote Mastra server
50
-
51
- If Mastra is running as a separate HTTP service, the simplest wiring is the
52
- generic `HttpAgent` from `@ag-ui/client` — it speaks the AG-UI protocol that
53
- Mastra's HTTP server already emits:
54
-
55
- ```typescript
56
- import { HttpAgent } from "@ag-ui/client";
57
-
58
- const runtime = new CopilotRuntime({
59
- agents: {
60
- weather: new HttpAgent({ url: `${process.env.MASTRA_URL!}/weather` }),
61
- },
62
- });
63
- ```
64
-
65
- ## Gotcha — do NOT wrap the record
66
-
67
- `getLocalAgents` already returns `Record<string, AbstractAgent>`. Wrapping it in a key
68
- (`{ mastra: getLocalAgents(...) }`) breaks the registry.
69
-
70
- Source: `docs/content/docs/integrations/mastra/quickstart.mdx:213-220`.
@@ -1,73 +0,0 @@
1
- MCP Apps — runtime-level middleware that auto-applies to all agents. NOT an agent.
2
-
3
- MCP Apps lets any agent in the runtime access tools from external MCP servers. It is
4
- configured on `CopilotRuntime` directly, not as an entry in `agents`.
5
-
6
- ## Install
7
-
8
- MCP support is provided by the runtime directly — no extra package install for the
9
- middleware itself. Your MCP servers are separate services you point at.
10
-
11
- ## Minimal wire-up
12
-
13
- ```typescript
14
- import {
15
- CopilotRuntime,
16
- createCopilotRuntimeHandler,
17
- BuiltInAgent,
18
- } from "@copilotkit/runtime/v2";
19
-
20
- const runtime = new CopilotRuntime({
21
- agents: {
22
- default: new BuiltInAgent({ model: "openai/gpt-4o", maxSteps: 5 }),
23
- },
24
- mcpApps: {
25
- servers: [
26
- {
27
- type: "http",
28
- url: "https://mcp.example.com/mcp",
29
- },
30
- {
31
- type: "http",
32
- url: "https://another-mcp.example.com/mcp",
33
- agentId: "default", // scope this server to one agent only
34
- },
35
- ],
36
- },
37
- });
38
-
39
- const handler = createCopilotRuntimeHandler({
40
- runtime,
41
- basePath: "/api/copilotkit",
42
- });
43
-
44
- export default { fetch: handler };
45
- ```
46
-
47
- ## Per-agent scoping
48
-
49
- Each server entry accepts an optional `agentId`. When set, the server's tools are only
50
- exposed to that agent. Omit it to expose to all agents.
51
-
52
- Per-tool filtering belongs to `@ag-ui/mcp-apps-middleware`. The runtime currently pins
53
- version `0.0.3`, which does not support `includeTools` or `excludeTools`. Supplying either
54
- key raises a configuration error instead of silently ignoring it; use a compatible
55
- middleware release when that upstream policy contract is available.
56
-
57
- ## Gotcha — do NOT put MCP under agents
58
-
59
- ```typescript
60
- // WRONG
61
- new CopilotRuntime({
62
- agents: {
63
- mcpApps: new MCPAppsAgent({
64
- /* ... */
65
- }),
66
- } as any,
67
- });
68
- ```
69
-
70
- There is no `MCPAppsAgent`. MCP Apps is runtime middleware and belongs on the top-level
71
- `CopilotRuntime` options.
72
-
73
- Source: `packages/runtime/src/v2/runtime/core/runtime.ts:39-63`.
@@ -1,41 +0,0 @@
1
- Microsoft Agent Framework — wired via the bare `HttpAgent` from `@ag-ui/client`.
2
- Both Python and .NET variants use the same HTTP bridge.
3
-
4
- ## Install
5
-
6
- ```bash
7
- pnpm add @ag-ui/client
8
- ```
9
-
10
- ## Minimal wire-up
11
-
12
- ```typescript
13
- import {
14
- CopilotRuntime,
15
- createCopilotRuntimeHandler,
16
- } from "@copilotkit/runtime/v2";
17
- import { HttpAgent } from "@ag-ui/client";
18
-
19
- const runtime = new CopilotRuntime({
20
- agents: {
21
- default: new HttpAgent({
22
- url: process.env.MS_AGENT_URL!, // Python or .NET AG-UI endpoint
23
- }),
24
- },
25
- });
26
-
27
- const handler = createCopilotRuntimeHandler({
28
- runtime,
29
- basePath: "/api/copilotkit",
30
- });
31
-
32
- export default { fetch: handler };
33
- ```
34
-
35
- ## Gotcha — pick the right endpoint path
36
-
37
- Microsoft Agent Framework ships both Python and .NET adapters. The AG-UI mount path
38
- depends on which adapter you chose and how you configured it — follow the framework's
39
- quickstart to find the exact URL. `HttpAgent` simply forwards.
40
-
41
- Source: `docs/content/docs/integrations/microsoft-agent-framework/quickstart.mdx`.
@@ -1,45 +0,0 @@
1
- PydanticAI — wired via the bare `HttpAgent` from `@ag-ui/client`.
2
-
3
- ## Install
4
-
5
- ```bash
6
- pnpm add @ag-ui/client
7
- ```
8
-
9
- ## Minimal wire-up
10
-
11
- ```typescript
12
- import {
13
- CopilotRuntime,
14
- createCopilotRuntimeHandler,
15
- } from "@copilotkit/runtime/v2";
16
- import { HttpAgent } from "@ag-ui/client";
17
-
18
- const runtime = new CopilotRuntime({
19
- agents: {
20
- default: new HttpAgent({
21
- url: process.env.PYDANTIC_AI_URL ?? "http://localhost:8000/",
22
- }),
23
- },
24
- });
25
-
26
- const handler = createCopilotRuntimeHandler({
27
- runtime,
28
- basePath: "/api/copilotkit",
29
- });
30
-
31
- export default { fetch: handler };
32
- ```
33
-
34
- ## Server side
35
-
36
- On the Python side, PydanticAI exposes an AG-UI-compliant endpoint via its built-in
37
- ASGI adapter. The URL you pass to `HttpAgent` is that endpoint (e.g. an FastAPI route
38
- that returns a streaming response of AG-UI events).
39
-
40
- ## Gotcha — no suffix required
41
-
42
- Unlike LlamaIndex (`/run`) and Agno (`/agui`), PydanticAI does not mandate a specific
43
- sub-path. Whatever path your Python server mounts the AG-UI app at — use that.
44
-
45
- Source: `docs/content/docs/integrations/pydantic-ai/quickstart.mdx`.