building-ai-agent-on-cloudflare

Build edge AI agents on Cloudflare with the Agents SDK.

5|1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/charl-kruger/cf-agents --skill building-ai-agent-on-cloudflare-charl-kruger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-ai-agent-on-cloudflare
Source: https://github.com/charl-kruger/cf-agents/tree/main/.agents/skills/building-ai-agent-on-cloudflare
Command: npx skills add https://github.com/charl-kruger/cf-agents --skill building-ai-agent-on-cloudflare-charl-kruger

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill enables building edge AI agents on Cloudflare by leveraging the Agents SDK with state persistence, real-time WebSocket communication, and tool integration to run at the edge.

Core Features & Use Cases

  • Persistent state across sessions and reconnections using Cloudflare Durable Objects.
  • Real-time interactions via WebSockets with per-session isolation and streaming options.
  • Task scheduling and tool integration to invoke external services from the agent.
  • Quick-start templates and references to accelerate production-ready agent development.

Quick Start

Install a starter project and bootstrap an agent:

  • npm create cloudflare@latest -- my-agent --template=cloudflare/agents-starter
  • cd my-agent
  • npm start

Frequently Asked Questions about building-ai-agent-on-cloudflare

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build stateful AI agents on Cloudflare Workers?

Build stateful AI agents on Cloudflare by leveraging the Agents SDK to establish state persistence via Durable Objects and enable real-time WebSocket communication. This approach supports stateful, real-time chat agents and edge AI services requiring task scheduling and external tool integration.

What's the best way to manage state persistence for edge AI agents across sessions?

Manage state persistence for edge AI agents by utilizing Cloudflare Durable Objects through the Agents SDK. This mechanism maintains state across sessions and reconnections, ensuring continuous conversational context and data isolation for real-time WebSocket interactions.

How do I bootstrap a Cloudflare AI agent project with the Agents SDK?

Bootstrap a Cloudflare AI agent project by running npm create cloudflare@latest with the agents-starter template. After scaffolding, navigate into the generated directory and execute npm start to launch the local development server for your agent.

Do I need a specific Node.js version and Wrangler to use the Cloudflare Agents SDK?

Yes, you need Node.js 18+ and Wrangler installed to use the Cloudflare Agents SDK. Additionally, a Cloudflare account with Workers enabled is required to deploy and run the edge AI agents with state persistence and WebSocket communication.

Can I integrate external tools and schedule tasks with Cloudflare AI agents?

Yes, you can integrate external tools and schedule tasks with Cloudflare AI agents. The Agents SDK provides task scheduling capabilities and tool integration features to invoke external services directly from the edge agent during real-time interactions.

Does the Cloudflare Agents SDK support real-time WebSocket communication with per-session isolation?

Yes, the Cloudflare Agents SDK supports real-time WebSocket communication with per-session isolation. This enables streaming options and isolated interactions for each user, ensuring that state and connections remain separate across concurrent sessions.