Repository navigation
feat(web-search): add an opt-in Keenable search provider - #68
Open
ilya-bogin-keenable wants to merge 1 commit into
Open
ilya-bogin-keenable wants to merge 1 commit into
ilya-bogin-keenable wants to merge 1 commit into
Conversation
WEB_SEARCH_PROVIDER=keenable routes both native web_search implementations to the Keenable search API. It works without a key; an optional KEENABLE_API_KEY only raises the rate limits. Serper stays the default and Parallel is unchanged.
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 changed
Adds Keenable as a third opt-in backend for the existing
web_searchprovider switch. SettingWEB_SEARCH_PROVIDER=keenablesendsweb_searchto the Keenable search API. It works without a key; an optionalKEENABLE_API_KEYonly raises the rate limits. Both the original and aligned native search implementations use it.plugins/tools/_keenable_search.py: one REST call per query, run concurrently, mapped to the same Serper-shapedorganicrows the Parallel path returns. 429 and 5xx responses are retried twice with backoff; other failures return a clear message and never fall back to Serper.web_search.py/web_search_aligned.py: the Parallel branch also serveskeenable, so domain filtering, URL deduplication and the per-query limit after filtering are shared. Parallel output is unchanged._PROVIDER_NAMESand the config preflight acceptkeenable..env.example,README.md,apodex/README.md,docs/install/global-install.md.tests/test_keenable_search.py(offline,httpx.MockTransport) and one preflight case.Serper remains the implicit provider and its missing-key behavior is unchanged. Custom region, language and time filters (and the aligned tool's location, page and autocorrect options) return a message to use Serper, as they do for Parallel. Each query asks for 10 to 50 results so the existing filters have room before the limit applies. Keenable returns page text rather than a short snippet, so each snippet is collapsed to one line and capped at 1,000 characters.
web_fetchkeeps its existing provider.Sent to Keenable: the query and result count, with
X-Keenable-Title: FrontierAgent, plusX-API-Keyonly whenKEENABLE_API_KEYis set.Setup
Set
WEB_SEARCH_PROVIDER=keenablein the project.envor the user env file, optionally withKEENABLE_API_KEY. The API reference describes the endpoint. Setting the value back toserperrestores the current provider.Validation
KEENABLE_API_KEY, noSERPER_API_KEY) throughweb_search.ainvokeandweb_search_aligned.ainvokewithWEB_SEARCH_PROVIDER=keenable: one query returned 5 of 5 results in 0.82 s, a two-query list returned 10 results in 0.48 s, and the aligned tool returned 8 of 8 in 0.46 s. All 4 requests went to/v1/search/publicwithX-Keenable-Title: FrontierAgentand no key header.uv run pytest tests/test_keenable_search.py tests/test_parallel_search.py apodex/tests/test_config_preflight.py apodex/tests/test_userenv.py -q: 81 passed.uv run pytest -q: 4,820 passed, 10 skipped. The 7 setup errors inapodex/tests/test_global_install.pyalso occur on unmodifiedmainon macOS (the installed launcher's shebang is/bin/shthere).uv run ruff check frontier_agent/ apodex/ benchmarks/ workflows/ plugins/ deploy/ tools/ scripts/: passed.uv run pyright: 0 errors in the touched modules; the full run only reports imports from theevalandhf-spaceextras, which were not installed.tools/import_smoke.py --stage 1,tools/check_symbols.py,tools/check_lazy_exports.pyandgit diff --check: passed.I did not run a full agent session, since that needs model credentials; the live checks call the same tool objects the profiles bind.
Affiliation
Disclosure: I work at Keenable, which runs this API.