Skip to content

Commit a2a4224

Browse files
marthakellyclaude
andcommitted
docs(CPK-7187): address Christian Bromann feedback on Deep Agents docs
- Fix Deep Agents icon (was identical to LangGraph icon) with official OSS mark - Rename "LangSmith" tabs to "Deep Agent" throughout quickstart - Add TypeScript agent tabs (createAgent + langgraph.json) to quickstart Steps 1-3 - Add Annotation deprecation callout on in-app-agent-read TypeScript tab - Add "Vite + Direct Connection" alternative quickstart section using add_langgraph_fastapi_endpoint with langgraph.json http field Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e879603 commit a2a4224

3 files changed

Lines changed: 221 additions & 28 deletions

File tree

docs/components/ui/icons/deepagents.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,17 @@ const DeepAgentsIcon = ({
1818
<svg
1919
width={width}
2020
height={height}
21-
viewBox="0 0 128 128"
21+
viewBox="0 0 98 98"
2222
fill="none"
2323
xmlns="http://www.w3.org/2000/svg"
2424
className={cn(DEFAULT_CLASSNAME, className)}
2525
>
2626
<path
27-
d="M40.1024 85.0722C47.6207 77.5537 51.8469 67.3453 51.8469 56.7136C51.8469 46.0818 47.617 35.8734 40.1024 28.355L11.7446 0C4.22995 7.5185 0 17.7269 0 28.3586C0 38.9903 4.22995 49.1987 11.7446 56.7172L40.0987 85.0722H40.1024Z"
27+
d="M72.5361 42.2004V22.0426H51.7354L51.7354 22.5212C62.5113 22.7991 71.2917 31.6243 72.1695 42.2004H72.5361Z"
2828
fill="currentColor"
2929
/>
3030
<path
31-
d="M99.4385 87.698C91.9239 80.1832 81.7121 75.9531 71.0844 75.9531C60.4566 75.9531 50.2448 80.1832 42.7266 87.698L71.0844 116.057C78.599 123.571 88.8107 127.802 99.4421 127.802C110.074 127.802 120.282 123.571 127.8 116.057L99.4421 87.698H99.4385Z"
32-
fill="currentColor"
33-
/>
34-
<path
35-
d="M11.8146 115.987C19.3329 123.502 29.541 127.732 40.1724 127.732V87.6289H0.0664062C0.0700559 98.2606 4.29635 108.469 11.8146 115.987Z"
36-
fill="currentColor"
37-
/>
38-
<path
39-
d="M110.387 45.7684C102.869 38.2535 92.6608 34.0198 82.0258 34.0234C71.3943 34.0234 61.1863 38.2535 53.668 45.772L82.0258 74.1306L110.387 45.7684Z"
31+
d="M49.223 22.0428H24.8759V63.0891C24.8759 70.6689 30.7215 75.3844 40.133 75.3844H72.5471V45.3962H49.223V22.0428Z"
4032
fill="currentColor"
4133
/>
4234
</svg>

docs/content/docs/integrations/deepagents/quickstart.mdx

Lines changed: 214 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,58 @@ Before you begin, you'll need the following:
1313
- An OpenAI API key
1414
- Node.js 20+
1515
- Your favorite package manager
16-
- A LangSmith API key - only required if deploying to LangSmith Platform
16+
- A LangGraph Platform API key - only required if deploying to the Deep Agent platform
1717

1818
## Getting started
1919
<Steps>
2020
<Step>
2121
### Initialize your agent project
2222

23-
If you don't already have a Python project set up, create one using `uv`:
23+
<Tabs groupId="agent_language" items={['Python', 'TypeScript']} persist>
24+
<Tab value="Python">
25+
If you don't already have a Python project set up, create one using `uv`:
2426

25-
```bash
26-
uv init my-agent
27-
cd my-agent
28-
```
27+
```bash
28+
uv init my-agent
29+
cd my-agent
30+
```
31+
</Tab>
32+
<Tab value="TypeScript">
33+
If you don't already have a Node.js project set up, create one using `npm`:
34+
35+
```bash
36+
mkdir my-agent
37+
cd my-agent
38+
npm init -y
39+
```
40+
</Tab>
41+
</Tabs>
2942
</Step>
3043
<Step>
3144
### Add necessary dependencies
3245

33-
Add the `deepagents`, `langchain-openai`, and `copilotkit` packages:
46+
<Tabs groupId="agent_language" items={['Python', 'TypeScript']} persist>
47+
<Tab value="Python">
48+
Add the `deepagents`, `langchain-openai`, and `copilotkit` packages:
3449

35-
```bash
36-
uv add deepagents copilotkit langchain-openai
37-
```
50+
```bash
51+
uv add deepagents copilotkit langchain-openai
52+
```
53+
</Tab>
54+
<Tab value="TypeScript">
55+
Add the `langchain`, `@langchain/langgraph`, `@copilotkit/sdk-js`, and `@langchain/openai` packages:
56+
57+
```bash
58+
npm install langchain @langchain/langgraph @copilotkit/sdk-js @langchain/openai
59+
```
60+
</Tab>
61+
</Tabs>
3862
</Step>
3963
<Step>
4064
### Create your Deep Agent
4165

42-
<Tabs groupId="deployment_method" items={['LangSmith', 'FastAPI']}>
43-
<Tab value="LangSmith">
66+
<Tabs groupId="agent_setup" items={['Python', 'TypeScript', 'FastAPI']}>
67+
<Tab value="Python">
4468
Create a simple Deep Agent:
4569

4670
```python title="main.py"
@@ -61,7 +85,7 @@ Before you begin, you'll need the following:
6185
)
6286
```
6387

64-
Then to test and deploy with LangSmith, create a `langgraph.json`:
88+
Then to test and deploy with Deep Agent, create a `langgraph.json`:
6589

6690
```sh
6791
touch langgraph.json
@@ -80,6 +104,47 @@ Before you begin, you'll need the following:
80104
}
81105
```
82106
</Tab>
107+
<Tab value="TypeScript">
108+
Create a simple Deep Agent:
109+
110+
```ts title="agent.ts"
111+
import { createAgent } from "langchain";
112+
import { copilotkitMiddleware } from "@copilotkit/sdk-js/langgraph";
113+
114+
function getWeather(location: string): string {
115+
return `The weather in ${location} is sunny.`;
116+
}
117+
118+
export const agent = createAgent({
119+
model: "openai:gpt-4o",
120+
tools: [getWeather],
121+
middleware: [copilotkitMiddleware],
122+
systemPrompt: "You are a helpful research assistant.",
123+
});
124+
```
125+
126+
Then to test and deploy with Deep Agent, create a `langgraph.json`:
127+
128+
```sh
129+
touch langgraph.json
130+
```
131+
132+
```json title="langgraph.json"
133+
{
134+
"node_version": "20",
135+
"dependencies": ["."],
136+
"package_manager": "npm",
137+
"graphs": {
138+
"sample_agent": "./agent.ts:agent"
139+
},
140+
"env": ".env"
141+
}
142+
```
143+
144+
<Callout type="info">
145+
When setting up the Copilot Runtime in the next steps, select the **Deep Agent** tab.
146+
</Callout>
147+
</Tab>
83148
<Tab value="FastAPI">
84149
Add the `ag-ui-langgraph`, `fastapi`, and `uvicorn` packages:
85150

@@ -181,8 +246,8 @@ Before you begin, you'll need the following:
181246
mkdir -p app/api/copilotkit && touch app/api/copilotkit/route.ts
182247
```
183248

184-
<Tabs groupId="deployment_method" items={['LangSmith', 'FastAPI']}>
185-
<Tab value="LangSmith">
249+
<Tabs groupId="deployment_method" items={['Deep Agent', 'FastAPI']}>
250+
<Tab value="Deep Agent">
186251
```tsx title="app/api/copilotkit/route.ts"
187252
import {
188253
CopilotRuntime,
@@ -309,8 +374,8 @@ Before you begin, you'll need the following:
309374
<Step>
310375
### Start your agent
311376

312-
<Tabs groupId="deployment_method" items={['LangSmith', 'FastAPI']}>
313-
<Tab value="LangSmith">
377+
<Tabs groupId="deployment_method" items={['Deep Agent', 'FastAPI']}>
378+
<Tab value="Deep Agent">
314379
```bash
315380
npx @langchain/langgraph-cli dev --port 8123 --no-browser
316381
```
@@ -353,3 +418,135 @@ Before you begin, you'll need the following:
353418
</Tabs>
354419
</Step>
355420
</Steps>
421+
422+
---
423+
424+
## Alternative: Vite + Direct Connection
425+
426+
This approach eliminates the Next.js API proxy entirely. Instead, you extend your LangGraph deployment with a built-in CopilotKit-compatible endpoint and point your frontend straight at it — no intermediate runtime layer needed.
427+
428+
<Steps>
429+
<Step>
430+
### Add the CopilotKit HTTP endpoint to your agent
431+
432+
Add `ag-ui-langgraph` to your agent's dependencies:
433+
434+
```bash
435+
uv add ag-ui-langgraph
436+
```
437+
438+
Then extend `main.py` to expose a CopilotKit-compatible HTTP endpoint alongside the agent:
439+
440+
```python title="main.py"
441+
from fastapi import FastAPI
442+
from deepagents import create_deep_agent
443+
from copilotkit import CopilotKitMiddleware, LangGraphAGUIAgent
444+
from ag_ui_langgraph import add_langgraph_fastapi_endpoint
445+
from langgraph.checkpoint.memory import MemorySaver
446+
447+
def get_weather(location: str):
448+
"""Get weather for a location"""
449+
return f"The weather in {location} is sunny."
450+
451+
agent = create_deep_agent(
452+
model="openai:gpt-4o",
453+
tools=[get_weather],
454+
middleware=[CopilotKitMiddleware()],
455+
system_prompt="You are a helpful research assistant.",
456+
checkpointer=MemorySaver()
457+
)
458+
459+
app = FastAPI()
460+
461+
add_langgraph_fastapi_endpoint(
462+
app=app,
463+
agent=LangGraphAGUIAgent(
464+
name="sample_agent",
465+
description="A helpful research assistant.",
466+
graph=agent,
467+
),
468+
path="/",
469+
)
470+
```
471+
472+
Update `langgraph.json` to expose the custom HTTP app when running `langgraph dev`:
473+
474+
```json title="langgraph.json"
475+
{
476+
"python_version": "3.12",
477+
"dockerfile_lines": [],
478+
"dependencies": ["."],
479+
"package_manager": "uv",
480+
"graphs": {
481+
"sample_agent": "./main.py:agent"
482+
},
483+
"http": {
484+
"app": "./main.py:app"
485+
},
486+
"env": ".env"
487+
}
488+
```
489+
</Step>
490+
<Step>
491+
### Create a Vite frontend
492+
493+
```bash
494+
npm create vite@latest frontend -- --template react-ts
495+
cd frontend
496+
npm install @copilotkit/react-ui @copilotkit/react-core
497+
```
498+
</Step>
499+
<Step>
500+
### Point CopilotKit at your agent
501+
502+
Create a `.env` file in the frontend directory:
503+
504+
```plaintext title=".env"
505+
VITE_RUNTIME_URL=http://localhost:8123
506+
```
507+
508+
Then update `src/App.tsx` to use CopilotKit with the agent URL directly — no API route needed:
509+
510+
```tsx title="src/App.tsx"
511+
import { CopilotKit } from "@copilotkit/react-core";
512+
import { CopilotSidebar } from "@copilotkit/react-core/v2";
513+
import "@copilotkit/react-ui/v2/styles.css";
514+
515+
function App() {
516+
return (
517+
<CopilotKit
518+
runtimeUrl={import.meta.env.VITE_RUNTIME_URL}
519+
agent="sample_agent"
520+
>
521+
<div style={{ height: "100vh" }}>
522+
<CopilotSidebar />
523+
</div>
524+
</CopilotKit>
525+
);
526+
}
527+
528+
export default App;
529+
```
530+
531+
<Callout type="info">
532+
For production, set `VITE_RUNTIME_URL` to your deployed LangGraph Platform URL.
533+
</Callout>
534+
</Step>
535+
<Step>
536+
### Start your agent and frontend
537+
538+
In one terminal, start the agent:
539+
540+
```bash
541+
npx @langchain/langgraph-cli dev --port 8123 --no-browser
542+
```
543+
544+
In a second terminal, start the frontend:
545+
546+
```bash
547+
cd frontend && npm run dev
548+
```
549+
550+
Your app will be available at `http://localhost:5173` and connects directly to the agent at `http://localhost:8123`.
551+
</Step>
552+
</Steps>

docs/content/docs/integrations/deepagents/shared-state/in-app-agent-read.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ state updates, you can reflect these updates natively in your application.
6565
```
6666
</Tab>
6767
<Tab value="TypeScript">
68+
<Callout type="warn" title="Annotation is the legacy TypeScript API">
69+
LangGraph now recommends [`StateSchema`](https://langchain-ai.github.io/langgraphjs/) over `Annotation` for new TypeScript projects. Full `StateSchema` support in `@copilotkit/sdk-js` is tracked in a follow-up issue. The example below uses the current API.
70+
</Callout>
71+
6872
```ts title="agent-js/src/agent.ts"
6973
import { Annotation } from "@langchain/langgraph";
7074
import { CopilotKitStateAnnotation } from "@copilotkit/sdk-js/langgraph";

0 commit comments

Comments
 (0)