Agents SDK
Agents SDK

Getting Started with Cloudflare Agents SDK

January 9, 2026·6 min read

The Agents SDK transforms building AI agents from orchestration headaches into declarative workflows. Instead of managing state machines and retry logic yourself, you define what your agent should do, and the SDK handles execution, persistence, and scaling.

The core abstraction is the Agent—a stateful entity that processes messages, maintains memory, and can call tools. Tools are just functions your agent uses, decorated to expose them to the agent's reasoning. The runtime handles calling them correctly.

Start with a simple agent: greet users, remember preferences, and answer questions. The agent class handles message routing, and you add behavior with handlers. The persistence layer means your agent picks up where it left off—no in-memory state if Workers restart.

Picklist may earn commission when you purchase through our affiliate links.