Skip to content

Commit fa96ec2

Browse files
authored
agents-sdk launch (#20259)
1 parent d4ce056 commit fa96ec2

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Introducing the agents-sdk
3+
description: Build and ship AI Agents on Cloudflare using the agents-sdk
4+
products:
5+
- agents
6+
- workers
7+
date: 2025-02-25T14:00:00Z
8+
---
9+
10+
We've released the [agents-sdk](http://blog.cloudflare.com/build-ai-agents-on-cloudflare/), a package and set of tools that help you build and ship AI Agents.
11+
12+
You can get up and running with a [chat-based AI Agent](https://github.com/cloudflare/agents-starter) (and deploy it to Workers) that uses the `agents-sdk`, tool calling, and state syncing with a React-based front-end by running the following command:
13+
14+
```sh
15+
npm create cloudflare@latest agents-starter -- --template="cloudflare/agents-starter"
16+
# open up README.md and follow the instructions
17+
```
18+
19+
You can also add an Agent to any existing Workers application by installing the `agents-sdk` package directly
20+
21+
```sh
22+
npm i agents-sdk
23+
```
24+
25+
... and then define your first Agent:
26+
27+
```ts
28+
import { Agent } from 'agents-sdk';
29+
30+
export class YourAgent extends Agent<Env> {
31+
// Build it out
32+
// Access state on this.state or query the Agent's database via this.sql
33+
// Handle WebSocket events with onConnect and onMessage
34+
// Run tasks on a schedule with this.schedule
35+
// Call AI models
36+
// ... and/or call other Agents.
37+
}
38+
```
39+
40+
Head over to the [Agents documentation](/agents/) to learn more about the `agents-sdk`, the SDK APIs, as well as how to test and deploying agents to production.

0 commit comments

Comments
 (0)