Repository navigation
Per-engine queries like the Ask API; drop Google site lanes - #13
Merged
Merged
Conversation
Jev now answers only window and sources; Cloudflare's Clairic extracts one query from the request's own words in parallel, and every engine receives it. The regex candidates, the IMDb entity query and the speculative Google call are removed. Without the AI binding, or when Clairic fails, takes over 1.2s or finds nothing, the request is sent as typed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
jev-search | 4cf548d | Commit Preview URL Branch Preview URL |
Oct 21 2026, 06:48 PM |
Each chosen engine now gets its own span of the request, the same
selection as Search1API's Ask API (monorepo PR #363): Clairic extracts
the Hacker News, Reddit and GitHub queries alongside the intent judgment,
Jev picks a span for every other engine and for any keyword engine
Clairic leaves empty, and the request as typed is the last fallback. The
intent event carries `queries` and `queryFrom` per source.
Hacker News, Reddit and GitHub search only their own engines; the Google
site-restricted lanes and the include/exclude site parameters are gone.
Workers AI's typesafe/jev now answers through the binding wrapped in
`{ state, result }`; read either shape so the cloudflare provider works.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore the keyword candidates and the intent judgment's query/entity choices (identical to search1api-monorepo apps/ask candidates.ts and decisions.ts). Each engine's query is now Clairic or a Jev span, then the intent pick (the entity pick for sources flagged `entityQuery`, none, as in Ask), then the request as typed; `queryFrom` gains 'intent'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changes
The query logic now matches Search1API's Ask API as merged in search1api-monorepo PR #363 (
apps/ask/src/spans.ts,extract.ts,pipeline.ts).A query for each engine (
src/lib/spans.ts, ported from Ask): Jev picks one coherent span of the request per engine with a singlechoiceover every word-boundary span. The port keeps Ask'sNOTES,SCOPE_NAMES,mentionsScope,wordSpans, the 255-candidate cap and engines grouped by note.selectSpans(…, only)keepscontext.sourcesas every routed source, and the choice state and instructions are copied verbatim. A provider error, a refusal or a choice outside the candidates leaves that engine to fall back.Clairic for keyword engines (
src/lib/extract.ts, same fields andAPPLIEDtext as Ask): one Workers AI call extractshackernews,redditandgithubalongside Jev's intent judgment, with a 1.5s timeout. A missing binding, timeout, error or blank field sends that engine to the Jev span choice instead.Orchestration as in Ask:
selectSpansfor the non-Clairic engines runs while Clairic finishes.selectSpansruns again for any Clairic engine that came back empty.If an engine still has no query, it falls back to the intent judgment's pick from the keyword candidates (the entity pick for sources flagged
entityQuery, none, as in Ask), and finally to the request as typed.src/lib/candidates.tsand the intent'squery/entitychoices are restored, identical to Ask'scandidates.tsanddecisions.ts.Intent event: adds
queries(each chosen source's query) andqueryFrom(clairic|jev|intent|request).queryis the first source's query, used for the "Looking for" line. The working panel names a source's own query when it differs, e.g.Reddit for “FastAPI production performance experiences”.queryExtractedis gone.No Google site lanes: Hacker News, Reddit and GitHub search only their own engines, because the search service already does that inside its own engines. Removed
Lane.siteandincludeSites/excludeSites, which no longer go in the request body. The cache key moves tov3. One lane per source, sofound by N enginesnow only appears when different sources return the same URL.Google speculation stays removed.
Workers AI Jev fix:
typesafe/jevnow answers through the binding as{ state: 'Completed', result: {…} }, which left thecloudflareprovider with empty answers for intent, spans and relevance (also onmain).callCloudflarenow reads either shape. Clef answers unwrapped, and Clairic is unaffected.README,
wrangler.jsoncand changelog0011describe the per-engine queries.Differences from Ask
The query logic now matches Ask's: the same fields, notes, instructions and order, and the same fallback chain (Clairic or Jev span → intent pick → request as typed). What remains different:
queryFromin the intent event is jev-search only. It reportsrequestwhen the intent pick is the request itself.main.Evaluation basis
search1api-monorepo
apps/ask/eval/query-clairic-results.md: 102 live requests, two runs, Jev relevance on the top 8. The per-engine Jev span choice did as well as or better than Clairic on web engines, Wikipedia, YouTube and IMDb. Clairic gained on GitHub (4.9 vs 3.3 in both runs), and on Hacker News and Reddit by about 1. X did not repeat its gain, so it stays on Jev. The previous version of this PR sent one Clairic query to every engine; that has been replaced.Testing
pnpm test: 21 files, 195 tests pass. Newspans.test.tsandextract.test.tsare ported from Ask;candidates.test.tsis restored and identical to Ask's. Pipeline tests cover:include_sites.pnpm typecheckandpnpm buildpass.JEV_PROVIDERS=cloudflare).origin/mainon :3031, same requests at the same time:FastAPI JWT authentication examples(clairic) 8/8; redditFastAPI production performance experiences(clairic) 4/8FastAPI JWT authentication examples; find FastAPI production performance experiences; github engine 0/8OCR(clairic) 6/8directed the movie Past Lives(jev); wikipedia, imdbPast Lives(jev); wikipedia 4/8who directed the movie Past Lives, imdbPast Lives; wikipedia 2/8Zig async I/O redesign(clairic) 5/8HN think Zig async I/O redesign; hackernews 4/8Arc browser alternatives(clairic) 7/8reddit opinions Arc browser alternatives; reddit 6/8Counts are on-topic / returned for that engine's lane.
🤖 Generated with Claude Code