diff --git a/src/content/docs/agents/index.mdx b/src/content/docs/agents/index.mdx index 752e856a1633af..a8b972051138aa 100644 --- a/src/content/docs/agents/index.mdx +++ b/src/content/docs/agents/index.mdx @@ -22,6 +22,7 @@ import { TabItem, Tabs, TypeScriptExample, + WranglerConfig, } from "~/components"; The Agents SDK enables you to build and deploy AI-powered agents that can autonomously perform tasks, communicate with clients in real time, call AI models, persist state, schedule tasks, run asynchronous workflows, browse the web, query data from your database, support human-in-the-loop interactions, and [a lot more](/agents/api-reference/). @@ -50,7 +51,7 @@ And then define your first Agent by creating a class that extends the `Agent` cl ```ts -import { Agent, AgentNamespace } from 'agents'; +import { Agent, AgentNamespace } from "agents"; export class MyAgent extends Agent { // Define methods on the Agent: @@ -65,6 +66,21 @@ export class MyAgent extends Agent { +Lastly, add the [Durable Objects](/durable-objects/) binding to your wrangler file: + + +```toml +[[durable_objects.bindings]] +name = "MyAgent" +class_name = "MyAgent" + +[[migrations]] +tag = "v1" +new_sqlite_classes = ["MyAgent"] + +``` + + Dive into the [Agent SDK reference](/agents/api-reference/agents-api/) to learn more about how to use the Agents SDK package and defining an `Agent`. ### Why build agents on Cloudflare?