Cloudflare Agents SDK
Build robust, stateful AI agents utilizing Cloudflare Workers, Durable Objects, and Vectorize.
Features
- Stateful conversation and persistent memory across disconnects
- Durable workflows that survive server restarts and network interruptions
- Callable RPC methods and type-safe client React hooks
- Native Model Context Protocol (MCP) server endpoints
Example Agent Class
typescriptimport { Agent } from "@cloudflare/agents"; export class ChatAgent extends Agent<Env> { async onConnect(connection: Connection) { connection.send(JSON.stringify({ type: "ready", agentId: this.id })); } async onRequest(request: Request): Promise<Response> { return new Response("Agent online: " + this.id); } }
AgenticMarket