Skip to content

Commit 5e39a90

Browse files
committed
quickstart
1 parent dd76fb0 commit 5e39a90

File tree

1 file changed

+55
-5
lines changed

1 file changed

+55
-5
lines changed

src/content/docs/agents/getting-started/quickstart.mdx

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,73 @@ sidebar:
88

99
import { Render, PackageManagers, WranglerConfig } from "~/components"
1010

11-
Get up and running with the `agents-sdk`.
11+
This quick start tutorial will have you build a basic Agent that can generate code based on user questions. It will show you how the Agent SDK works, how to handle requests, store and sync state from within the Agent itself, and how to route to and call Agents from your Workers code.
1212

13-
### Create a new project
1413

15-
<PackageManagers type="create" pkg="cloudflare@latest" args={"my-agent", "--", "--type=agent"} />
14+
### Prerequisites
1615

1716
TODO
1817

18+
### Fetch the quick start project
19+
20+
You can fetch the quick start project using the following command:
21+
22+
<PackageManagers type="create" pkg="cloudflare@latest" args={"agents-quick-start", "--", "--type=agent"} />
23+
24+
This will create a new directory called `agents-quick-start`, ask you a few basic questions, and install the necessary dependencies.
25+
26+
Once complete, change into the Agent's directory:
27+
28+
```sh
29+
cd agents-quick-start
30+
```
31+
32+
1933
### Understand the Agent class
2034

2135
TODO
2236

37+
### Run your Agent
38+
39+
You can run your Agent locally, which can be useful during development when iterating and/or when testing your Agent's functionality. To run your Agent locally, use the following command:
40+
41+
```sh
42+
npm run dev
43+
```
44+
```sh output
45+
Your Worker and resources are simulated locally via Miniflare. For more information, see: https://developers.cloudflare.com/workers/testing/local-development.
46+
47+
Your worker has access to the following bindings:
48+
- Durable Objects:
49+
- MyAgent: MyAgent
50+
- AI:
51+
- Name: AI [connected to remote resource]
52+
53+
Starting local server...
54+
[wrangler:inf] Ready on http://localhost:8787
55+
```
56+
57+
This will
58+
59+
60+
### Communicate with your Agent
61+
62+
The example Agent in this quick start project exposes both HTTP and WebSocket endpoints
63+
64+
```sh
65+
# The code in this project will automatically create a new Agent on-the-fly when
66+
# you provide a name: e.g. /agents/my-agent/foo or /agents/my-agent/user-1238139
67+
# This allows you to create as many Agents as you want, each with their own
68+
# state and able to manage their own tasks.
69+
wscat --connect "ws://localhost:8787/agents/my-agent/abc123def"
70+
```
71+
72+
2373
### Deploy your Agent
2474

25-
TODO
2675

27-
### Teach your Agent
76+
77+
### Extend the Agent
2878

2979
TODO
3080

0 commit comments

Comments
 (0)