Skip to content

docs(examples): add web research example using web_search - #2517

Merged
ben-reitz merged 5 commits into
mainfrom
feat/web-research-example
Oct 7, 2026
Merged

ben-reitz merged 5 commits into
mainfrom
feat/web-research-example

Conversation

@ben-reitz

@ben-reitz ben-reitz commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A new example, examples/web-research: a chat agent that answers from the live web with the web_search tool from #2502 and cites its sources. A side panel shows each search three ways: Results, Model saw (the trimmed toModelOutput text) and You got (the full response), plus settings for provider and max results.

I've also done a bunch of UI improvements compared to the other examples to remove some of the janky behaviour and improve the design. e.g. the feed only follows the stream while you're at the bottom, tool steps show a pending state between them, and the chat pieces live in a reusable src/chat-ui.tsx.

There's a ton we should probably do for all the other examples to improve the UI but this will do for now.

Evidence

Example deployed here: https://web-research-example.agents-b8a.workers.dev/

  • Binding path via npm start on an account without credits (like agents): the search fails with web_search_payment_required, the UI shows it, and the model answers from memory.
  • Funded account (my personal account): searches return results, and answers cite them inline.

Screenshots

These were taken running locally against my personal CF account (where I have gateway credit):

1-answer 2-model-saw

Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

@ben-reitz ben-reitz closed this Oct 7, 2026
@ben-reitz ben-reitz reopened this Oct 7, 2026
@changeset-bot

changeset-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 57a05c9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@agent-think

agent-think Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (e3351863 → 57a05c90, workflow run)

devin-ai-integration[bot]

This comment was marked as resolved.

@pkg-pr-new

pkg-pr-new Bot commented Oct 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@2517

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@2517

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@2517

hono-agents

npm i https://pkg.pr.new/hono-agents@2517

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@2517

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@2517

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@2517

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@2517

commit: 57a05c9

@ben-reitz
ben-reitz merged commit 000d076 into main Oct 7, 2026
6 checks passed
@ben-reitz
ben-reitz deleted the feat/web-research-example branch October 7, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant