Repository navigation
Description
What are you trying to do? / 你想做成什么?
Opening this before any code, as CONTRIBUTING asks for changes to packages/protocol-base interfaces.
Proposal: Keenable as one more optional web search provider in Pi Bot, next to Brave, Tavily and SearXNG. The keyless DuckDuckGo/Bing path stays the default; nothing changes unless a user picks Keenable in search settings.
Disclosure: I'm on the technical staff at Keenable, which runs this API. Weigh the proposal with that in mind.
Proposal / 建议
Where it would touch, following the existing shape:
- Protocol (
packages/protocol-base/src/app/search.ts): add"keenable"to the keyedsearch.setConfigbranch (provider: z.enum(["brave", "tavily", "keenable"]),apiKeyoptional) and tosearch.disclose's enum. - Brain (
packages/brain/src/integrations/search/search-service.ts):- Endpoint in
target():https://api.keenable.ai/v1/searchwithX-API-Keywhen a key is stored undersearch:keenable, otherwisehttps://api.keenable.ai/v1/search/publicwith anX-Keenable-Title: Pi Botheader. Keenable has no keyless/keyed split in the result shape, so one adapter covers both. - Same first-use consent as the others (
disclose("keenable"),search_disclosure_requireduntil then), key stored and removed like Brave/Tavily, never logged or sent to the renderer. - Errors: a 429 (keyless is limited to 1,000 requests/hour and 10/second per IP, per https://docs.keenable.ai/authentication) or any API error surfaces as an actionable message ("switch provider or add a Keenable key"), never an empty result. It would go through the existing
search-circuit.tshandling rather than a new path.
- Endpoint in
- Renderer: one entry in
features/settings/search-settings.tsx, key field optional, strings inpackages/i18n(zh + en). - Docs:
docs/privacy/en/outbound-connections.mdand the Chinese counterpart get a Keenable row: what is sent (the query, the key if set, theX-Keenable-Titleheader; no user or device information), and that on Keenable's default policy both keyed and keyless requests are logged; only an Enterprise zero-data-retention plan differs (https://docs.keenable.ai/data-privacy). Having a key does not reduce logging, and the settings copy shouldn't suggest it does. - Tests offline only: request shape with and without a key, result mapping, 429 → actionable error, consent required before the first request. Commits signed off (DCO).
On terms: before any PR I'll get an explicit statement from Keenable on whether a distributed open-source desktop app may call the keyless endpoint, and quote it in the PR. If that isn't clear, the provider would ship keyed-only (the user brings their own key).
What you do today / 现在怎么解决
Keyless DuckDuckGo HTML with a Bing fallback by default, or a Brave / Tavily key, or a self-hosted SearXNG. This would only add a fourth optional choice.
Does this fit, and would you prefer keyed-only from the start?
Activity
w01fb0ss commentedon Nov 26, 2026
Thanks for opening an issue first, and for the disclosure. This fits, on the same terms we gave the similar You.com proposal in #12 — Keenable would sit next to Brave, Tavily and SearXNG as an optional provider. Please go ahead with a PR, with these points:
packages/i18nin both languages.docs/privacyrows are right — please state plainly that both keyed and keyless requests are logged under Keenable's default policy, and keep the settings copy from implying that a key reduces logging.search-circuit.tshandling, never a silent empty result.X-Keenable-Title: Pi Botheader is fine as long as it is sent only on Keenable requests and carries no user or device information.packages/brain/src/integrations/search/, keep tests offline (no real network), and sign off every commit (DCO,git commit -s).Since #12 may touch the same provider enum and settings list, whichever PR lands second just rebases — no need to coordinate beyond that. If anything in the codebase doesn't fit the shape above, ask here before going far.
KGKallasmaa commentedon Nov 27, 2026
Thanks for the clear conditions. The PR is up as #28, keyed-only as agreed (no keyless Keenable path, nothing claimed about the public endpoint), DuckDuckGo/Bing still the default, both-logged privacy text in the docs and settings copy, and every commit signed off. Two notes are in the PR description: the status-to-message mapping sits in
search-run.tsbecausesearch-circuit.tsonly tracks the keyless DuckDuckGo route, and I'll mergemainin if #12 lands first.