Skip to content

Make web research follow the question's language - #38

Merged
devbadya merged 1 commit into
mainfrom
cursor/smarter-web-research-language-2aa3
Aug 26, 2026
Merged

devbadya merged 1 commit into
mainfrom
cursor/smarter-web-research-language-2aa3

Conversation

@devbadya

Copy link
Copy Markdown
Owner

Web research was answering German questions from English Wikipedia, dating "today's news" with nothing, and spending two of the reader's 20 requests a minute to open a Wikipedia page MediaWiki already serves with CORS.

This is a different path from #32 and #34, which fold five page-reads into one call and spend most of the keyless budget on a single question. Here the existing web_search / read_page pair stays, and the work that does not need the reader moves off it.

What one search/read now does

  • German questions search German sources. Wikipedia uses de.wikipedia.org when the query is German (Wer ist…, Was kostet…, umlauts) and falls back to English if that edition has no article. DuckDuckGo gets kl=de-de. English who was Ada Lovelace is not mistaken for German, because bare was is also English.
  • Wikipedia pages skip the reader. read_page of a *.wikipedia.org URL goes through MediaWiki (origin=*, verified from https://devbadya.github.io). The extract is truncated here to 8,000 characters. Wikipedia's own exchars parameter is capped at 1,200, which cuts off before the sentence that names a current office holder — on the live Bundeskanzler article, Friedrich Merz sits at character 1,539.
  • Every search is dated. Results start Searched 2026-08-26 for "…", so "current" and "today's news" have a date without spending a tool round on current_time.
  • The research skill teaches the missing step. The old exemplar only answered from a snippet. Wikipedia's lead about an office often does not name the person, which is the UN secretary-general eval. A second exemplar now opens that page; a third answers Wer ist der Bundeskanzler? in German from a German source, without translating the query.

Cost

A DuckDuckGo search still spends one reader request. Opening the Wikipedia hit spends none. The five-source research tools spend six.

Verification

pnpm check (936 tests) and pnpm build pass. New tests cover language detection, the German Wikipedia host, the English fallback, DuckDuckGo kl=de-de, MediaWiki read_page, and the date stamp.

Live against Wikipedia with Origin: https://devbadya.github.io: search for Bundeskanzler returns the German articles with Access-Control-Allow-Origin: *; reading Bundeskanzler (Deutschland) and keeping 8,000 characters includes Friedrich Merz; Who was Ada Lovelace still hits English Wikipedia.

The model itself is not exercised: this environment has no GPU adapter, and there is no CPU fallback. Routing and tool-use rates still need /?eval in Chrome on a real GPU.

Open in Web Open in Cursor 

German questions search German Wikipedia and prefer German DuckDuckGo
results. Wikipedia pages are read through MediaWiki instead of the
reader, which saves the shared 20-request budget and keeps the sentence
that names a current office holder. Search results carry today's date,
and the research skill now teaches opening a page when the snippet is
not enough.

Co-authored-by: Sebastian <devbadya@users.noreply.github.com>
@devbadya
devbadya marked this pull request as ready for review August 26, 2026 21:11
@devbadya
devbadya merged commit d9a142e into main Aug 26, 2026
1 check passed
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.

2 participants