agents-sdk

Build stateful AI agents on Cloudflare Workers with SQLite persistence and WebSocket RPC.

2|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/NagyVikt/codex-plugins --skill agents-sdk-nagyvikt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agents-sdk
Source: https://github.com/NagyVikt/codex-plugins/tree/main/plugins/cloudflare/skills/agents-sdk
Command: npx skills add https://github.com/NagyVikt/codex-plugins --skill agents-sdk-nagyvikt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires agents, @cloudflare/ai-chat, @modelcontextprotocol/sdk, @cloudflare/codemode, ai, @ai-sdk/openai, zod, postal-mime, and includes references (resource) components.

What problem does it solve?

This skill addresses the complexity of building stateful, real-time AI agents by providing a unified framework for state management, durable workflows, and WebSocket-based RPC on Cloudflare Workers.

Core Features & Use Cases

  • Stateful Persistence: Automatically syncs SQLite-backed state to connected clients, ensuring consistency across sessions.
  • Durable Execution: Integrates with Workflows for long-running background tasks and human-in-the-loop approval processes.
  • Multi-Modal Integration: Supports MCP server orchestration, email routing, and resumable streaming chat interfaces.

Quick Start

Use the agents-sdk skill to initialize a new stateful agent class with persistent storage and callable RPC methods.

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?

Stateful AI agents on Cloudflare Workers are built using frameworks that provide SQLite-backed state persistence, durable workflows, and WebSocket RPC. These abstractions handle high-concurrency state synchronization and resumable streaming automatically.

What is the best way to manage SQLite state persistence for real-time chat agents?

Managing SQLite state persistence for real-time chat agents requires automatically syncing the state to connected clients. This approach ensures consistency across sessions and supports resumable streaming chat interfaces without manual synchronization logic.

Can I use Cloudflare Workflows for long-running background tasks with AI agents?

Yes, you can use Cloudflare Workflows for long-running background tasks by integrating durable execution with your AI agents. This setup handles scheduled background tasks and human-in-the-loop approval processes efficiently on the server edge.

Does Cloudflare Workers support multi-server MCP orchestration for AI agents?

Cloudflare Workers supports multi-server MCP orchestration through integration with the Model Context Protocol SDK. This enables complex application scenarios like secure email-based agent interaction and multi-server tool routing.

How do I handle high-concurrency state synchronization in Cloudflare Workers?

High-concurrency state synchronization in Cloudflare Workers is handled using Durable Objects and WebSocket RPC. This combination provides real-time state syncing across connected clients and ensures consistency during concurrent agent interactions.