agents-sdk

Installation
Summary

Build stateful AI agents on Cloudflare Workers with persistent state, RPC methods, scheduling, and workflow orchestration.

  • Core features include SQLite-backed state management, callable RPC methods via @callable(), one-time and recurring task scheduling, and durable multi-step workflows
  • Supports MCP server integration (both client and server modes), email routing with secure replies, and streaming chat with resumable streams on disconnect
  • Includes React hooks (useAgent, useAgentChat) for client-side state binding and real-time WebSocket communication
  • Agents route to /agents/{agent-name}/{instance-name} and validate state changes synchronously before persistence; always fetch current docs from the GitHub repository to stay current with SDK updates
SKILL.md

Cloudflare Agents SDK

Your knowledge of the Agents SDK may be outdated. Prefer retrieval over pre-training for any Agents SDK task.

Retrieval Sources

Cloudflare docs: https://developers.cloudflare.com/agents/

Topic Docs URL Use for
Getting started Quick start First agent, project setup
Adding to existing project Add to existing project Install into existing Workers app
Configuration Configuration wrangler.jsonc, bindings, assets, deployment
Agent class Agents API Agent lifecycle, patterns, pitfalls
State Store and sync state setState, validateStateChange, persistence
Routing Routing URL patterns, routeAgentRequest
Callable methods Callable methods @callable, RPC, streaming, timeouts
Scheduling Schedule tasks schedule(), scheduleEvery(), cron
Workflows Run workflows AgentWorkflow, durable multi-step tasks
Related skills

More from cloudflare/skills

Installs
7.6K
GitHub Stars
1.5K
First Seen
Jan 19, 2026