Repository navigation
Add SpecStream web search and access nodes - #135
Open
Specstreamai wants to merge 1 commit into
Open
Specstreamai wants to merge 1 commit into
Specstreamai wants to merge 1 commit into
Conversation
SpecStream: Web Search searches the live web through SpecStream and emits title, url, published date and the passage of each page closest to the query, cut server side at maxTextChars and fitted to a wire like the other web nodes. SpecStreamAccess holds the API key and checks it at connect time the way ExaAccess does: a POST to /v1/web-search with no body answers 400 to a good key and 401 to a bad one, and runs no search.
This branch has not been deployed
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 and why
Adds SpecStream to the
webpackage as another search option beside Exa's Web Search and Keenable's: aSpecStreamSearchnode and aSpecStreamAccessnode. Each result carries the passage of the page that best matches the query, which SpecStream cuts tomaxTextCharsitself, so an LLM node downstream reads the relevant part of each page instead of its opening lines. The numbers behind it: 64.0 item F1 on all 200 WideSearch tasks against 57.6 for Parallel and 56.1 for Exa, and 66.7 on Seal-0 (https://specstream.ai/benchmarks).How
Authorization: Bearer {key}, and a search node whoseaccountinput is required.{"q", "num", "compact": true, "source_max_chars"}tohttps://api.specstream.ai/v1/web-search.source_max_charsismaxTextCharsclamped to the 10,000 the API accepts. The node still runscap_texton each passage andwire::fit_textson the list, as WebSearch and KeenableSearch do, so multibyte text cannot push it past a wire.siteis appended to the query assite:<domain>. SpecStream holds that operator on every result rather than ranking by it, and the query port's description names the other operators it holds (-site:, quoted phrases,after:,before:).publishedDate, which SpecStream gives aspublishedon each source.POST https://api.specstream.ai/v1/web-searchwith no body andexpectStatus: 400. A good key reaches the missingqerror (400) and a bad one is refused first with 401, both checked by hand; no search runs, so nothing is charged.verificationisreports_validity,free.catalog/web/specstream_*changes. The service count sentence that the Keenable PR updated indeclaring-a-service.mdis gone from main, so the docs needed nothing.On the wire: the query, plus
site:when the port is set, the result count and the text cap, signed with the key.Linked issue
None.
What kind of change
Checklist
cargo testandcargo clippypass. (cargo test -p weft-catalog, and clippy-D warningson the emittedwebpackage crate withnode-testson; see below)pnpm -C packages/weft-graph testpasses.pnpm -C extension-vscode testpasses.scripts/run-db-tests.shpasses against a real Postgres./flow-4-reviewand/flow-5-review-checkran as a pair until a pair turned up nothing.Anything reviewers should look at twice
What I ran, on Linux with toolchain 1.99.1 from
rust-toolchain.toml:weft test-node SpecStreamSearch SpecStreamAccess KeenableSearch WebSearchwith the CLI built from this branch: all 16 basic and fake tests pass, the 6 new ones and the existing KeenableSearch and WebSearch ones.cargo test -p weft-catalog: 43 and 19 passed, includingevery_stdlib_node_loads_strictandevery_stdlib_node_has_the_error_output.cargo clippy --all-targets --features node-tests -- -D warningson the emittedpkg_webcrate: clean.weft validateon a small program wiringSpecStreamAccessintoSpecStreamSearch: no diagnostics, and wiringcountintoqueryis refused with the expected type mismatch.site: docs.rsgave thetokio::select!page first, then two more docs.rs pages.scripts/run-node-tests.sh, which needs a full install with the broker. The live test declares thespecstreamservice, so it wants aWEFT_NODE_TEST_SPECSTREAM_KEYgrant.The
faketier's client does not apply the recipe's auth header, so the Bearer header is covered by the recipe itself and by the live run, not by a fake test.Disclosure: I run SpecStream, the company behind this API.