Skip to content

Cloudflare Agents Starter

Active
cloudflare/agents-starter

Official starter template for AI chat agents on Cloudflare: streaming chat, tools with approval, scheduling and vision on Workers AI.

View on GitHub
Stars
1.3k
Forks
287
Watchers
1.3k
Open issues
14

Overview

Agent Starter is Cloudflare’s official template for building AI chat agents with the Agents SDK. It gives you a working chat app — streaming responses, tools, scheduling, and image understanding — running on Workers AI, so you can start customizing an agent in minutes without a third-party model API key.

What’s Included

  • Streaming AI chat powered by Workers AI through AIChatAgent
  • Three tool patterns: server-side tools that run automatically, client-side tools answered by the browser, and human-in-the-loop tools that ask for approval first
  • Task scheduling: one-time, delayed, and recurring (cron) tasks
  • Vision: drag, paste, or attach images for vision-capable models
  • Reasoning display that streams model thinking and collapses when done
  • Debug mode to inspect the raw message JSON
  • Real-time WebSocket connection with automatic reconnection and persisted messages
  • UI built with Kumo, Cloudflare’s design system, with light and dark themes

Getting Started

npx create-cloudflare@latest --template cloudflare/agents-starter
cd agents-starter
npm install
npm run dev

Then open http://localhost:5173. Because Workers AI has no local simulator, local development uses a remote session — run wrangler login once or set a CLOUDFLARE_API_TOKEN. No OpenAI or Anthropic key is required.

Try prompts such as “What’s the weather in Paris?”, “Calculate 5000 * 3” (which asks for approval), or “Remind me in 5 minutes to take a break”.

Project Structure

File Role
src/server.ts The chat agent, its tools, and scheduling
src/app.tsx Chat UI built with Kumo components
src/client.tsx React entry point
src/styles.css Tailwind and Kumo styles

Making It Your Own

Rename the project in package.json and wrangler.jsonc (the Worker name becomes your workers.dev URL), add your own tools in server.ts, and deploy with Wrangler.

License

MIT License.

Similar open-source projects, ranked by shared categories and tags.

All AI projects →