AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

agents-sdk

Build, debug, or review Cloudflare Agents SDK applications using the agents package.

Original source
cloudflare
License
Apache-2.0
Pinned revision
e44f580f9c4fa3bf268e284ae7706c7954ba31fd

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read cloudflare--agents-sdk at revision e44f580f9c4fa3bf268e284ae7706c7954ba31fd, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 21

references/streaming-chat.md

Streaming Chat with AIChatAgent

Use AIChatAgent for persisted conversations with streaming and tools; use callable streaming RPC for non-chat output. Before adapting an existing app, check its installed agents, @cloudflare/ai-chat, and AI SDK versions against the current docs.

Read the relevant documentation before implementing:

| Task | Documentation | |------|---------------| | Build a chat agent | Chat agent example — setup, provider, server, and UI | | Implement or customize chat | Chat agents — message format, tools, custom streams, persistence, concurrency, cancellation, and recovery | | Connect a client | Client guidance — React, vanilla JS, HTTP, and authentication | | Stream non-chat results | Callable methods — server and client streaming RPC | | Trigger background turns | Server-driven messages | | Add approvals | Human-in-the-loop |

Forward the request abort signal to the model call so cancellation stops generation. When customizing streams, verify persistence and completion behavior for the installed version. Treat client reconnection and Durable Object eviction as separate recovery cases.