Agent Skill

Cloudflare Agents SDK
Build stateful AI agents on Cloudflare Workers using the Agents SDK with durable execution, state management, and real-time capabilities
What is Cloudflare Agents SDK?
This skill teaches agents how to build sophisticated, stateful AI applications on Cloudflare's edge infrastructure using the Agents SDK. The skill covers creating Agent classes that extend the framework's base capabilities, implementing durable workflows with automatic retries and state persistence, managing conversational state across user sessions, handling real-time WebSocket connections for interactive applications, integrating with Cloudflare's AI models and other platform services, building MCP (Model Context Protocol) servers, and deploying agents with proper observability. The agent learns architectural patterns for structuring agents with clear separation between conversation logic, tool execution, and state management. The skill establishes boundaries between ephemeral Workers operations and durable agent state, guiding decisions about when to use standard Workers versus Durable Objects for persistence. Trade-offs include choosing between stateless request-response patterns versus stateful conversational flows, balancing cold start performance against state persistence requirements, and selecting appropriate retry strategies for different failure scenarios. The skill emphasizes leveraging Cloudflare's global network while understanding edge computing constraints around execution time and memory.
