agents-sdk

Develop AI applications with stateful agents on Cloudflare Workers.

95|4|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/try-works/role-model --skill agents-sdk-try-works
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agents-sdk
Source: https://github.com/try-works/role-model/tree/main/.agents/skills/agents-sdk
Command: npx skills add https://github.com/try-works/role-model --skill agents-sdk-try-works

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/agents, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

The Agents SDK empowers developers to build advanced AI applications on Cloudflare Workers. It simplifies the creation of stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, chat applications, voice agents, and browser automation.

Core Features & Use Cases

  • Stateful Agents: Create agents with persistent state and callable RPC.
  • Durable Workflows: Run multi-step background tasks that survive evictions.
  • Real-Time Apps: Build real-time WebSocket applications with message persistence and resumable streams.
  • Chat Agents: Develop chat applications with AIChatAgent and persistent messaging.
  • Voice Agents: Create voice agents for speech-to-text and text-to-speech.
  • Browser Automation: Automate web browsing tasks using the CDP browser tools.
  • Use Case: Imagine you want to build a chatbot that can handle customer inquiries and respond in real-time. The Agents SDK allows you to create a stateful chat agent that can handle complex conversations and maintain user state across sessions.

Quick Start

To install the Agents SDK, run the following command:

npm install agents

Frequently Asked Questions about agents-sdk

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

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

To build stateful AI agents on Cloudflare Workers, you use the Agents SDK to create agents with persistent state and callable RPC. This allows your agents to maintain user state across sessions and handle complex conversations.

Can I build real-time WebSocket applications with message persistence?

Yes, you can build real-time WebSocket applications with message persistence and resumable streams using the Agents SDK. This enables robust real-time communication capabilities for interactive web applications on Cloudflare Workers.

Does the Agents SDK support durable workflows for background tasks?

The Agents SDK supports durable workflows by running multi-step background tasks that survive evictions. This ensures your automated workflows complete reliably even if the underlying Cloudflare Workers environment recycles.

How do I create voice agents for speech-to-text and text-to-speech?

You create voice agents for speech-to-text and text-to-speech using the Agents SDK on Cloudflare Workers. The SDK provides the necessary components to process audio streams and generate responses for interactive voice applications.

How do I automate web browsing tasks using CDP browser tools?

You automate web browsing tasks by utilizing the CDP browser tools included in the Agents SDK. This enables browser automation capabilities within your Cloudflare Workers applications for scraping or testing.

Do I need the Cloudflare Workers environment to use the Agents SDK?

Yes, you need the Cloudflare Workers environment to use the Agents SDK because it is specifically designed to develop AI applications on this platform. You can install the SDK via npm to start building agents.