Skip to content

[Agents] Fix Think samples and split memory into Sessions and Context concepts - #34718

Draft
mattzcarey wants to merge 3 commits into
productionfrom
claude/agents-sdk-docs-framing-4ywlcx
Draft

mattzcarey wants to merge 3 commits into
productionfrom
claude/agents-sdk-docs-framing-4ywlcx

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Fixes Think code samples that no longer compile, and replaces "Conversation state and memory" with two concept pages: Sessions and Context and memory.

The old memory page mixed two different things and documented agents/experimental/memory/*, which agents no longer exports:

  • a session is the record of a conversation: the transcript as a tree, what is stored versus what each request sends, compaction, and why prompt caching makes rewrites rare
  • context is a scratchpad the agent reads and writes: read-only, writable, and searchable blocks, how they relate to skills, and how changes reach the model without breaking the prompt cache

Think pages:

  • memory samples move from the deprecated configureSession().withContext() chain to configureContext(), and "Session integration" becomes "Session and context", linking to the new concepts
  • the removed defineScheduledTasks and defineMessengers helpers become plain object returns
  • useAgentChat imports from @cloudflare/think/react, onStepFinish becomes onStepEnd, and the comparison with AIChatAgent no longer says Think has an onChatMessage
  • samples convert to JavaScript with TypeScriptExample

/agents/concepts/conversation-state-and-memory/ redirects to the memory page; the old /agents/concepts/memory/ redirect is removed so it does not loop.

Ship with the agents release that includes cloudflare/agents#2773: the memory page describes context changes being sent once and kept where they were delivered, which that PR adds.

Documentation checklist

@github-actions github-actions Bot added the product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. label Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Worker Preview URL: https://gh-claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com
Worker Preview Deployment URL: https://ce7312df.previews.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/agents/concepts/conversation-state-and-memory/ https://gh-claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com/agents/concepts/conversation-state-and-memory/
https://developers.cloudflare.com/agents/harnesses/think/messengers/ https://gh-claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com/agents/harnesses/think/messengers/
https://developers.cloudflare.com/agents/harnesses/think/getting-started/ https://gh-claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com/agents/harnesses/think/getting-started/
https://developers.cloudflare.com/agents/harnesses/think/configuration/ https://gh-claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com/agents/harnesses/think/configuration/
https://developers.cloudflare.com/agents/harnesses/think/lifecycle-hooks/ https://gh-claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com/agents/harnesses/think/lifecycle-hooks/
https://developers.cloudflare.com/agents/harnesses/think/scheduled-tasks/ https://gh-claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com/agents/harnesses/think/scheduled-tasks/
https://developers.cloudflare.com/agents/harnesses/think/ https://gh-claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com/agents/harnesses/think/
https://developers.cloudflare.com/agents/harnesses/think/tools/ https://gh-claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com/agents/harnesses/think/tools/

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://claude-agents-sdk-docs-framing-4ywlcx.previews.developers.cloudflare.com (commit d5c9956)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
8071b16 2026-10-29T17:53:14.409Z View logs ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://49e125ec.previews.developers.cloudflare.com d5c9956 2026-10-29T13:41:46.470Z Visit the dashboard ↗

claude and others added 3 commits October 29, 2026 17:45
Think pages: replace the removed defineScheduledTasks and defineMessengers
helpers with plain object returns, move memory examples from the deprecated
configureSession().withContext() chain to configureContext(), import
useAgentChat from @cloudflare/think/react, and rename onStepFinish to
onStepEnd.

Conversation state and memory: remove samples that import
agents/experimental/memory/*, which agents no longer exports. Keep the
concepts and point to AIChatAgent, the Pi harness, and Think.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017x2hF1BzfPSifknGZh4YNJ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017x2hF1BzfPSifknGZh4YNJ
…t concepts

Replace the conversation-state-and-memory page with two concept pages:
Sessions (the transcript, branches, compaction, prompt caching) and Context
and memory (blocks the agent reads and writes, skills, and how changes reach
the model without breaking the prompt cache). Point the Think pages at them.
@mattzcarey
mattzcarey force-pushed the claude/agents-sdk-docs-framing-4ywlcx branch from d5c9956 to 8071b16 Compare October 29, 2026 17:51
@mattzcarey mattzcarey changed the title [Agents] Fix Think and memory code samples that no longer compile [Agents] Fix Think samples and split memory into Sessions and Context concepts Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants