Build and deploy persistent, stateful AI agents on the Cloudflare network, with built-in support for state management, scheduling, workflows, and real-time communication.
Cloudflare Agents is an open-source framework by Cloudflare for building and deploying persistent, stateful AI agents. Powered by Cloudflare Durable Objects, it provides execution environments for agentic workloads. Each agent manages its own state and lifecycle, with built-in support for real-time communication, scheduling, and AI model calls. This solves the challenge of creating scalable, cost-effective agents that hibernate when idle and wake on demand, ideal for running millions of instances simultaneously.
Cloudflare Agents is an open-source SDK distributed as NPM packages. Developers define agent behavior in TypeScript classes, using decorators for callable methods and state management. These agents are deployed as Cloudflare Durable Objects, which hibernate when idle to reduce cost. A client library for environments like React allows frontends to call agent methods and receive real-time state updates. The framework is free, but usage of the underlying Cloudflare infrastructure is priced separately.
This framework is best for developers on the Cloudflare platform who need to build scalable, stateful AI applications. It excels at creating per-user or per-session agents, such as persistent chatbots, game room managers, or complex workflow orchestrators.
The framework is tightly integrated with the Cloudflare ecosystem, particularly Durable Objects, and is not suitable for deployment on other platforms. The SDK is evolving rapidly, and the project is not currently accepting external pull requests.