Skip to content

tools/keenable: add Keenable web search tool (works without an API key) - #1567

Open
KGKallasmaa wants to merge 3 commits into
tmc:mainfrom
KGKallasmaa:tools-keenable
Open

KGKallasmaa wants to merge 3 commits into
tmc:mainfrom
KGKallasmaa:tools-keenable

Conversation

@KGKallasmaa

Copy link
Copy Markdown

Adds tools/keenable, a tools.Tool for the Keenable web search API. It follows the shape of tools/duckduckgo.

Why: like DuckDuckGo it needs no API key, but it's a JSON API rather than HTML scraping, and each result carries a long page excerpt rather than a one-line snippet. That makes it a sturdier zero-setup search tool for agents.

  • With no key, it calls POST https://api.keenable.ai/v1/search/public (rate limited per IP), sending the X-Keenable-Title: langchaingo header that endpoint requires.
  • An optional key from WithAPIKey or KEENABLE_API_KEY switches it to /v1/search with X-API-Key.
  • Options: WithMaxResults (clamped to 1–50), WithSite (single-domain filter), WithHTTPClient, WithBaseURL and WithAppTitle.
  • Output follows DDG's Title / Description / URL blocks, plus a Published: line when available. Results without a URL are skipped, and an empty result returns the same "No good … Results" message as DDG.
  • docs/parity_matrix.md: adds a Tools row.

Tests (tools/keenable/keenable_test.go):

  • TestKeenableTool is an httprr test. The recording was made live against the keyless endpoint (go test -httprecord=. ./tools/keenable/), and since no credentials are needed it can be re-recorded at any time. It uses rr.Replaying() before t.Parallel(), per lint -testing.
  • httptest unit tests cover the keyless path and headers plus the body (site, max_results), the keyed path (trailing slash in the base URL is tolerated), error status propagation, the no-results message and option clamping.
  • go test ./tools/keenable/ passes, go vet and gofmt are clean, and go run ./internal/devtools/lint -testing reports nothing for the new package.

API docs: https://docs.keenable.ai/api-reference/search. Disclosure: I work with the Keenable team.

@KGKallasmaa

Copy link
Copy Markdown
Author

@tmc could you take a look when you have a moment? It's a keyless JSON alternative to the DuckDuckGo tool, with an httprr recording that can be re-recorded without credentials. Thanks!

cursoragent and others added 2 commits November 5, 2026 08:09
Co-authored-by: Karl-Gustav Kallasmaa <KGKallasmaa@users.noreply.github.com>
Replace hand-rolled net/http search with github.com/keenableai/keenable-sdk/go.
Map tool options to SDK Client/SearchOptions, keep DDG-style formatting and
ErrNoGoodResult behavior, and re-record keyless httprr traces.

Co-authored-by: Karl-Gustav Kallasmaa <KGKallasmaa@users.noreply.github.com>

This branch has not been deployed

No deployments
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