Repository navigation
[Agents] Fix Think samples and add a Think memory and context page - #35055
Open
mattzcarey wants to merge 3 commits into
Open
mattzcarey wants to merge 3 commits into
mattzcarey wants to merge 3 commits into
Conversation
mattzcarey
requested review from
a team,
irvinebroque and
rita3ko
as code owners
November 9, 2026 19:13
Contributor
AI Review✅ Reviewed Commands
|
Contributor
Review coverage✅ The ownership area is covered. ✅ 1 area already covered
CODEOWNERS mappings for displayed areas (1)
|
Contributor
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://docs-agents-think-fixes.previews.developers.cloudflare.com (commit cd4325a)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
This was referenced Nov 10, 2026
mattzcarey
commented
Nov 10, 2026
| Think splits memory into two parts: | ||
|
|
||
| - **The conversation.** Think stores every message in the agent's SQLite database, as a tree, so regenerated answers are kept as branches. `configureSession()` sets how long conversations are compacted and searched. | ||
| - **The system prompt.** Think builds the system prompt from context blocks: labelled sections such as a fixed identity, or a `memory` block the model can write to. `configureContext()` declares them. |
Member
Author
There was a problem hiding this comment.
and lets you build the system prompt / keeping track of new sections.
mattzcarey
commented
Nov 10, 2026
|
|
||
| Set `truncationStep` to `Infinity` to turn read-time truncation off. Pair that with compaction, so the context stays bounded. | ||
|
|
||
| ## Upgrade from Think 0.17 |
Member
Author
There was a problem hiding this comment.
nah remove this section imo not needed.
irvinebroque
approved these changes
Nov 10, 2026
neelakolkar-cf
approved these changes
Nov 10, 2026
Collaborator
|
@mattzcarey All approved and ready, please merge whenever all changes are done, thanks! 🙌 |
mattzcarey
added a commit
that referenced
this pull request
Nov 11, 2026
…cribe @cloudflare/codemode as it ships
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the Think pages for
@cloudflare/think0.24.0 and@cloudflare/computer0.10, fixes samples that no longer compile, and adds a Think Memory and context page that replaces the "Session integration" section.The Think pages still used APIs that Think no longer exports or has deprecated:
defineScheduledTasksanddefineMessengersare gone, so those samples return plain objects (ThinkScheduledTasksfor scheduled tasks)configureSession().withContext()chain toconfigureContext(), and the context tools areset_contextandsearch_contextuseAgentChatimports from@cloudflare/think/react, so@cloudflare/ai-chatis no longer installedonStepFinishbecomesonStepEnd, and the comparison withAIChatAgentno longer says Think has anonChatMessageto overrideThink 0.24 needs Computer 0.10, so the workspace examples use
CodemodeBackendfrom@cloudflare/computer/backends/codemodeandcodemode:host modules (codemode:tools,codemode:git) instead ofWorkerJavaScriptBackendandws:, with a short upgrade note.The new page covers context blocks, compaction, message storage, media eviction, and prompt caching (
truncationStep). The Tools page gains "Connect a workspace" and a fetch tool section (fetchTools,createFetchTools()), and the browser section moves tobrowserToolfromagents/browser/ai-sdk.Code samples typecheck against
@cloudflare/computer@0.10.0. Merge with or after the@cloudflare/think@0.24.0release (cloudflare/agents#2808). Internal links and anchors resolve, and the pages compile as MDX. Replaces the Think parts of #34718 and #34723.