agents-sdk

Build persistent AI agents with state, RPC, and workflows on Cloudflare Workers.

2|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/ingbyr/lzcode --skill agents-sdk-ingbyr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agents-sdk
Source: https://github.com/ingbyr/lzcode/tree/main/packages/opencode/test/fixture/skills/agents-sdk
Command: npx skills add https://github.com/ingbyr/lzcode --skill agents-sdk-ingbyr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Builds persistent, edge-deployed AI agents with built-in state management, real-time communication, and orchestrated workflows on Cloudflare Workers, reducing the complexity of distributed agent systems.

Core Features & Use Cases

  • Agent class and state management: Define an agent with initial state, persistence across requests, and validation hooks to ensure data integrity.
  • Callable RPC and streaming: Expose methods over WebSocket for client-server interaction, including streaming responses.
  • Durable workflows and MCP integration: Compose multi-step background tasks and connect to MCP servers for broader integrations.
  • React hooks for client apps: Use hooks like useAgent and useAgentChat to embed agents into frontend apps.
  • Use cases: Real-time chat agents, edge-processed data workflows, scheduled tasks, and edge automation.

Quick Start

Create and deploy a simple agent with a stateful example that exposes a callable RPC.

Frequently Asked Questions about agents-sdk

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

FAQPage Schema
How do I build AI agents on Cloudflare Workers with state management?

You can build AI agents on Cloudflare Workers by using an Agent class that provides built-in state persistence across requests, validation hooks for data integrity, and callable RPC over WebSocket for client interaction. This reduces the complexity of distributed agent systems.

Can I stream responses from edge-deployed agents over WebSockets?

Yes, you can stream responses from edge-deployed agents over WebSockets by exposing callable RPC methods. The framework supports real-time client-server communication, enabling streaming responses directly to connected clients for interactive applications like real-time chat.

How do I add AI agents to a React frontend?

You can add AI agents to a React frontend by using built-in hooks like useAgent and useAgentChat. These hooks allow you to embed edge-deployed agents directly into client applications, handling the real-time WebSocket communication and state synchronization automatically.

Does Cloudflare Workers support durable workflows for background tasks?

Yes, Cloudflare Workers supports durable workflows for composing multi-step background tasks. The framework allows you to orchestrate scheduled tasks, edge-processed data workflows, and edge automation, ensuring persistent execution and state management across distributed operations.

What is the best way to connect edge agents to MCP servers?

The best way to connect edge agents to MCP servers is through the framework's built-in MCP integration. This enables broader integrations for your persistent, edge-deployed AI agents on Cloudflare Workers, allowing them to interact with external tools and data sources seamlessly.

When should I not use edge computing for stateful agent workflows?

You should reconsider edge computing for stateful agent workflows if your application requires heavy centralized database transactions or lacks tolerance for eventual consistency. Edge agents excel at real-time chat, data processing, and scheduled tasks but may not suit strictly synchronous monolithic architectures.